text stringlengths 27 775k |
|---|
mod function_pointers;
mod returning_closures;
fn main() {
returning_closures::run();
}
|
export function up(knex) {
return knex.schema.createTable('settings', table => {
table
.string('key')
.primary()
.unique();
table.string('value');
});
}
export function down(knex) {
return knex.schema.dropTable('settings');
}
|
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'received.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Received _$ReceivedFromJson(Map<String, dynamic> json) => Receive... |
DROP SCHEMA IF EXISTS "pharmer" CASCADE;
CREATE SCHEMA "pharmer" AUTHORIZATION "{$NS_USER}";
SET search_path TO "pharmer";
START TRANSACTION;
SET standard_conforming_strings=off;
SET escape_string_warning=off;
SET CONSTRAINTS ALL DEFERRED;
CREATE TABLE "credential" (
"id" bigserial,
"kind" text NOT NULL,
... |
// add the possibility to connect with an endpoint that has graph data
export default {
api: "localhost:5000/api",
auth: "Basic 0123456789==",
}; |
# Facebook Message Sender API
# Instalação
* Requisito: Node.js >= v10
> npm i
# .env
* Define o token da API , apenas restrito ao tamanho máximo de URL.
* Deve estar na raiz do projeto
> module.exports = "SEU_TOKEN"
# Produção
* pm2 daemon
> npm run prod <br />
> npm run prod_stop
... |
import React, { Component } from 'react';
import './resources/style.css';
import Link from "./components/links"
function App() {
return (
<>
<Link />
</>
);
}
export default App;
|
using System;
using System.Linq;
using System.Collections.Generic;
namespace OptivumParser
{
public class InvalidNameException : Exception
{
public InvalidNameException(string message) : base(message)
{
}
}
public static class ListParser
{
public stat... |
/*
* Copyright (c) 2016 Denis Kuzmin (reg) <entry.reg@gmail.com>
*
* Distributed under the MIT license
* (see accompanying file LICENSE or a copy at https://opensource.org/licenses/MIT)
*/
namespace net.r_eg.TmVTweaks
{
public interface ITweakToolbar
{
/// <summary>
/// To show/hide the ... |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
//! Error handling.
use thiserror::Error;
pub use reverie_syscalls::Errno;
/// A general error.... |
package dev.Hilligans.ourcraft.Client.Rendering.Widgets;
import dev.Hilligans.ourcraft.Client.MatrixStack;
import dev.Hilligans.ourcraft.Client.Rendering.Textures;
import dev.Hilligans.ourcraft.Client.Rendering.World.StringRenderer;
public class SelectorWidget extends Widget {
SelectorScreen selectorScreen;
... |
from globus_search_cli.commands.index.create import create_cmd
from globus_search_cli.commands.index.list import list_cmd
from globus_search_cli.commands.index.role import role_cmd
from globus_search_cli.commands.index.show import show_cmd
from globus_search_cli.parsing import globus_group
@globus_group("index", help... |
begin
jabber_settings = JabberSetting.first
rescue
jabber_settings = nil
end
Database::migrate(JabberSetting)
unless jabber_settings.nil?
jabber_settings.instance_variable_set("@new_record", true)
jabber_settings.save
end |
---
title: "User:CJCollier"
lastmodified: '2009-01-07'
redirect_from:
- /User%3ACJCollier/
---
User:CJCollier
==============
[http://wp.colliertech.org/cj/](http://wp.colliertech.org/cj/)
[http://cjcollier.livejournal.com/](http://cjcollier.livejournal.com/)
[http://www.colliertech.org/](http://www.colliertech.org/... |
// The type of functions is fn, not to be confused with the Fn closure trait.
fn add_one(x: i32) -> i32 {
x + 1
}
fn do_twice(f: fn(i32) -> i32, arg: i32) -> i32 {
f(arg) + f(arg)
}
pub fn functions() {
let answer = do_twice(add_one, 5);
println!("The answer is {}", answer);
let numbers = vec![1,... |
<?php
namespace App\Http\Livewire;
use Livewire\Component;
class WithDraw extends Component
{
public $amount;
public function withDraw(){
$validated=$this->validate([
'amount'=>'required|integer|min:500|max:100000000'
]);
$acc=auth()->user()->business->account;
if... |
// (C) 2007-2018 GoodData Corporation
import React from "react";
import { InsightView } from "@gooddata/sdk-ui-ext";
import { Ldm } from "../../ldm";
const style = { height: 300 };
// TODO: SDK8 Decide whether add dimesion prop to InsightView
// const insightViewProps = {
// custom: {
// drillableItems: [... |
---
layout: post
title: "Swagger"
date: 2019-01-09 20:00:00 +0900
categories: Backend
tag: SpringBoot
---
* content
{:toc}
## Maven dependency
```
<!-- swagger -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</d... |
import Frame from '../common/Frame/Frame'
import Wrapper from '../common/Containers/Wrapper'
import { FlexRow } from '../common/Containers/Flex'
const Footer = () => (
<Frame
style={{
padding: '.5em 0',
height: 'calc(41px + 1em)',
boxSizing: 'border-box',
}}
>
<Wrapper style={{ height... |
export const getMonitoringPlansRectangularDuctsTableRecords = (totalData) => {
const data = totalData;
const records = [];
data.forEach((el) => {
const beginDate = el.wafBeginDate
? formatStringToDate(el.wafBeginDate.toString())
: "";
const beginHour = el.wafBeginHour ? el.wafBeginHour.toStri... |
#![allow(clippy::all)]
#![warn(clippy::pattern_type_mismatch)]
fn main() {}
fn struct_types() {
struct Struct<'a> {
ref_inner: &'a Option<i32>,
}
let ref_value = &Struct { ref_inner: &Some(42) };
// not ok
let Struct { .. } = ref_value;
if let &Struct { ref_inner: Some(_) } = ref_valu... |
'use strict';
const mongoose = require('../');
const Schema = mongoose.Schema;
const Benchmark = require('benchmark');
const DocSchema = new Schema({
title: String
});
const SimpleSchema = new Schema({
string: { type: String, required: true },
number: { type: Number, min: 10 },
});
const AllSchema = new Schem... |
---
title: İçin erişim reddedildi '<name>'
ms.date: 07/20/2015
ms.assetid: 196c7286-4833-41d9-bbcb-f64c17eb2a59
ms.openlocfilehash: e8dd0835735a2467820c2e2c98f4fd9d80f0b49e
ms.sourcegitcommit: 9b552addadfb57fab0b9e7852ed4f1f1b8a42f8e
ms.translationtype: MT
ms.contentlocale: tr-TR
ms.lasthandoff: 04/23/2019
ms.locfileid... |
import {baseAction} from '../../utils';
import {text_lg} from 'linea-ui-project-css/css/text-lg';
import {getColor} from '../../utils/getColor';
import { p_2 } from 'linea-ui-project-css/css/p-2';
import { mx_2 } from 'linea-ui-project-css/css/mx-2';
import { my_4} from 'linea-ui-project-css/css/my-4';
import { pt_8} f... |
#!/usr/bin/env bash
# Install Rust
curl https://sh.rustup.rs -sSf | sh -s -- -y
# Install nightly toolchain
rustup toolchain install nightly
# Add WASM target
rustup target add wasm32-unknown-unknown --toolchain nightly
|
from seleniumbase import BaseCase
from qbay_test.conftest import base_url
from unittest.mock import patch
from qbay.models import *
"""
This file defines all integration tests for the frontend update user page.
"""
class FrontEndUpdateUserPageTest(BaseCase):
def test_update_user_frontend_r3_1(self, *_):
... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 23-Maio-2021 às 15:39
-- Versão do servidor: 10.4.17-MariaDB
-- versão do PHP: 8.0.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_C... |
{-# LANGUAGE Safe, TypeOperators #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Monad.Zip
-- Copyright : (c) Nils Schweinsberg 2011,
-- (c) George Giorgidze 2011
-- (c) University Tuebingen 2011
-- License : BSD-sty... |
#!/bin/bash
PROJECT_DIR_PARENT="${HOME}/projects/aem6"
mkdir -p ${PROJECT_DIR_PARENT}
PROJECT_NAME="cq-groovy-console"
# take port as 1st command line argument or use 4502 by default
PORT=${1:-4502}
echo PROJECT DIR="${PROJECT_DIR_PARENT}/${PROJECT_NAME}"
echo PORT=${PORT}
if [ ! -d "${PROJECT_DIR_PARENT}/${PROJECT_... |
/*-------------------------------------------------------------------------
*
* main.cpp
* Stub main() routine for the jucc executable.
*
* This does some essential startup tasks for any incarnation of jucc
*
* Contributors
* Shuvayan Ghosh Dastidar
* Abhishek Pal
* Aritra Samanta
* Bisakh Mond... |
use strict;
use Test::More;
use Devel::StackTrace::AsHTML;
my $html;
sub foo {
my $t = Devel::StackTrace->new;
$html = $t->as_html;
}
sub bar { foo("bar") }
bar(2);
like $html, qr/match.*bar\(2\)/;
like $html, qr!t[\\/]output\.t line 8.*\n.*in main::foo!;
done_testing;
|
% ----------------------------------------------------------------------
% BEGIN LICENSE BLOCK
% Version: CMPL 1.1
%
% The contents of this file are subject to the Cisco-style Mozilla Public
% License Version 1.1 (the "License"); you may not use this file except
% in compliance with the License. You may obtain a copy ... |
#!/bin/sh
wget -c http://ftp.apnic.net/stats/apnic/delegated-apnic-latest
cat delegated-apnic-latest | awk -F '|' '/CN/&&/ipv4/ {print $4 "/" 32-log($5)/log(2)}' | cat > /root/bin/routing-table/cn_rules.conf
|
package nl.wouterbohlken.transip.request.entity.vps
import nl.wouterbohlken.transip.request.entity.RequestEntity
class InstallOperatingSystem(
val operatingSystemName: String,
val hostname: String? = null,
val base64InstallText: String? = null
): RequestEntity() |
//**********************************************************************************
//* Copyright (C) 2007,2016 Hitachi Solutions,Ltd.
//**********************************************************************************
#region Apache License
//
// Licensed under the Apache License, Version 2.0 (the "License");
// yo... |
package handler
import (
"net/http"
"github.com/sacloud/open-service-broker-sacloud/service"
)
func catalogHandler(w http.ResponseWriter, req *http.Request) bool {
writeResponse(w, http.StatusOK, service.CurrentCatalogData)
return true
}
|
package com.bitfire.uracer.game.logic.gametasks.hud.elements.player;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.utils.Disposable;
import com.bitfire.uracer.configuration.UserProfile;
import com... |
package com.jcommerce.gwt.client.model;
public interface IFeedback {
public static final String ID = "id";
public static final String PARENT = "parent";
public static final String USER = "user";
public static final String CHILDREN = "children";
public static final String USERNAME = "userName";
public s... |
---
layout: default
title: "var.projects // work in progress"
permalink: /projects
---
## Projects
1. [MiFare Classic 1K RNG exploit](/projects/mifare-classic-exploit)
2. [Restriction Using SSH Public Keys](/projects/ssh-key-command-restriction)
3. [VM Generation Issue After Recovery from Azure Snapshot](/projects/az... |
//
// Created by DamarIndra on 27-Jun-20.
//
#include "scene/Actor.h"
namespace dln {
Actor::Actor(const entt::entity &entity) :
entity(entity)
{
ECS::add_component<ActorDetail>(entity);
ECS::add_component<Transform>(entity);
}
entt::entity Actor::get_entity() const { return entity; }
ActorDetail& Acto... |
# Adrak Chai (ginger tea)
## The Basics
* 5 minutes prep
* Serves 2 people
* You need loose tea (no tea bags, por favor) and a tea strainer
## Ingredients
* 2-3 tsp black tea
* 1 cup water
* 1 cup milk
* Sugar to taste
* 1 inch X 1/4 inch slice ginger
## Directions
* Boil water. Add tea leaves and bring to boil ag... |
#!/usr/bin/env bash
curl -d "$(cat example-comment.json)" -H "Content-Type: application/json" -X POST http://localhost:8432/comments |
import 'dart:ui';
import 'package:bonfire/bonfire.dart';
import 'package:example/player/knight.dart';
import 'package:flame/sprite.dart';
import 'package:flutter/material.dart';
class KnightInterface extends GameInterface {
double maxLife = 0;
double life = 0;
double maxStamina = 100;
double stamina = 0;
d... |
// src/models/catrogry.js
import { get,post,put,_delete } from '@/lin/plugins/axios'
class Category {
handleError = true
async getCategory() {
const res = await get('v1/category')
return res
}
async createCategory(name, description, topicImgId){
const res = await post('v1/ca... |
<?php
/**
* Created by PhpStorm.
* User: zjw
* Date: 2017/8/7
* Time: 下午6:00
*/
namespace pheme\settings\tests;
use pheme\settings\components\Settings;
use Yii;
class ComponentSettingTest extends TestCase
{
/**
* @var \pheme\settings\components\Settings
*/
public $setting;
public function... |
package no.nav.pensjon.innsyn.common.controller
import io.prometheus.client.Counter
import no.nav.pensjon.innsyn.common.PersonNotFoundException
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.springframework.dao.DataIntegrityViolationException
import org.springframework.http.HttpStatus.INTERNAL_SERVE... |
#!/bin/sh
cd /home/pi/pirover
sh raspicam.sh
python pirover.py >> /tmp/pirover.log
|
package dshl
import (
"context"
"fmt"
"os"
"sort"
"strings"
"github.com/pkg/errors"
"github.com/spf13/pflag"
)
var _ Command = HelpCommand{}
type HelpCommand struct {
}
func (c HelpCommand) CommandInfo() CommandInfo {
return CommandInfo{
Name: "help",
Usage: "[command]",
Short: "Display help",
Lon... |
//! dynamic tensor shape for static tensor.
use std::lazy::SyncOnceCell;
use crate::tensor_property::Shape;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct DynamicTensorShape<Id>(std::marker::PhantomData<Id>);
impl<Id> DynamicTensorShape<Id> {
fn cell() -> &'static SyncOnceCell<Vec<usize>> {
sta... |
import { createContext } from "react";
import { fetch } from "./tools";
export const context = createContext({ fetch: fetch });
|
package ru.tech.papricoin.data.local.entity
import androidx.room.Entity
import androidx.room.PrimaryKey
import ru.tech.papricoin.domain.model.Overview
@Entity
data class OverviewEntity(
val bitcoin_dominance_percentage: Double,
val cryptocurrencies_number: Int,
val last_updated: Int,
val market_cap_at... |
{-# language BangPatterns #-}
{-# language BinaryLiterals #-}
{-# language DerivingStrategies #-}
{-# language DuplicateRecordFields #-}
{-# language LambdaCase #-}
{-# language MagicHash #-}
{-# language PolyKinds #-}
{-# language RankNTypes #-}
{-# language StandaloneDeriving #-}
{-# language TypeApplications #-}
{-#... |
package woahGoHasAQuickCheck
// So we want to make a simple deterministic function to test. The cannonical one is reverse I think.
// ReverseRecursive returns a newly allocated reversed slice computed via recurision
func ReverseRecursive(slc []int) []int {
if len(slc) == 1 || len(slc) == 0 {
return slc
}
head :=... |
import styled from "@emotion/styled";
import { IconButton, MenuItem } from "czifui";
export const ButtonWrapper = styled.div`
display: flex;
flex-direction: column;
gap: 4px;
align-items: center;
`;
export const StyledIconButton = styled(IconButton)`
width: 30px;
height: 30px;
`;
export const StyledMenuI... |
## API Report File for "@azure/core-auth"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { AbortSignalLike } from '@azure/abort-controller';
import { SpanOptions } from '@azure/core-tracing';
export { AbortSignalLike }
// @public
export interface Acce... |
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex);
import axios from "axios";
export default new Vuex.Store({
// strict : true, // Todo Reinstate back.
state: {
boards: [],
selectedBoard: '',
selectedBoardDetails: false,
}, // End of state
getters: {
selecte... |
package com.sparkbyexamples.spark.dataframe.functions.collection
import org.apache.spark.sql.{Row, SparkSession}
import org.apache.spark.sql.types.{ArrayType, StringType, StructType}
import org.apache.spark.sql.functions.{col,concat_ws}
object ArrayOfString extends App{
val spark: SparkSession = SparkSession.build... |
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using SecurityWebApp.TokenHelper;
using System;
namespace SecurityDemo.Controllers
{
public class LoginInputModel
{
public string Username { get; set; }
public string Password { get; set; }
public string Offset {... |
package se.crisp.signup4.util
import javax.inject.{Inject, Singleton}
import play.api.data.Form
import play.api.i18n.Messages
@Singleton
class FormHelper @Inject() (localeHelper: LocaleHelper) {
def errors[T](form: Form[T])(implicit i18messages: Messages): Seq[String] = {
val messages:Seq[String] = form.global... |
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.Extensions.Logging.Structured
{
public abstract class BufferedOutput : IOutput
{
private readonly BufferedOutputOptio... |
# cudnnReduceTensorOp_t
const CUDNN_REDUCE_TENSOR_ADD = Cint(0)
const CUDNN_REDUCE_TENSOR_MUL = Cint(1)
const CUDNN_REDUCE_TENSOR_MIN = Cint(2)
const CUDNN_REDUCE_TENSOR_MAX = Cint(3)
const CUDNN_REDUCE_TENSOR_AMAX = Cint(4)
const CUDNN_REDUCE_TENSOR_AVG = Cint(5)
const CUDNN_REDUCE_TENSOR_NORM1 = Cint(6)
const... |
(ns mash-commander.view
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [mash-commander.mode :as mode]
[mash-commander.keyboard :as keyboard]
[mash-commander.freestyle.freestyle-mode]
[mash-commander.set.set-mode]
[mash-commander.nix.nix-mode]... |
<?php
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
* @author Joas Schilling <coding@schilljs.com>
* @author Morris Jobke <hey@morrisjobke.de>
* @author Robin Appelman <robin@icewind.nl>
* @author Roeland Jago Douma <roeland@famdouma.nl>
* @author Vincent Petry <pvince81@owncloud.com>
*
* @license AGPL... |
require 'rails_helper'
RSpec.describe "AdminsDevise", type: :request do
let!(:product){create(:product, id: 1)}
shared_examples "allowed" do |http_method, path|
specify "#{http_method.upcase} [#{path}] is accessable" do
send(http_method, path)
expect(response).not_to redirect_to('/admins/sign_in')... |
package cn.quickits.aoide.recorder
interface Recorder {
fun startAudioRecord()
fun stopAudioRecord()
fun isRecording(): Boolean
fun readBuffer(): PCMData?
fun readShortBuffer(): PCMData?
fun setOnRecordStateChangedListener(onRecordStateChangedListener: OnRecordStateChangedListener)
} |
#!/bin/bash
# get repo info
GH_REPO_ORG=`echo $TRAVIS_REPO_SLUG | cut -d "/" -f 1`
GH_REPO_NAME=`echo $TRAVIS_REPO_SLUG | cut -d "/" -f 2`
GH_REPO_REF="github.com/$GH_REPO_ORG/$GH_REPO_NAME.git"
#get SCIP TAGFILE
echo "Downloading SCIP tagfile to create links to SCIP docu"
wget -q -O docs/scip.tag https://scip.zib.de... |
#!/bin/bash
configs=(
'config_crnn256.json'
'config_crnn128.json'
'config_clstm256.json'
'config_clstm128.json'
)
for config in ${configs[@]}; do
python3 -u train.py -c configs/${config} --use_cuda --gpu 0 > ${config}.log
done
|
package cn.novalue.blog.controller;
import cn.novalue.blog.model.entity.Article;
import cn.novalue.blog.model.support.Response;
import cn.novalue.blog.model.vo.ArticleVO;
import cn.novalue.blog.service.ArticleService;
import cn.novalue.blog.utils.SecurityUtils;
import com.baomidou.mybatisplus.core.metadata.IPage;
im... |
# 数据结构和算法必知必会的 50 个代码实现
## 数组
- 实现一个支持动态扩容的数组
- 实现一个大小固定的有序数组,支持动态增删改操作
- 实现两个有序数组合并为一个有序数组
## 链表
- 实现单链表、循环链表、双向链表,支持增删操作
- 实现单链表反转
- 实现两个有序的链表合并为一个有序链表
- 实现求链表的中间结点
## 栈
- 用数组实现一个顺序栈
- 用链表实现一个链式栈
- 编程模拟实现一个浏览器的前进、后退功能
## 队列
- 用数组实现一个顺序队列
- 用链表实现一个链式队列
- 实现一个循环队列
## 递归
- 编程实现斐波那契数... |
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package settersutil
import (
"github.com/go-openapi/spec"
"sigs.k8s.io/kustomize/kyaml/kio"
"sigs.k8s.io/kustomize/kyaml/setters2"
)
// DeleterCreator delete a definition in the OpenAPI definitions, and removes references
// to the d... |
/* checkpoint.c - spin checkpoint for CPUs */
#include <kernel/cdefs.h>
#include <kernel/cpu.h>
void cpu_checkpoint_create(struct cpu_checkpoint *cp)
{
atomic_store(&(cp->num), 0);
}
void cpu_checkpoint_enter(struct cpu_checkpoint *cp)
{
preempt_disable();
atomic_fetch_add(&(cp->num), 1);
while(atomic_load(&(cp... |
RSpec.describe MeasureTypeExclusion do
before do
allow(described_class).to receive(:exclusions).and_return(test_exclusions)
end
let(:test_exclusions) { {} }
let(:test_csv_file) { file_fixture('measure_type_exclusions.csv') }
describe '.load_from_file' do
subject { described_class.load_from_file(test... |
declare <4 x i16> @llvm.x86.mmx.punpckhwd(<4 x i16>, <4 x i16>)
define <4 x i16> @src() {
%1 = call <4 x i16> @llvm.x86.mmx.punpckhwd(<4 x i16> <i16 1, i16 -2, i16 -3, i16 4>, <4 x i16> <i16 0, i16 4, i16 6, i16 0>)
ret <4 x i16> %1
}
define <4 x i16> @tgt() {
ret <4 x i16> <i16 -2, i16 6, i16 4, i16 0>
}
; ER... |
<?php
/**
* Created by Canan Etaigbenu
* User: canaan5
* Date: 3/29/16
* Time: 12:23 AM.
*/
namespace Innovating\Routing\Contracts;
interface RouteContract
{
/**
* get request path passed to Route.
*
* @return string
*/
public function getUri();
/**
* get Request methods.
... |
#!/bin/sh
# make demo.ini
touch demo.ini
echo '#' DEMO Setting>>demo.ini
echo preview=${PWD}/script/preview.sh>>demo.ini
echo stillCapture12M_Normal=${PWD}/script/stillCapture12M_Normal.sh>>demo.ini
echo stillCapture12M_HDR=${PWD}/script/stillCapture12M_HDR.sh>>demo.ini
echo stillCaptureFrame=100>>demo.ini
echo gyroGa... |
import { UnlistenFn } from "../listener";
import { Analytics } from "./analytics";
import {
EVENT_ANALYTICS_BODY_RESET,
EVENT_ANALYTICS_PAGE_CLOSED,
EVENT_ANALYTICS_RESULT_CLICKED
} from "../../events";
enum GoogleAnalyticsObjects {
UniversalAnalytics = "_ua",
AnalyticsJS = "ga",
GTag = "gtag"
}
export c... |
/*
# <<BEGIN-copyright>>
# Copyright 2019, Lawrence Livermore National Security, LLC.
# See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: MIT
# <<END-copyright>>
*/
#include <stdlib.h>
#include <iostream>
#include <LUPI.hpp>
void main2( int argc, char **argv );
/*
==========================... |
---
sidebar_label: find_next_well
title: platemap.PlateUtils.find_next_well
---
#### find\_well
```python
def find_well(target_plate: Plate, target_volume_id: str, target_volume: int)
```
Finds the next available well for a specific reagent-id that has sufficient volume defined by the third input argument.
**Argume... |
class Q2Pi{
public static void main(String args[])
{
double a,p,pi;
p=0;
int flag=0;
for(a=1;a<=13;a=a+2)
{
if(flag==0)
{
p=p+(1.0/a);
flag=1;
}
else
{
p=p-(1.0/a);
flag=0;
}
}
pi=4.0*p;
System.out.println("PI : "+pi);
}
} |
import scala.annotation.tailrec
object Day01 extends Day {
override var day: Int = 1
def fuelForMass(mass: Double): Double = {
Math.floor(mass / 3) - 2
}
@tailrec
def totalFuel(mass: Double, total: Double): Double = {
val fuel = fuelForMass(mass)
if (fuel <= 0) total
else {
totalFuel... |
#!casa -c
import argparse
def get_box(imagename, size=50):
# Get image size
imshape = imhead(imagename=imagename, mode='get', hdkey='shape')
# Box
xtrc = imshape[0]/4
ytrc = imshape[0]/2
xblc = xtrc - size
ytrc = ytrc - size
return "%i,%i,%i,%i" % (xblc, ytrc, xtrc, ytrc)
def put_rms... |
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../functions/onback_pressed.dart';
import '../Repositories/tankidrepo.dart';
import '../sidebar_bloc/sidebarBloc.dart';
import '../sidebar_bloc/sidebarEvents.dart';
import '../sidebar_bloc/sidebarStates.dart';
import 'side... |
import { get } from '@/utils/MKRequest';
import routes from '@/routes';
export async function list() {
return get({ url: routes.apiRoutes.envList().url });
}
|
var Surrogate;
if (typeof Object.keys !== 'function') {
Object.keys = function (o) {
var keys = [],
key;
for (key in o) {
keys.push(key);
}
return keys;
};
}
if (!Object.defineProperty) {
Object.defineProperty = function (obj, name, spec) {
... |
package scaladex.server.util
import scaladex.core.api.PaginationSchema
import scaladex.core.api.artifact.ArtifactEndpointSchema
object PlayJsonCodecs extends PaginationSchema with ArtifactEndpointSchema with endpoints4s.playjson.JsonSchemas
|
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2017-08-08 Yang the first version
* 2019-07-19 Magicoe The first version for LPC55S6x
*/
#include <string.h>
#include <board.h>
#include... |
package hydra.common.util
import akka.actor.{Actor, ActorRef}
import hydra.common.logging.LoggingAdapter
import scala.reflect.ClassTag
/**
* Standardizes on actor names used across Hydra.
*
* Created by alexsilva on 2/17/17.
*/
object ActorUtils extends LoggingAdapter {
/**
* @see StringUtils.camel2und... |
//! The state of the client's simulation, e.g. systems, etc.
#[derive(Default)]
pub struct WorldState {}
impl WorldState {
pub fn new() -> Self {
Self {}
}
}
|
package metaphone3
import (
"encoding/csv"
"io"
"io/ioutil"
"os"
"path/filepath"
"testing"
)
func TestBasicWords(t *testing.T) {
vals := []struct{ in, prim, sec string }{
{"A", "A", ""},
{"ack", "AK", ""},
{"eek", "AK", ""},
{"ache", "AK", "AX"},
}
e := &Encoder{}
for _, v := range vals {
prim, s... |
# Start the PiCons server.
ps cax | grep python > /dev/null
if [ $? -eq 0 ]; then
echo "The PiCons server is runing."
else
echo "Starting the PiCons server."
sudo python /home/pi/PiCons/main.py > /dev/null 2>&1 &
fi
|
<?php
return [
'time_limit' => 3,
'number_of_lines' => 4,
'number_of_columns' => 7,
'images' => [
'pommer', 'banane', 'orange', 'citronv',
'grenade', 'pecheb', 'citronj', 'fraise',
'pommev', 'pechej', 'raisin', 'pasteque',
'figue', 'poire'
],
];
|
-- | Binding of keys to commands.
-- No operation in this module involves the 'State' or 'Action' type.
module Game.LambdaHack.Client.UI.KeyBindings
( Binding(..), stdBinding, keyHelp
) where
import Control.Arrow (second)
import qualified Data.Char as Char
import Data.List
import qualified Data.Map.Strict as M
imp... |
namespace dFakto.AppDataPath
{
public class AppDataConfig
{
public string? BasePath { get; set; }
public bool CleanupTempFileOnClose { get; set; } = true;
}
} |
import { AbstractRequestContextHelper } from "../abstract-request-context-helper";
import { DatabaseContextHelper } from "./database";
import { SectionsContextHelper } from "./sections";
export class RequestContextHelpers extends AbstractRequestContextHelper {
private cache: {
sections?: SectionsContextHel... |
# Command Line Interface
`Terraform API` provides a command line interface written with go to interact
with the API. The CLI can be downloaded from the
[project release page](https://github.com/gregoryguillou/terraform-api/releases).
To know more about it, run one of the commands below:
```shell
terraform-api help
t... |
#pragma once
#include "../types.h"
#ifdef __cplusplus
extern "C" {
#endif
void* memcpy(void*, const void*, size_t);
void* memmove(void*, const void*, size_t);
void* memset(void*, int, size_t);
int memcmp(const void*, const void*, size_t);
size_t strlen(const char*);
char* strcpy(char*, const char*);
char* strcat... |
#!/usr/bin/perl -w
use strict;
# # # # # # # # # # # # # # # # # # # # # # # # # # #
package CvsTime;
use Carp;
use Time::Local;
@CvsTime::ISA = ('CheckedClass');
sub CvsTime::type_info {
return {
optional_args => {
STRING => 'SCALAR',
TIME_T => 'SCALAR',
},
}... |
/*
* XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
*
* Copyright (c) 2012 Sergey Ilinsky
* Dual licensed under the MIT and GPL licenses.
*
*
*/
function cStringCollator() {
};
cStringCollator.prototype.equals = function(sValue1, sValue2) {
throw "Not implemented";
... |
# frozen_string_literal: true
module Schienenzeppelin
RSpec.describe Dependencies do
let(:dummy) { Class.new(AddOn) }
let(:dependency) { Class.new(AddOn) }
before(:each) do
stub_const('Schienenzeppelin::AddOns::Dummy', dummy)
stub_const('Schienenzeppelin::AddOns::Dependency', dependency)
... |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.