text stringlengths 27 775k |
|---|
class DestinyActivityModeCategory {
DestinyActivityModeCategory._();
static const int None = 0;
static const int PvE = 1;
static const int PvP = 2;
static const int PvECompetitive = 3;
}
|
// SPDX-License-Identifier: GPL-2.0+
/**
* ufs.c - UFS specific U-boot commands
*
* Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com
*
*/
#include <common.h>
#include <command.h>
#include <ufs.h>
static int do_ufs(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int dev, ret;... |
const { createLeader, STANCES, FACTIONS, SPECIAL_RULES } = require('./../scenarioConstants');
const { GAME_PHASES } = require('./../../gameConstants');
const THEODEN = createLeader('Theodén', './assets/avatarBackgrounds/lotr/theoden.png');
const DENETHOR = createLeader('Denethor II', './assets/avatarBackgrounds/lotr/d... |
package driver
import (
"fmt"
"github.com/jinzhu/gorm"
_ "github.com/lib/pq" // initialize postgres driver
)
func OpenCn(host string, port string, user string, password string, dbName string, debug bool) (*gorm.DB, error) {
cn := fmt.Sprintf("host=%s port=%s user=%s password=%s dbname=%s sslmode=disable", host,... |
package com.github.lmdb4s
import bindings.Library
import jnr.ffi.{ Pointer => JnrPointer }
object KeyVal {
private val MEM_MGR = Library.RUNTIME.getMemoryManager
}
/**
* Represents off-heap memory holding a key and value pair.
*
* @tparam T buffer type
*/
final class KeyVal[T] private[lmdb4s](val proxy: Buffe... |
import {Directive, EventEmitter, HostBinding, HostListener, Input, Output} from '@angular/core';
import {isNil} from 'lodash';
@Directive({
selector: '[ngxDropdown]',
exportAs: 'ngxDropdown'
})
export class DropdownDirective {
toggleElement: any;
// tslint:disable-next-line:no-input-rename
@Input('... |
### 简介
使用的是 [nuka-carousel](https://github.com/react-component/nuka-carousel)
### API
|
using System;
namespace MicaForEveryone.Win32
{
public class WndProcEventArgs : EventArgs
{
public WndProcEventArgs(IntPtr windowHandle)
{
WindowHandle = windowHandle;
}
public IntPtr WindowHandle { get; }
}
}
|
using System.Threading.Tasks;
using Newtonsoft.Json;
using Spectacles.NET.Types;
namespace Skyra.Core.Cache.Models
{
public sealed class CoreGuild : ICoreBaseStructure<CoreGuild>
{
public CoreGuild(IClient client, ulong id, string name, string region, string? icon, Permission? permissions,
int? memberCount, str... |
#!/usr/bin/env bash
set -e
DOWNLOAD_PATH=$1
echo "下载 gradle"
if [[ ! -f "$DOWNLOAD_PATH/gradle-6.3-all.zip" ]];then
axel -n8 https://mirrors.aliyun.com/macports/distfiles/gradle/gradle-6.3-all.zip \
--output=${DOWNLOAD_PATH}/gradle-6.3-all.zip
fi
|
// this is reviewing by following along the below article
// https://codeburst.io/learn-let-var-and-const-in-easiest-way-with-guarantee-e6ecf551018a
function adult5(age) {
if (age > 18) {
var status = 'adult';
}
console.log(status);
}
// adult5(20);
function adult6(age) {
if (age > 18) {
let status =... |
+++
title = "7.1 Get Vault Vault Token"
chapter = false
weight = 1
+++
[Deep Link to AWS Secrets Manager](https://console.aws.amazon.com/secretsmanager/home?region=us-west-2#/listSecrets)

Select the __Secret name__ (Vault-Workshop-vault-secrets-?????)
... |
#!/bin/bash -e
docker images
source rr_version
echo "log into tascape (https://hub.docker.com/u/tascape/)"
docker login -u tascape
echo "push images to tascape"
for IMG in nginx tomee mysql; do
docker push tascape/reactor-report-$IMG:${RR_VERSION}
docker push tascape/reactor-report-$IMG:latest
done
|
//
// MiniMapPointObject.cs
// ProductName Ling
//
// Created by on 2021.09.13
//
using UnityEngine;
using Utility;
using Zenject;
using Utility.ShaderEx;
namespace Ling.Map
{
/// <summary>
/// ミニマップ上のオブジェクト
/// </summary>
[RequireComponent(typeof(MeshRenderer))]
public class MiniMapPointObject : MonoBeh... |
<?php
use yii\db\Migration;
/**
* Handles the creation of table `{{%mp_users}}`.
*/
class m200421_134513_create_mp_users_table extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->createTable('{{%mp_users}}', [
'id' => $this->primaryKey(),
... |
cd 'C:\Users\crbk01\OneDrive - Region Gotland\Till Github\Mapinfo\MapInfoTabToCsv'
ls *.mb | ForEach-Object{ sc $_ -encoding utf8 -value(gc $_)} |
db "RENDEZVOUS@" ; species name
db "Its heart-shaped"
next "body makes it"
next "popular. In some"
page "regions, you would"
next "give a LUVDISC to"
next "someone you love.@"
|
object Naturals {
trait NAT {
type a[s[_ <: NAT] <: NAT, z <: NAT] <: NAT
type v = a[SUCC, ZERO]
}
final class ZERO extends NAT {
type a[s[_ <: NAT] <: NAT, z <: NAT] = z
}
final class SUCC[n <: NAT] extends NAT {
type a[s[_ <: NAT] <: NAT, z <: NAT] = s[n#a[s, z]]
}
type _0 = ZERO
type ... |
package stasis.server.api.routes
import akka.actor.typed.scaladsl.LoggerOps
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.Route
import akka.stream.Materializer
import stasis.server.model.staging.ServerStagingStore
import stasis.server.security.CurrentUser
import stasis.shared.api.respo... |
---
layout: default
title: "K sum Copy"
categories: algos
author: lazydeveloper
permalink: /testt
---
sdfds |
#!/usr/bin/env bash
# Crash on error
set -e
# Get Working Directory
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
DIR=... |
/***************************************************************************
* GroupProgressManager.cs
*
* Copyright (C) 2007 Michael C. Urbanski
* Written by Mike Urbanski <michael.c.urbanski@gmail.com>
****************************************************************************/
/* THIS FILE IS LICENSED UND... |
---
layout: docs
title: 'Collection.until()'
---
Stop iterating the collection once given filter returns true.
### Syntax
```javascript
collection.until(filterFunction, bIncludeStopEntry)
```
### Parameters
<table>
<tr><td>filterFunction: Function</td><td>function (item) {} that when returns a truthy value will sto... |
import { Component, OnInit } from '@angular/core';
import { Team } from '../../shared/models/team';
import { Competitions } from '../../shared/models/competitions';
import { Area } from '../../shared/models/area';
import { ApiFootballCompetitionsService } from '../../shared/service/api-football-competitions.service';
i... |
module Carto
class OrganizationPermission
def add_read_permission(table)
table.add_organization_read_permission
end
def add_read_write_permission(table)
table.add_organization_read_write_permission
end
end
end
|
/* Copyright (C) 2008-2016 University of Massachusetts Amherst.
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://github.com/factorie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with... |
module Oxidized
class CSV < Source
def initialize
@cfg = Oxidized.config.source.csv
super
end
def setup
if @cfg.empty?
Oxidized.asetus.user.source.csv.file = File.join(Config::Root, 'router.db')
Oxidized.asetus.user.source.csv.delimiter = /:/
Oxidized.asetus... |
package iri
// Unique IRIs for Semantic Web Entailment Regimes.
//
// For further details, see http://www.w3.org/ns/entailment/
const (
// Semantic Web Entailment Regimes.
ENTAILMENT_NS = "http://www.w3.org/ns/entailment/"
ENTAILMENT_Simple = ENTAILMENT_NS + "Simple"
ENTAILMENT_RDF = EN... |
require 'configcat'
require 'simplecov'
require 'codecov'
require 'webmock/rspec'
WebMock.allow_net_connect!
ConfigCat.logger.level = Logger::WARN
SimpleCov.start
SimpleCov.formatter = SimpleCov::Formatter::Codecov
|
drop schema if exists ers cascade;
create schema ers;
set schema 'ers';
create table reimbursement_status(
"status_id" serial primary key,
"reimb_status" text
check ("reimb_status" like 'Pending' or "reimb_status" like 'Approved'
or "reimb_status" like 'Denied') not null
);
create table reimbursement_type(
"... |
'use strict';
var glslify = require('glslify');
var Pass = require('../../Pass');
var vertex = glslify('../../shaders/vertex/ortho.glsl');
function GenericPass(fragment) {
Pass.call(this);
this.setShader(vertex, fragment);
}
module.exports = GenericPass;
GenericPass.prototype = Object.create(Pass.prototype);
G... |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElevatorSimulator
{
class Floor
{
public double Height { get; private set; }
private List<Person> _occupants = new List<Person>();
private bool _downButtonPre... |
require 'rack/test'
require 'net/http'
RSpec.describe SidekiqAlive::Server do
include Rack::Test::Methods
subject(:app) { described_class }
let(:token) { SidekiqAlive.config.token }
describe 'responses' do
describe "/-/liveness" do
it "responds with success" do
get "/-/liveness?token=#{toke... |
<?php
namespace app\modules\core\backend\components\CKEditor;
use Yii;
use yii\web\UploadedFile;
class FileUploadAction extends \yii\base\Action
{
/**
* Name of the param to handle
* @var string
*/
public $uploadName = 'upload';
/**
* Name of the param to handle
* @var string
... |
import express = require('express');
import Boom = require('boom');
import Joi = require('joi');
import { BaseController } from '../base.controller';
import { IUserDocument } from '../../models/user.model';
import { IRequestWithUserId } from '../request.interface';
import { Developer } from '../../models/developer.mode... |
<?php
/*
* Esta clase para ahorrar tiempo
* Evitando escribir los combos
*/
namespace frontend\modules\inter\helpers;
class FileHelper extends \common\helpers\FileHelper
{
public static function urlFlag($codpais,$tamano=32) {
return '@web/img/flags/'.$tamano.'/'.$codpais.'.png';
}
} |
#!/usr/bin/env ruby
# MixServer 2
# Danassis Panayiotis
# Matikas George
load 'rsaLib.rb'
require 'socket'
# Make two big primes: p and q
p = create_random_prime(512)
q = create_random_prime(512)
# Make n (the public key) now
n = p*q
# Public exponent
e = 0x10001
# Private exponent
d = get_d(p,q,e)
server = TCPS... |
package com.apollographql.apollo.cache.normalized.lru
import com.apollographql.apollo.cache.ApolloCacheHeaders
import com.apollographql.apollo.cache.CacheHeaders
import com.apollographql.apollo.cache.normalized.CacheKey
import com.apollographql.apollo.cache.normalized.NormalizedCache
import com.apollographql.apollo.ca... |
class LeetCode1657 {
fun closeStrings(word1: String, word2: String): Boolean {
if (word1.length != word2.length) {
return false
}
val arr1 = IntArray(26)
val arr2 = IntArray(26)
val set1 = mutableSetOf<Char>()
val set2 = mutableSetOf<Char>()
for... |
Simple command line tool for AES encryption written in Python.
Author of Algoritm: Bo Zhu http://about.bozhu.me
Bundled to application: Jan Gabriel |
var db = require('../../db');
module.exports = function(cb) {
db.select().table('projects').orderBy('id')
.then(function(rows) {
rows.forEach(function(row) {
if (row._date_created) {
row.date_created = row._date_created.toISOString();
delete row._date_created;
}
if (row._date_... |
import React from 'react';
import {
render, fireEvent, BoundFunction, GetByRole,
} from 'test-utils';
import { spy, SinonSpy } from 'sinon';
import { strictEqual } from 'assert';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faEdit } from '@fortawesome/free-solid-svg-icons';
import IconLi... |
#!/bin/bash
cd "$Test_BUILD_DIR"
make test
ctestlog=Testing/Temporary/LastTest.log
cat $ctestlog | grep -i fail -B 25 -A 3
cat $ctestlog | grep -i fail
# last exit status 0 means, grep found failures!
if [ $? == 0 ]; then
exit 1;
else
echo 0;
fi |
using NUnit.Framework;
using System;
using System.Globalization;
namespace Phnx.Tests.Extensions.Time.DateTimeExtensionsTests
{
public class AsDateStringTests
{
[Test]
public void AsDateString_WithoutFormatProviderAndShortFormat_FormatsAsShortLocalDate()
{
DateTime sampleNo... |
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\Models\Admin\ProductCategory;
use Faker\Generator as Faker;
use Illuminate\Support\Str;
$factory->define( ProductCategory::class, function ( Faker $faker ) {
return [
'name' => $name = $faker->name,
'slug' => S... |
/**
* Vrapi utility functions
*/
@file:JvmName("OvrplUtilities")
package org.godotengine.plugin.vr.oculus.platform.api
import org.godotengine.plugin.vr.oculus.platform.OvrPlatformPlugin
// removed the utility functions not needed in platform sdk
|
# 编译 OpenArray CXX
请提前准备编译需要的环境,目前支持并测试的环境有:
- [openSUSE](./setup-opensuse-builder.md)
- [CentOS](./setup-builder-centos.md)
- [Ubuntu](./setup-builder-ubuntu.md)
## 准备
下载最新源码:
```shell
cd
git clone https://github.com/hxmhuang/OpenArray_CXX.git
cd OpenArray_CXX/
```
如果当前目录没有 `configure` 文件, 请执行下面命令创建:
```shell
a... |
package com.harry0000.kancolle.ac
import com.typesafe.config.ConfigFactory
object Config {
private lazy val config = ConfigFactory.load()
def distPath = config.getString("dist.path")
}
|
import { Photo } from '../../models';
export interface ListItemData {
title?: string;
photos?: Photo[];
key: string;
}
export function getItemSize(item: ListItemData) {
return item.title ? 50 : 100;
}
|
// Copyright (c) 2012-2022 Supercolony
//
// 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, merge, publis... |
import { Component, Input, OnInit } from '@angular/core';
@Component({
selector: 'app-goal-image',
templateUrl: './goal-image.component.html',
styleUrls: ['./goal-image.component.scss']
})
export class GoalImageComponent implements OnInit {
@Input() goalDescription: string;
goalImages: Map<String, String> =... |
"""Algorithm demonstrating the power of dynamic programming: It is simple and elegant and one of
the most important concepts in computer science."""
import unittest
from typing import List
def num_ways_of_making_change(amount: int, coins: List[int]):
"""Here amount represents the desired monetary value and coins ... |
import { css } from '@emotion/react';
import { decidePalette } from '../lib/decidePalette';
const contributorImage = css`
border-radius: 100%;
object-fit: cover;
height: 100%;
width: 100%;
`;
const backgroundStyles = (palette: Palette) =>
css`
background-color: ${palette.background.avatar};
`;
export const A... |
#
# Cookbook Name:: learn_chef_httpd
# Recipe:: default
#
# Copyright (c) 2016 The Authors, All Rights Reserved.
package 'apache2'
service 'apache2' do
action [:enable, :start]
end
group 'webmaster'
user 'webmaster' do
group 'webmaster'
system true
shell '/bin/bash'
end
template '/var... |
#!/bin/bash
set -euo pipefail
if [ "schedule" == "${BUILDKITE_SOURCE}" ]; then
exit 0
fi
echo "--- setup"
apt-get update
apt-get install -yy curl jq rubygems
git config --global user.email "sorbet+bot@stripe.com"
git config --global user.name "Sorbet build farm"
dryrun="1"
if [ "$BUILDKITE_BRANCH" == 'master' ]; ... |
TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/m4/m4.html
TERMUX_PKG_DESCRIPTION="Traditional Unix macro processor"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_VERSION=1.4.18
TERMUX_PKG_REVISION=3
TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/m4/m4-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=f2c1e86ca0a404ff281631b... |
""" test the automechanic.parse.chemkin module
"""
from __future__ import unicode_literals
from builtins import open
import os
from automechanic.parse import chemkin
PATH = os.path.dirname(os.path.realpath(__file__))
NATGAS_PATH = os.path.join(PATH, '../../../examples/natgas')
HEPTANE_PATH = os.path.join(PATH, '../../... |
#!/bin/bash
mkdir silesia
cd silesia
wget http://sun.aei.polsl.pl/\~sdeor/corpus/silesia.zip
unzip silesia.zip
rm silesia.zip
cd ..
tar -cvf silesia.tar silesia
rm -r silesia
python3 silesia_gen.py
|
package com.rostegg.android.hotspot_scanner.services
import android.content.ComponentCallbacks
import android.content.res.Configuration
import android.util.Log
import com.rostegg.android.hotspot_scanner.services.scanners.WifiScannerManager
import org.koin.android.ext.android.inject
class SessionManager : ComponentCa... |
# rollupdemos
Including some rollup demos
# features
* build ES6 modules
* ESlint
# License
MIT
|
# Collections
Collections implementation with generators. This thing is just for practice
## How to use
Read the tests
## Scripts
`composer fix`: Run php-cs-fixer
`composer test`: Run test suite
`composer coverage`: Generate coverage report
`composer analyze`: Generate static analysis report
## Roadmap
### Criti... |
use crate::Errno;
use crate::Sysno;
extern "C" {
fn __syscall0(nr: usize) -> usize;
fn __syscall1(nr: usize, arg1: usize) -> usize;
fn __syscall2(nr: usize, arg1: usize, arg2: usize) -> usize;
fn __syscall3(nr: usize, arg1: usize, arg2: usize, arg3: usize) -> usize;
fn __syscall4(
nr: usize... |
namespace FingerTree
{
using System;
using System.Collections.Generic;
using Stact.Data.Internal;
public class FNSeq<T> //where T : IMeasured<uint>
{
private Seq<T> theSeq = null;
public FNSeq()
{
theSeq = new Seq<T>(new List<T>());
}
public FNSeq(IEnumerable<T> seqIterator)
{
... |
import { join } from "../deps.ts";
/**
* @description
* Attempts to get the default shell of the user. This is primarily for use in
* the `install` and `uninstall` commands, where we edit a user's config.
*/
export default function getDefaultShellName($HOME: string): string {
const $SHELL = Deno.env.get("SHELL")... |
#!/bin/bash
#
# Copyright (c) 2019-2020 P3TERX <https://p3terx.com>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
# https://github.com/P3TERX/Actions-OpenWrt
# Description: OpenWrt DIY script part 1 (Before Update feeds)
#
# 修改版本内核
# sed -i 's/KERNEL_PATCHVER:=5.4/K... |
/*
Control program for the ImDisk Virtual Disk Driver for Windows NT/2000/XP.
Copyright (C) 2004-2015 Olof Lagerkvist.
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
restrictio... |
# Modify external links for collections documents and pages
# - add rel 'noopener' and 'noreferrer'
# - add target _blank
# - add externalLink class
def external_links(document)
Jekyll.logger.debug('external link for', document.relative_path)
doc = Nokogiri::HTML::Document.parse( document.output )
... |
import './ScoreBadge.css'
import ScoreBadge from './ScoreBadge'
export default ScoreBadge |
<?php
namespace SlackPHP\Tests\SlackAPI\Models\Methods;
use PHPUnit\Framework\TestCase;
use SlackPHP\SlackAPI\Exceptions\SlackException;
use SlackPHP\SlackAPI\Models\Methods\UsersList;
use SlackPHP\SlackAPI\Enumerators\Method;
/**
* @author Dzianis Zhaunerchyk <dzhaunerchyk@gmail.com>
* @author Zxurian
* @covers ... |
namespace FooCoin.Core.Validation
{
public class ValidationResult
{
public bool IsValid { get; set; }
public string Error { get; set; }
public ValidationResult(bool isValid, string error = null)
{
IsValid = isValid;
Error = error;
}
publi... |
#!/usr/bin/env ruby
def code_processor
File.readlines('./sample-txt/sample.txt').each do |line|
print "#{line.chomp} # => #{eval(line)}", "\n"
end
end
if __FILE__ == $0
code_processor
end
|
package org.vilvaadn.pubsubexample
import org.scalajs.dom
import japgolly.scalajs.react.extra.router._
import japgolly.scalajs.react.vdom.html_<^._
import SubscriberClient.WebSocketsApp
object SubscriberRouter {
sealed trait MenuItems
case object Home extends MenuItems
case object PubSubExample extends Menu... |
# TodoistAPI_JP
Todoist Developer APIの翻訳をしているところです。
| API | source | before | after | public |
| --- | --- | --- | --- | --- |
| REST API | [本家][original-rest-v1] | [翻訳前][trans-rest-v1-before] | [翻訳後][trans-rest-v1-after] | [公開版](REST_API/) |
| Sync API | [本家][original-sync-v8] | [翻訳前][trans-sync-v8-before] | [翻訳後][t... |
# coding: utf-8
require "skull_and_crossbones"
module FormatterSupport
def new_example(metadata = {})
metadata = metadata.dup
result = RSpec::Core::Example::ExecutionResult.new
result.started_at = Time.now
finished_at = metadata.delete(:finished_at) { Time.now }
result.record_finished(metadata.de... |
! include 'opkda2.f'
! include 'opkda1.f'
! include 'opkdmain.f'
module odepack
implicit none
real(kind=8), dimension(:), allocatable :: rwork
integer, dimension(:), allocatable :: iwork
integer :: jt, itol, iopt, itask, lrw, liw, istate, neq
real(kind=8) :: rt... |
(ns gimel.highlight
(:require [clojure.java.io :as io]
[net.cgrand.enlive-html :as enlive]))
(defn- highlight [node]
(let [code (->> node :content (apply str))
lang (->> node :attrs :class (apply str))]
(assoc-in node [:attrs :class]
(str "language-" lang
" ... |
package statistics;
import java.util.Arrays;
/**
* @author zhangxuepei
* @since 3.0
*/
public class AverageStatistics extends AbstractContainerStatistics {
public AverageStatistics(SumStatisticsStrategy sumStatisticsStrategy,
CountStatisticsStrategy countStatisticsStrategy) {
... |
RSpec.describe ThreeScaleToolbox::Commands::RemoteCommand::RemoteAddSubcommand do
include_context :resources
include_context :temp_dir
context '#run' do
let(:config_file) { File.join(tmp_dir, '.3scalerc') }
let(:options) { { 'config-file': config_file } }
let(:arguments) { {} }
subject { describe... |
@extends('Admin.Layout.index')
@section('content')
<div class="mws-panel grid_8">
@if (count($errors) > 0)
<div class="mws-form-message error">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
... |
package dk.jamiemagee.swissspoon.module2
import mu.KotlinLogging
import org.springframework.shell.standard.ShellComponent
import org.springframework.shell.standard.ShellMethod
import java.io.File
private val logger = KotlinLogging.logger {}
@ShellComponent
class Module2 {
@ShellMethod("Log some stuff to STDOUT... |
use std::io;
use self::reader::LogReader;
use super::*;
pub struct LogIter {
pub config: Config,
pub segment_iter: Box<dyn Iterator<Item = (Lsn, LogId)>>,
pub segment_base: Option<LogId>,
pub max_lsn: Lsn,
pub cur_lsn: Lsn,
pub trailer: Option<Lsn>,
}
impl Iterator for LogIter {
type Item... |
<?php
function teste($a = "teste") {
echo "O valor de A é: $a <br>";
}
teste();
teste("asd");
function testando($b, $a = "x") {
echo "O valor de a é: $a e de b é: $b <br>";
}
testando("1");
testando("1", "2"); |
use dropshot::endpoint;
use dropshot::HttpError;
use dropshot::HttpResponseOk;
use dropshot::RequestContext;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use tokio::sync::Mutex;
use std::sync::Arc;
use crate::context::ConjurContext;
/** Information about the client making the request */
#[allow(dead... |
# filename, = ARGV
filename = ARGV.first
prompt = "> "
txt = File.open(filename)
puts "Here's your file: #{filename}"
puts txt.read()
txt.close()
puts "I'll also ask you to type it again:"
print prompt
file_again = STDIN.gets.chomp()
txt_again = File.open(file_again)
puts txt_again.read()
txt_again.close()
|
from django.contrib import admin
from imager_images.models import Photo, Album
admin.site.register(Photo)
class AlbumInline(admin.TabularInline):
model = Album.photos.through
@admin.register(Album)
class AlbumAdmin(admin.ModelAdmin):
inlines = (AlbumInline,)
exclude = ('photos',) |
/**
*
*/
$(function() {
var html = $(".error-page-errors").html();
var words = ["mathtabolism", "null", "exception"];
var regex = RegExp(words.join("|"), "gi");
$(".error-page-errors").html(html.replace(regex, "<strong>$&</strong>"))
}); |
import qs from 'qs'
import path from 'path'
import Express from 'express'
import React from 'react'
import { createStore } from 'redux'
import { Provider } from 'react-redux'
import { renderToString } from 'react-dom/server'
import counterApp from './reducers'
import App from './containers/App'
const app = Express()
c... |
import * as React from "react";
import { createUseStyles } from "react-jss";
import * as colors from "../constants/colorScheme.json";
import * as fonts from "../constants/fontFamily.json";
import PublishedDate from "./publishedDate";
const useStyles = createUseStyles({
root: {
display: "flex",
flexDirectio... |
require 'openssl'
class String
def encrypt(key)
cipher = OpenSSL::Cipher::AES.new(128, :CBC).encrypt
cipher.key = key
cipher.update(self) + cipher.final
end
def decrypt(key)
cipher = OpenSSL::Cipher::AES.new(128, :CBC).decrypt
cipher.key = key
cipher.update(self) + cipher.final
end
end... |
// Copyright 2017 The Fuchsia 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:flutter/material.dart';
/// Background color to be used for the selected conversaion in the conversation
/// list.
final Color kSelectedBg... |
/**
* Copyright (c) 2017-present, Justin Nguyen.
* All rights reserved.
*
* @author tuan3.nguyen@gmail.com
*
* @flow
* @format
*/
"use strict"
import React, { Component } from "react"
import { PropTypes } from "prop-types"
import { Image } from "react-native"
import { Header, Left, Body, Right, Button, Title... |
const chalk = require('chalk');
const filesystem = require('./filesystem');
const staticData = require('./staticData');
async function buildPythonProject(filepath) {
// Generating a Python project
//
// 1) Create a blank init file
// 2) Create an opinionated setup.py file
// 3) TODO: Install pacakg... |
# Model: MutedUser
class Bot::Models::MutedUser < Sequel::Model
unrestrict_primary_key
def time_left
mute_end - Time.now
end
def mute_length
mute_end - mute_start
end
end |
fitstats
========
A web service that exposes fitbit data to Panic's Status Board
|
import 'package:flutter/services.dart';
import 'package:alga/constants/import_helper.dart';
import 'package:alga/tools/formatters/formatter_abstract.dart';
import 'package:alga/utils/snackbar_util.dart';
class FormatterView extends StatefulWidget {
final Widget title;
final List<Widget> configs;
final FormatRes... |
{-# LANGUAGE ExistentialQuantification, Rank2Types, FunctionalDependencies, FlexibleInstances, FlexibleContexts, PatternGuards, ScopedTypeVariables #-}
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Layout.MultiToggle
-- Description : Dynamically apply and ... |
# gitserver
A quick way to set up an hardened gitserver in just about 5 simple commands.
The quick start guide can be found on (for experienced git and ssh users): http://jurrianfahner.github.io/gitserver/
Detailed documentation can be found on: http://gitserver.readthedocs.org/
|
# Development commands and notes
## Setup dev environment
```bash
apt update && \
apt install -y python3 python3-pip python3-apt python3-dev git build-essential bash-completion systemctl; \
source /usr/share/bash-completion/bash_completion && \
git clone git@github.com:shokinn/emby-updater.git && \
cd emby-updater &&... |
//#SECTION meta
export interface SongMeta {
url: string;
path: string;
meta: {
title: string;
fullTitle: string;
artists: string;
primaryArtist: {
name: string;
url: string;
},
},
resources: {
thumbnail: string;
image: ... |
package com.github.songjiang951130.leetcode.backtrack;
import org.junit.Test;
public class ParenthesiTest {
Parenthesi parenthesi = new Parenthesi();
@Test
public void generateParenthesis() {
parenthesi.generateParenthesis(2);
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.