text stringlengths 27 775k |
|---|
CREATE TABLE users (
id uuid PRIMARY KEY,
username varchar(255) not null unique,
email varchar(255) not null unique,
password_hash varchar(255) not null
); |
package domain
import "sync"
// GracefulShutdown used for a graceful finish usecases
type GracefulShutdown struct {
sync.Mutex
ShutdownNow bool
UsecasesJobs int
}
|
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.envers.internal.entities.mapper.relation;
import org.hiberna... |
// -*- C++ -*-
//
// Package: Services
// Class : CheckTransitions
//
// Implementation:
// <Notes on implementation>
//
// Original Author: Chris Jones
// Created: Thu Sep 8 14:17:58 EDT 2005
//
#include "FWCore/ServiceRegistry/interface/ServiceMaker.h"
#include "FWCore/ParameterSet/interface/... |
package routes
import (
"time"
"github.com/skyareas/skyjet"
)
func NewAuthRouter() *skyjet.Router {
r := skyjet.NewRouter()
r.Get("/login", getLogin)
r.Post("/login", postLogin)
r.Post("/logout", logout)
return r
}
func getLogin(_ *skyjet.HttpRequest, res *skyjet.HttpResponse) error {
year := time.Now().For... |
package eventInput
type EventInput int
func (el EventInput) String() string {
return eventInputString[el]
}
var eventInputString = [...]string{
"input",
}
const (
// KInput
// en: The event occurs when an element gets user input
KInput EventInput = iota
)
|
import { Service, $log } from "@tsed/common";
import EmployeeRepository from "./../../repositories/EmployeeRepository";
import Employee from "../../models/Employee";
@Service()
export class EmployeeService {
constructor(private readonly empRepo: EmployeeRepository) {}
/**
* Return ALl the Employees Stored in t... |
from tornado.web import RequestHandler
import json
import socketio
from socketio import AsyncNamespace
# WebSocket Namespaces
from routes.api.guids import Guilds
sio = socketio.AsyncServer(async_mode="tornado")
_Handler = socketio.get_tornado_handler(sio)
config = json.load(open("config/web.json"))
CORS_ORGINS = co... |
# macOS dev environment setup
## Security
### Hard disc encryption
Go to `System preferences > Security & Privacy > FileVault` and make sure the FileVault is ON.
### Firewall
Go to `System preferences > Security & Privacy > Firewall` and make sure the Firewall is ON.
### More
https://blog.bejarano.io/hardening-m... |
var stepped = 0;
var start, end;
$(function()
{
$('#submit').click(function()
{
stepped = 0;
var txt = $('#input').val();
var files = $('#files')[0].files;
var config = buildConfig();
if (files.length > 0)
{
start = performance.now();
$('#files').parse({
config: config,
before: functio... |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Authy.Net
{
/// <summary>
/// The result of a request to verify a token
/// </summary>
public class VerifyTokenResult : AuthyResult
{
/// <summary>
/// Confirmation if token... |
#! /usr/bin/env bash
#BSUB -J cellranger
#BSUB -o logs/cellranger_%J.out
#BSUB -e logs/cellranger_%J.err
#BSUB -R "select[mem>4] rusage[mem=4]"
#BSUB -q rna
set -o nounset -o pipefail -o errexit -x
mkdir -p logs
run_snakemake() {
local config_file=$1
drmaa_args='
-o {log}.out
-e {log}... |
//! Skybox rendering
use super::{to_u8_slice, SkyboxVertex};
use wgpu::util::{BufferInitDescriptor, DeviceExt};
const FAR: f32 = 900.0;
const EAST: [[f32; 3]; 4] = [
[FAR, -FAR, -FAR],
[FAR, -FAR, FAR],
[FAR, FAR, -FAR],
[FAR, FAR, FAR],
];
const MESH_INDEX: [u32; 6] = [0, 1, 2, 3, 2, 1];
const WES... |
#!/usr/bin/env bash
set -e
set +x
cmd_args=()
compose_exec="docker-compose"
if ! command -v "${compose_exec}" &> /dev/null; then
compose_exec="docker"
cmd_args+=("compose")
fi
if ! command -v "${compose_exec}" &> /dev/null; then
echo "Unable to locate or docker."
echo "Please follow the instructios present ... |
package com.example.android.basicandroidaccessibility.ui.home
import android.content.Intent
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.util.Log
import android.view.LayoutInflater
import android.view.Vie... |
import configuration from './configuration';
import * as NodeCache from 'node-cache';
class Cache {
cache: NodeCache.NodeCache
constructor() {
this.cache = new NodeCache({ stdTTL: 0, checkperiod: 60 })
}
setKey(key: string, obj) {
this.cache.set(key, obj);
return Promise.resolv... |
function get_tag_info(tag::GitHub.Tag)
str = sprint() do io
Downloads.download(tag.object["url"], io)
end
dict = JSON.parse(str)
parts = splitpath(tag.url.path) # why is this not straight-forward?
repo = GitHub.Repo(parts[3] * "/" * parts[4])
return (
commit = dict["obj... |
package br.ufmg.cs.systems.fractal.util
import java.io.{ObjectInputStream, ObjectOutputStream}
import org.apache.hadoop.conf.Configuration
class SerializableConfiguration(@transient var value: Configuration) extends Serializable {
private def writeObject(out: ObjectOutputStream): Unit = {
out.defaultWriteObjec... |
<?php
namespace tests;
use alexantr\tinymce\TinyMCEAsset;
use yii\web\AssetBundle;
class TinyMCEAssetTest extends TestCase
{
public function testRegister(): void
{
$view = $this->mockView();
$this->assertEmpty($view->assetBundles);
TinyMCEAsset::register($view);
// TinyMCEA... |
package soy.gabimoreno.imagegenerator.domain
private const val COLOR_WHITE = "FFFFFF"
const val CANVAS_WIDTH = 1500
const val CANVAS_HEIGHT = 750
const val POLYGON_WIDTH = 500
const val POLYGON_HEIGHT = 500
const val POLYGON_COLOR = COLOR_WHITE
const val INCLINATION = 25
const val SATURATION = 50
const val BRIGHTN... |
#include <array>
#include <iostream>
template <typename T, size_t N>
std::istream& operator >>(std::istream& input, std::array<T, N>& v)
{
for (T& a : v)
input >> a;
return input;
}
void answer(unsigned v)
{
std::cout << v << '\n';
}
void solve(const std::array<unsigned, 5>& m, const std::array<... |
package com.avito.ci.steps
import com.avito.android.plugin.artifactory.artifactoryAppBackupTask
import com.avito.cd.AndroidArtifactType.APK
import com.avito.cd.AndroidArtifactType.BUNDLE
import com.avito.cd.CdBuildConfig
import com.avito.cd.cdBuildConfig
import com.avito.cd.isCdBuildConfigPresent
import com.avito.logg... |
import { Balance } from './../models/balance.model';
import { Exchange } from './../enums/exchange.enum';
export class Investor {
readonly _id: string;
readonly name: string;
readonly trader_id?: string;
readonly tradeKey?: string;
readonly tradeSecret?: string;
readonly email: string;
readonly phone: st... |
/*
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: ... |
(function ($, Drupal) {
/**
* Add necessary theming hooks.
*/
$.extend(Drupal.theme, /** @lends Drupal.theme */{
commerceAuthorizeNetError: function (message) {
return $('<div class="messages messages--error alert alert-danger alert-dismissible"></div>').html(message);
}
});
})(window.jQuery, ... |
package com.rewardtodo.cache.mapper
import com.rewardtodo.cache.model.UserEntity
import com.rewardtodo.domain.User
object UserMapper: Mapper<UserEntity, User> {
override fun mapToEntity(type: User): UserEntity {
return UserEntity(
type.name,
type.points,
type.id
... |
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// for details. 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:kernel/ast.dart';
import 'package:kernel/clone.dart' show CloneVisitorNotMembers;
impor... |
<?php
namespace JHWEB\FinancieroBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* FroAcuerdoPago
*
* @ORM\Table(name="fro_acuerdo_pago")
* @ORM\Entity(repositoryClass="JHWEB\FinancieroBundle\Repository\FroAcuerdoPagoRepository")
*/
class FroAcuerdoPago
{
/**
* @var int
*
* @ORM\Column(na... |
#!/bin/bash
set -x
export FLAGS_call_stack_level=2
export CUDA_VISIBLE_DEVICES=0,1
python -m paddle.distributed.launch \
inference.py --model_type gpt \
--model_path ../../static/inference_model_pp1mp2/
|
# Line Width

```go
package main
import "github.com/fogleman/gg"
func main() {
const S = 1000
dc := gg.NewContext(S, S)
dc.SetRGB(1, 1, 1)
dc.Clear()
dc.SetRGB(0, 0, 0)
w := 0.1
for i := 100; i <= 900; i += 20 {
x := float64(i)
dc.DrawLine(x+50, 0, x-50, S)
dc.SetLineWidth(w)
dc.Stroke... |
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Project extends Model
{
protected $table = 'projects';
protected $guarded = array('id');
public function customer()
{
return $this->belongsTo(\App\Customer::class, 'id_cust');
}
public function service()
{
... |
<?php only_admin_access(); ?>
<?php if((isset($_GET['only_updates']) and $_GET['only_updates']) or isset($params['show_only_updates'])){ ?>
<module type="admin/developer_tools/package_manager/browse_packages" show_only_updates="1" />
<?php } else { ?>
<module type="admin/developer_tools/package_manager... |
using ESRI.ArcGIS.Geodatabase;
using ProSuite.Commons.Essentials.CodeAnnotations;
using ProSuite.QA.Container.TestSupport;
namespace ProSuite.QA.Container
{
public interface IRelatedTablesProvider
{
[CanBeNull]
RelatedTables GetRelatedTables([NotNull] IRow row);
}
}
|
using System;
using System.Collections.Generic;
using System.Text;
namespace GankCompanionDataReader.eventHandler
{
public interface IPartyRepository
{
string GetPartyID();
void SetPartyID(string partyId);
}
}
|
# -*- coding: utf-8 -*-
"""
实现 Ctrl 1 ~ 6 的功能. 主要是宠物的动作条按键. 1 进攻主人目标, 2 撤回, 3 原地待命.
"""
from ._config_and_script import config, script
from .. import act
from .... import keyname
from ....script import (
Hotkey, SendLabel,
)
def build_hk_ctrl_1_6():
return [
Hotkey(
name="Ctrl {}".format... |
package com.github.kmizu.kollection
data class KBatchedQueue<T>(private val front: KList<T>, private val rear: KList<T>) : KQueue<T> {
constructor() : this(KList.Nil, KList.Nil)
private fun ensureFront(f: KList<T>, r: KList<T>): KBatchedQueue<T> = when {
f.isEmpty -> KBatchedQueue(r.reverse(), KList.Ni... |
#!/bin/bash
file="./db-backup.properties"
# Function to get dateValue as String
function getDateAsStr()
{
dateStr=$(date '+%Y%m%d-%H%M%S');
}
# Function to update properties file
updateBackupCount(){
if [ $incCount -lt $incLimit ]
then newCount=$(($incCount + 1 ));
else
newCount="0"
fi... |
#!/bin/bash
# A wrapper around run_lr.sh, to make it easier to invoke it right with what stereo_gui dumps out
# when selecting a region. This wrapper will take as inputs the following ugly arguments:
# $(pwd) tag corr Crop src win for WV02_20170511151556_103001006882D700_17MAY11151556-P1BS-501479705100_01_P002.ntf: ... |
/*
Copyright 2021 Smart Engines Service LLC
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclai... |
# Turn off HomeAssistant service
echo "Turning off Home Assistant"
sudo systemctl restart home-assistant@pi.service
# Go to HomeAssistant directory
echo "Entering HomeAssistant directory"
cd /home/pi/homeassistant
# Activate venv
echo "Enabling virtualenv"
source bin/activate
# Run upgrade
echo "Upgrading Home Assis... |
/*
Copyright 2020 caicloud authors. All rights reserved.
*/
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha3
// FlavorListerExpansion allows custom methods to be added to
// FlavorLister.
type FlavorListerExpansion interface{}
// MLNeuronListerExpansion allows custom methods to be added to
// MLNeuron... |
package com.github.damianreeves.ticketbroker.common.model.domain.reservation
import java.util.UUID
import com.github.damianreeves.ticketbroker.common.model.domain.marketplace.MarketPlaceType
final case class ReservationUrn(uid:UUID, marketplace:MarketPlaceType) {
def asUrn:String = s"urn:reservation:marketplace=$m... |
module TwitchSushi
class Error < StandardError
class ResponseError < Error
def initialize(arg, url, status, body)
super(arg)
@url = url
@status = status
@body = body
end
attr_reader :url, :status, :body
end
class ClientError < ResponseError
end
... |
using System;
using System.Reflection;
using FubuCore.Reflection;
using FubuCore.Util;
namespace FubuMVC.Core.Registration
{
public class ActionMethodFilter : CompositeFilter<MethodInfo>
{
public ActionMethodFilter()
{
Excludes += method => method.DeclaringType == typeof(... |
//
// Decompiled by Procyon v0.5.36
//
package openjava.ptree;
import openjava.ptree.util.ParseTreeVisitor;
public class MemberInitializer extends NonLeaf implements MemberDeclaration
{
private boolean _isStatic;
public MemberInitializer(final StatementList list) {
this(list, false);
}
... |
require "test_helper"
module Sources
class FuraffinityTest < ActiveSupport::TestCase
context "A furaffinity post" do
strategy_should_work(
"https://www.furaffinity.net/view/46821705/",
image_urls: ["https://d.furaffinity.net/art/iwbitu/1650222955/1650222955.iwbitu_yubi.jpg"],
profil... |
namespace Skight.eLiteWeb.Presentation.Web.FrontControllers
{
public interface CommandFilter
{
bool can_process(WebRequest request);
}
} |
from recipes.testing import Expect, Throws, mock, expected, ECHO
from recipes.string import Percentage, sub, title
import pytest
test_sub = Expect(sub)(
# basic
{mock.sub('hello world', {'h': 'm', 'o ': 'ow '}):
'mellow world',
mock.sub('hello world', dict(h='m', o='ow', rld='')):
'mellow wow',... |
-- file:plpgsql.sql ln:1267 expect:true
insert into PSlot values ('PS.first.a1', 'PF1_1', '', 'WS.101.1a')
|
<?php
/**
*
* PHP Error Checker v0.2
* By AyoobAli.com
*
*/
$path = "";
$site = "";
$Error['Fatal'] = 1;
$Error['Parse'] = 1;
$Error['Warning'] = 1;
$Error['Notice'] = 1;
$custom = 0;
if ( $argv[1] ) {
$path = $argv[1];
}
if ( $argv[2] ) {
$site = $argv[2];
}
if ( count( $argv ) > 3 ) {
$Error['Fatal'] = ... |
#!/usr/bin/env bash
export LDFLAGS="$LDFLAGS -Wl,-rpath,${PREFIX}/lib -L${PREFIX}/lib -lz"
./autogen.sh
./configure --prefix="${PREFIX}"
make
make test
make -j${CPU_COUNT} install
|
import React, { useEffect } from 'react';
import { useResidentViewState } from '../../../states';
import useAxios from 'axios-hooks';
import {
Button,
Dialog,
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
makeStyles
} from '@material-ui/core';
const ResetPasswordDialog = ({ open, onClose ... |
// Copyright 2012 Henrik Feldt, Chris Patterson, et. al.
//
// 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 require... |
#ifndef IMMAILWIDGET_H
#define IMMAILWIDGET_H
#include <QWidget>
#include <QMap>
#include "model/IMConstant.h"
class QPushButton;
class QTabWidget;
class IMMailButton;
class IMMailOutWidget;
class IMMailInWidget;
class IMMailWriteWidget;
class QLabel;
class IMMailCtrl;
class IMMailInformationWidget;
class IMMailWidg... |
package net.thucydides.core.annotations;
import net.thucydides.core.model.TestTag;
import net.thucydides.core.model.formatters.ReportFormatter;
import net.thucydides.core.tags.TagConverters;
import net.thucydides.core.util.JUnitAdapter;
import org.apache.commons.lang3.StringUtils;
import java.lang.reflect.Method;
imp... |
<?php
namespace Softonic\Proxy\Guzzle\Middleware\Repositories;
use GuzzleHttp\Client as GuzzleClient;
use Psr\Cache\CacheItemPoolInterface;
use Softonic\Proxy\Guzzle\Middleware\Exceptions\ProxiesNotAvailable;
use Softonic\Proxy\Guzzle\Middleware\Interfaces\ProxyInterface;
use Softonic\Proxy\Guzzle\Middleware\Traits\C... |
import { em, lightgray, percent } from "csx/lib";
import { style } from "typestyle/lib";
import { IStylesheetProvider } from "../interfaces/IStylesheetProvider";
import { addStyles } from "../tools/StyleUtils";
import { AbstractComponent } from "./AbstractComponent";
import { ElementFactory } from "./ElementFactor... |
package com.jcaique.dialetus.data.networking
internal suspend fun <T> executionHandler(func: suspend () -> T): T {
val transformers = listOf(
HttpErrorHandler,
SerializationErrorHandler
)
return try {
func.invoke()
} catch (throwable: Throwable) {
throw transformers
... |
---
alturls:
- https://twitter.com/bismark/status/12959603936
- https://www.facebook.com/17803937/posts/121434667873157
archive:
- 2010-04
categories:
- blog
date: '2010-04-27T18:58:12'
link: http://timesandseasons.org/index.php/2010/04/this-mormon-life/
oldpaths:
- /post/553947679
- /post/553947679/this-mormon-life
sl... |
using BuildingBlocks.Domain.Event;
namespace BuildingBlocks.Outbox;
public class OutboxMessage
{
public Guid Id { get; private set; }
/// <summary>
/// Gets name of message.
/// </summary>
public string Name { get; private set; }
/// <summary>
/// Gets the date the message occurred.
... |
use super::token::{
keyword::Keyword,
literal::Literal,
punctuation::Punctuation,
token_variance::{Span, Token, TokenType},
};
use nom::{
branch::alt,
bytes::complete::{tag, take_until},
character::complete::{
alpha1,
alphanumeric1,
char,
digit1,
line_ending,
multispace1,
one_of,
space1,
tab,
... |
# CITYSPIRE
### DATA SCIENCE SYSTEM ARCHITECTURE

https://whimsical.com/cityspire-ds-architecture-QPTz3ZTyw5orFHKcQm7jZv
Create a copy of architecture and then make changes
|
require_relative '../../spec_helper'
require 'spectrum/config/metadata_component'
require 'spectrum/config/quoted_search1_metadata_component'
describe Spectrum::Config::QuotedSearch1MetadataComponent do
subject { described_class.new('Name', config) }
let(:config) {{
'type' => 'quoted_search1',
'variant' =>... |
;; Misc extra routines for pgplot - useful higher level functions
(in-package pgplot)
(defun pgplot-encode-float-sci-notation
(x ndigits &key (min-exponent 0) (show-plus-sign nil))
"Encode a number in scientific notation using pgplot escaping
syntax. MIN-EXPONENT is the smallest absolute value exponent that... |
import map from 'lodash.map';
import mapKeys from 'lodash.mapkeys';
import camelCase from 'lodash.camelcase';
import kebabCase from 'lodash.kebabcase';
import snakeCase from 'lodash.snakecase';
import startCase from 'lodash.startcase';
import uppercase from 'lodash.uppercase';
import lowercase from 'lodash.lowercase';
... |
module Utilities.Number where
import System.Environment
import Numeric
import qualified Utilities.Types
oct2dig x = fst $ head (readOct x)
hex2dig x = fst $ head (readHex x)
bin2dig = bin2dig' 0
bin2dig' digint "" = digint
bin2dig' digint (x:xs) = let old = 2 * (if x == '0' then 0 else 1) in
bin2dig' old xs
toD... |
// SPDX-FileCopyrightText: 2019 pancake <pancake@nopcode.org>
// SPDX-License-Identifier: LGPL-3.0-only
static bool rtr_visual(RzCore *core, TextLog T, const char *cmd) {
bool autorefresh = false;
if (cmd) {
rz_cons_break_push(NULL, NULL);
for (;;) {
char *ret;
rz_cons_clear00();
ret = rtrcmd(T, cmd);
... |
基于 python 的新后端服务器
## 开发环境
python 版本: 3.8
使用 [poetry](https://github.com/python-poetry/poetry) 进行依赖管理。
```shell
git clone https://github.com/bangumi/server bangumi-server
cd bangumi-server
```
进入虚拟环境
```shell
python -m venv .venv # MUST use python 3.8
source .venv/bin/activate # enable virtualenv
```
安装依赖
```she... |
from math import *
import proteus.MeshTools
from proteus import Domain
from proteus.default_n import *
from proteus.Profiling import logEvent
from proteus.ctransportCoefficients import smoothedHeaviside
from proteus.ctransportCoefficients import smoothedHeaviside_integral
from proteus import Gauges
from proteus.Gaug... |
package com.cyrillemartraire.monoids;
import static org.junit.Assert.assertEquals;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
public class MonoidMapTest {
@Test
public void equals() throws Exception {
final MonoidMap config = config1();
assertEquals(config, config);
}
@Test
pu... |
package main
import "flag"
//Settings used by this build program
type Settings struct {
TinyPNG string
BuildSite bool
BuildFontello bool
BuildBootstrap bool
SendNewsletter bool
}
var settings Settings
func loadSettings() {
key := flag.String("tinypng", "", "tinypng api key")
flag.Parse()
setti... |
package VIC::PIC::Functions::ISR;
use strict;
use warnings;
our $VERSION = '0.32';
$VERSION = eval $VERSION;
use Carp;
use POSIX ();
use Moo::Role;
sub isr_var {
my $self = shift;
return unless $self->doesroles(qw(Chip ISR));
my @common = @{$self->banks->{common}};
my ($cb_start, $cb_end) = @common;
... |
/**
* This file is part of Aion-Lightning <aion-lightning.org>.
*
* Aion-Lightning is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later ver... |
;;; -*- coding:utf-8; mode:lisp -*-
;;; covtype.binary: Binary classification
;; dataset:
;; https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary.html#covtype.binary
(in-package :cl-user)
(defpackage :cl-online-learning.examples
(:use :cl :cl-online-learning :cl-online-learning.utils)
(:nicknames :clol... |
Serial port names on Steve's mac:
board2: /dev/cu.usbserial-AG0JV596 (first box sent to Iasos)
board3: /dev/cu.usbserial-AG0JV6J0 (second box sent to Iasos)
board4: /dev/cu.usbserial-AG0JV27K (spare board for testing/support)
uno: /dev/cu.usbserial-AL05OC8S (prototype)
|
export enum VIEW_FILTERS {
ALL = 1,
ACTIVE = 2,
COMPLETED = 3,
DELETED = 4,
}
export const REFRESH_RATE = 1000; |
package Mojo::Redis::Cache;
use Mojo::Base -base;
use Mojo::JSON;
use Scalar::Util 'blessed';
use Storable ();
use Time::HiRes ();
use constant OFFLINE => $ENV{MOJO_REDIS_CACHE_OFFLINE};
has connection => sub {
OFFLINE ? shift->_offline_connection : shift->redis->_dequeue->encoding(undef);
};
has deserialize ... |
#include<stack>
#include<string>
#include<vector>
#include<cmath>
#include<iostream>
#include<algorithm>
// Converts an infix string to postfix string
std::string to_postfix(std::string infix_str);
// evaluates the postfix string
double evaluate_postfix(std::string postfix_str); |
# frozen_string_literal: true
class ChangeSetPersister
class PreserveResource
attr_reader :change_set_persister, :change_set, :post_save_resource
delegate :metadata_adapter, to: :change_set_persister
def initialize(change_set_persister:, change_set:, post_save_resource: nil)
@change_set = change_s... |
package kr.heartpattern.spikot.chat
import org.bukkit.ChatColor
import org.bukkit.entity.Player
fun color(text: String, color: ChatColor) = ChatBuilder(text).color(color)
fun black(text: String): ChatBuilder = color(text, ChatColor.BLACK)
fun darkBlue(text: String): ChatBuilder = color(text, ChatColor.DARK_BLUE)
fun ... |
/*
*
* Crypto utils
*
*
*/
import crypto from 'crypto'
/**
* Caluclate the assetId based on the metadata text. At the moment no validation is done on the text.
* @param metadataText text to calculate the hash on.
* @returns SHA-256 of the metadata text as hex string.
*/
export function calculateAssetId(m... |
using System.Text;
using Kaleidoscope.SyntaxObject;
namespace Kaleidoscope.Analysis
{
public sealed class NestedTypeDeclare<T> : NestedInstanceTypeDeclare where T : InstanceTypeDeclare
{
public readonly T Type;
public readonly ClassTypeDeclare ContainerType;
readonly string m_displayName;
public override I... |
<?php
function cssPath($s){
$path = base_url()."resources/css/".$s;
return $path;
}
function jsPath($s){
$path = base_url()."resources/js/".$s;
return $path;
}
function imagePath($s){
$path = base_url()."resources/images/"... |
// ----------------------------------------------------------------------------------------------
// Copyright (c) Mårten Rånge.
// ----------------------------------------------------------------------------------------------
// This source code is subject to terms and conditions of the Microsoft Public License. A... |
---
layout: post
microblog: true
audio:
photo:
date: 2018-01-26 17:52:38 -0800
guid: http://jbwhaley.micro.blog/2018/01/27/call-me-an.html
---
Call me an old crank if you will, but I just am not attracted to the idea of talking to a computer.
|
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
header("Content-Type: text/json");
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET");
header("Access-Control-Allow-Methods: GET, OPTIONS");
header("Access-Control-Allow-Headers: Content-Type, Content-Length, Accept... |
#ifndef INFO_H
#define INFO_H
//#include "common.h"
#define CARD_SIZE 100
#define CARD_TYPE (CARD_SIZE - 1)
namespace soccer {
typedef struct {
int nGols;
int nFaltas;
int nLaterais;
int nEscanteios;
double Posse;
int nCartoes;
char** Cartoes;
char** Gols;
} SInfo;
struct pass_info {
SInfo *te... |
package com.ws.worker
import com.uber.cadence.activity.ActivityOptions
import com.uber.cadence.client.WorkflowClient
import com.uber.cadence.common.RetryOptions
import com.uber.cadence.workflow.ActivityStub
import com.uber.cadence.workflow.SignalMethod
import com.uber.cadence.workflow.Workflow
import com.uber.cadence.... |
/**
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.http.impl.model
import java.nio.charset.Charset
import java.util.Optional
import java.{ lang ⇒ jl }
import akka.http.scaladsl.model.Uri.ParsingMode
import akka.http.javadsl.{ model ⇒ jm }
import akka.http.scaladsl.{ model ⇒ sm }
i... |
require 'site_list/video_analyze'
require 'requests/request'
require 'progressbars/progressbar'
require 'file_operats/file_operat_chatdata'
class Twitcasting_analyze<Video_analyze
attr_reader :video_id, :user_id, :videoinfo, :videoinfo_request_status
def initialize(url)
@video_url=url
@video... |
<!DOCTYPE html>
<!-- This site was created in Webflow. http://www.webflow.com -->
<!-- Last Published: Wed Oct 16 2019 23:46:02 GMT+0000 (UTC) -->
<html data-wf-page="5da786dd00b10d79c698bf04" data-wf-site="5da766d32783b3459dfbc795">
<head>
<meta charset="utf-8">
<title>Publicações</title>
<meta content="Publ... |
from typing import List
import collections
class Solution:
def nextGreaterElement(self, nums1: List[int], nums2: List[int]) -> List[int]:
elements, stack = {}, []
for i in range(len(nums2)):
while stack and nums2[i] > stack[-1]:
elements[stack.pop()] = nums2[i]
... |
import { combineReducers } from 'redux';
import keycloak from '../reducers/keycloak.reducer';
import layouts from '../reducers/layouts.reducer';
import baseEntity from '../reducers/baseEntity.reducer';
import app from '../reducers/app.reducer';
export default combineReducers({
keycloak,
layouts,
baseEntity,
ap... |
@extends('layouts.admin')
@section('content')
<h1>Create user</h1>
{!! Form::open([ 'method' => 'POST','url' => 'admin/users', 'files' => true]) !!}
<div class="form-group">
{!! Form::label('name', 'User name'); !!}
{!! Form::text('name',null, ['class' => 'form-control']) !!}
</div>
<div class="... |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Neurotoxin.Godspeed.Shell.Models
{
public struct FileExistenceInfo
{
public readonly bool Exists;
public readonly long Size;
private FileExistenceInfo(bool exists, long size)
{
... |
require 'natalie/inline'
__inline__ "#include <dirent.h>"
__inline__ "#include <sys/param.h>"
__inline__ "#include <sys/types.h>"
class Dir
class << self
def tmpdir
'/tmp'
end
__define_method__ :pwd, [], <<-END
char buf[MAXPATHLEN + 1];
if(!getcwd(buf, MAXPATHLEN + 1))
env->... |
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QDesktopWidget>
#include <QByteArray>
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "filedownloader.h"
#include <fstream>
#include <QUrl>
#include <QPixmap>
#include <iostream>
#include <QRegExp>
#include <stdlib.h>
#include <ctim... |
// Pattern match solution
sealed trait TrafficLight {
def next: TrafficLight =
this match {
case RedTrafficLight => YellowTrafficLight
case YellowTrafficLight => GreenTrafficLight
case GreenTrafficLight => RedTrafficLight
}
}
case object RedTrafficLight extends TrafficLight
case object Yell... |
def _remove_backslashes(latex_str):
return ''.join([letter for letter in latex_str if letter != '\\']) |
/*
* Copyright (c) 2022.
* Author Peter Placzek (tada5hi)
* For the full copyright and license information,
* view the LICENSE file that was distributed with this source code.
*/
import path from 'path';
import {
TrainContainerFileName,
TrainContainerPath,
TrainManagerExtractingQueuePayload,
} from '@... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.