text stringlengths 27 775k |
|---|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
__author__ = 'luckydonald'
if sys.version < '3': # python 2.7
text_type = unicode
binary_type = str
native_type = binary_type
unicode_type = text_type # because I can't remember to use text_type
long_int = long
def t... |
package com.slemjet.simple;
import org.junit.jupiter.api.Test;
class CompletableFutureSamplerTest {
@Test
void runExample() {
CompletableFutureSampler completableFutureSampler = new CompletableFutureSampler();
completableFutureSampler.runExample();
}
}
|
import requireAll from 'require-all';
/**
* Loads the policies defined on the specified path. When loading, the policy
* objects are added to an object.
*
* @param pathName
*/
export const loadPolicies = (pathName) => {
const policies = {};
const policiesObj = requireAll(pathName);
Object.keys(policiesObj).... |
class Manga < ApplicationRecord
has_many :manga_genres
has_many :chapters
has_many :genres, through: :manga_genres
validates_presence_of :name, :cover_art, :author
validates_uniqueness_of :name
end
|
window.addEventListener("contextmenu",function(event){
event.preventDefault();
let x = event.offsetX + "px";
let y = event.offsetY + "px";
let contextmenu = document.querySelector("#contextmenu");
contextmenu.style.top = y;
contextmenu.style.left = x;
contextmenu.classList.add("active");
});... |
module PlayerRefresher
def self.refresh_players
Player.all.each do |player|
player.update_attribute(:potential_p2p, "0")
case player.player_acc_type
when "Reg"
ehp = F2POSRSRanks::Application.config.ehp_reg
when "HCIM", "IM"
ehp = F2POSRSRanks::Application.config.ehp_iron
... |
# About the `yanom-dev-deb10-slim-buster` Docker Image
This Dockerfile will
- Build an image based off an official python image
- Uses the YANOM source code to build a pyinstaller package
- Moves the package into a folder called `yanom`, adds a `data` directory to it and a copy of `config.ini`
- Creates a tarball... |
import Reflux from 'reflux';
export default Reflux.createActions({
evaluateCell: {asyncResult: true},
startKernel: {asyncResult: true},
stopKernel: {asyncResult: true},
killKernel: {asyncResult: true}
})
|
package main
import (
"flag"
"fmt"
"log"
"os"
"os/signal"
"strings"
"syscall"
"github.com/Shopify/sarama"
"github.com/bsm/sarama-cluster"
)
var (
groupID = flag.String("group", "", "REQUIRED: The shared consumer group name")
brokerList = flag.String("brokers", os.Getenv("KAFKA_PEERS"), "The comma separ... |
package com.github.arekolek.phone
import android.app.Application
import timber.log.Timber
import net.gotev.uploadservice.UploadService;
import net.gotev.uploadservice.Logger;
import net.gotev.uploadservice.BuildConfig
class App : Application() {
override fun onCreate() {
super.onCreate()
Timber.pl... |
declare module "react-custom-scrollbars" {
declare type PositionValues = {
top: number,
left: number,
clientWidth: number,
clientHeight: number,
scrollWidth: number,
scrollHeight: number,
scrollLeft: number,
scrollTop: number,
...
};
declare type Props = {
onScroll?: (even... |
/**
*
*/
package org.pimslims.bioinf.targets;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.StringTokenizer;
import org.pimslims.lab.Util;
/**
* @author Petr Troshin
*/
@Deprecated
// no longer supported
public cl... |
#include "TreeBottomUp.hh"
#include <iostream>
TreeBottomUp::TreeBottomUp(const Graph& G) : AbstractBottomUp(G)
{
TWarr = new std::map<VSet, int>*[VSet::maxNumVerts];
}
TreeBottomUp::~TreeBottomUp()
{
delete[] TWarr;
}
void TreeBottomUp::beginIter()
{
iter = TWarr[currentLayer-1]->begin();
layerEnd = TWarr[cu... |
package com.anadathur.elastic.easymapping
import javax.lang.model.element.Modifier
import com.squareup.javapoet.MethodSpec.Builder
import com.squareup.javapoet._
class DefaultMappingGen extends TypeGenerator {
import scala.collection.JavaConversions._
val generators = List(
generateMappingType _,
generate... |
const graphql = require("graphql");
const types = require("./types.js");
const logic = require("./logic.js");
module.exports = {
getTheme: {
type: types.themeType,
resolve: () => logic.getTheme(),
},
getAllThemes: {
type: new graphql.GraphQLList(types.themeType),
resolve: (root, { a = {} }, conte... |
module Lib
(
someFunc,
doubleIt,
doubleRange,
rotateList
) where
import Data.List
import Data.Char
import Data.String
someFunc :: IO ()
someFunc = putStrLn "someFunc"
doubleIt :: Int -> Int
doubleIt x = x * 2
doubleRange :: Int -> [Int]
doubleRange x = [x * 2 | x <- [1..10]... |
# Version 0.0.2
## change log
- 增加了数据下载
- 修正了Risk计算
- 增加了instrument
- 增加了position的`market_value`和`value_percent`
|
# CASPR
by Judith Bergadà Pijuan.
## Installation
CASPR has been developed and tested under Linux and macOS. To install the tool,
please follow the instructions:
https://judithbergada.github.io/CASPR/installation/
## Usage
The detailed documentation showing how to use CASPR is available at:
https://judithbergada.... |
import 'package:flutter/services.dart';
import 'package:twitter_clone/views/resources/colors.dart';
class Graphical {
static void setSystemUIOverlayStyle() {
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(
systemNavigationBarIconBrightness: Brightness.dark,
systemNavigationBarCo... |
---
region: MENA
country: Libya
name: المنظمة الليبية لحقوق العمال ومحاربة الفساد / Libyan Association for Workers' Rights and Fighting Corruption
acronym:
is_member:
no_gndem_member_countries:
regional_network:
website: https://www.facebook.com/work17
---
|
import os
import click
from keep import cli, utils
@click.command('register', short_help='Register user over server.')
@cli.pass_context
def cli(ctx):
"""Register user over server."""
dir_path = os.path.join(os.path.expanduser('~'), '.keep', '.credentials')
if os.path.exists(dir_path):
if click.con... |
package com.ing.streaming.journal
import akka.actor.ActorSystem
import akka.testkit.{TestActorRef, TestKit}
import com.ing.streaming.data.{Transaction, DataGenerator}
import org.joda.time.{DateTime, Interval}
import org.scalatest._
import scala.collection.mutable
import scala.concurrent.duration._
import com.ing.strea... |
import Test.Tasty
import Test.Tasty.QuickCheck as QC
import Text.Tarzan.Regex (RE, (<.>))
import qualified Text.Tarzan.Regex as RE
import Control.Applicative
import Data.Monoid
import Data.Either
main :: IO ()
main = defaultMain tests
tests :: TestTree
tests = testGroup "Tests" [qcProps]
newtype RC = RC (RE Char)... |
<?php
namespace Salesfly\Salesfly\Entities;
class DetailPurchase extends \Eloquent {
protected $table = 'detailPurchases';
protected $fillable = ['producto','descuento',
'montoBruto',
'montoTotal',
'purchases_id',
'detPres_id',
'preProducto',
'preC... |
/**
* @brief Thread Test
* @author Vic Chan
* @date 2017-10-23
* */
#include <string>
#include <vector>
#include "./thread.h"
struct message {
int id;
std::string content;
message(int id, std::string content):id(id), content(content) {};
};
void handle(void* msg) {
message* msg1 = (message* )msg;
prin... |
# How to check heavy3 file consistency
## Full check
sha256 of the full file should be `ffe30d8a63e1731e613b16ff8fd040d2946dba6a09823d7cc09d837570c55199`
See full_check.py for az python impl.
Takes from 10 to 30 sec.
## Minimal check, file size
Not a full check, but tells if the creation process was interrupted ... |
use worker::*;
mod utils;
fn log_request(req: &Request) {
console_log!(
"{} - [{}], located at: {:?}, within: {}",
Date::now().to_string(),
req.path(),
req.cf().coordinates().unwrap_or_default(),
req.cf().region().unwrap_or("unknown region".into())
);
}
#[event(fetch)]... |
require 'active_support'
require_relative 'touth/version'
require_relative 'touth/store'
require_relative 'touth/authenticator'
require_relative 'touth/active_record_support'
require_relative 'touth/action_controller_support'
require_relative 'touth/middleware'
require_relative 'touth/railtie' if defined? Rails
# T... |
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Laravelista\Comments\Comment;
/**
* App\EntryComment
*
* @property int $id
* @property string|null $commenter_id
* @property string|null $commenter_type
* @property string|null $guest_name
* @property string|null $guest_email
* @property string... |
<?php
namespace App;
class OcpwMassEmissionsParameter extends OcpwParameter
{
} |
//
// CustomListsPopover.h
// Shukofukurou
//
// Created by 天々座理世 on 2018/07/25.
// Copyright © 2018 Atelier Shiori. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface CustomListsPopover : NSViewController
typedef void (^caction)(NSString *customlistname);
@property caction actionblock;
@property (strong)... |
<?php
namespace Encore\Admin\Widgets\Chart;
use Encore\Admin\Admin;
use Encore\Admin\Widgets\Widget;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Contracts\Support\Renderable;
class Chart extends Widget implements Renderable
{
protected $elementId = '';
protected $options = [];
protected ... |
import * as Yup from 'yup';
import DeliveryProblem from '../models/DeliveryProblem';
import Order from '../models/Order';
import Deliveryman from '../models/Deliveryman';
import Recipient from '../models/Recipient';
import Mail from '../../lib/Mail';
class DeliveryProblemController {
async index(req, res) {
con... |
---
category: event
title: LambdaConf
logo: /resources/img/lambdaconf.png
location: Boulder, CO, USA
description: "(Truly) Advanced Scala & Other Functional Programming"
start: 25 May 2017
end: 27 May 2017
link-out: http://lambdaconf.us
---
|
<?php
use WP_CLI\Tests\TestCase;
class WP_CLI_Test extends TestCase {
public function testGetPHPBinary() {
$this->assertSame( WP_CLI\Utils\get_php_binary(), WP_CLI::get_php_binary() );
}
public function testErrorToString() {
$this->expectException( 'InvalidArgumentException' );
$this->expectExceptionMessag... |
package com.xpf.attributeview;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.drawable.BitmapDrawable;
im... |
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace Mono.Debugger.Soft
{
// Represents a temporary type of a lambda expression.
// In order to determine the type of a lambda based on
// its context, type evaluation for it must be delayed.
public class DelayedLambdaType... |
package model
// 视图渲染内容对象
type View struct {
Title string // 页面标题
Keywords string // 页面关键字
Description string // 页面描述
Error string // 错误信息
MainTpl string // 自定义MainTpl展示模板文件
Redirect string // 引导页面跳转
ContentType string /... |
package transport
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestCodec(t *testing.T) {
audio := Codec{
MimeType: "audio/opus",
ClockRate: 48000,
Channels: 2,
SDPFmtpLine: "",
}
video := Codec{
MimeType: "video/vp8",
ClockRate: 90000,
Channels: 0,
SDPFmtpLine:... |
using System;
using DG.Tweening;
using UnityEngine;
public class Avatar : IAttackable, IHealth, IMovable
{
public string name => _data.name;
public bool IsOnCombat;
public bool IsDead => _currentHp <= 0;
public int CurrentHp => _currentHp;
public int MaxHp => _data.hp;
public string Type => _d... |
use pest::Error;
use pest::iterators::{Pair, Pairs};
use parser::Rule;
pub fn as_amb<'a, F, T>(
pairs: Pairs<'a, Rule>,
a_rule: Rule,
b_rule: Rule,
func: F,
) -> Result<T, Error<'a, Rule>>
where
F: Fn(Pairs<'a, Rule>, Option<Pairs<'a, Rule>>) -> Result<T, Error<'a, Rule>>,
{
as_ht(pairs, a_rul... |
---
'@backstage/create-app': patch
---
Adjust template to the latest changes in the `api-docs` plugin.
## Template Changes
While updating to the latest `api-docs` plugin, the following changes are
necessary for the `create-app` template in your
`app/src/components/catalog/EntityPage.tsx`. This adds:
- A custom enti... |
[4, 5].each do |element|
p element
end
{"example" => 0}.each do |key, value|
p key
p value
end
|
using Microsoft.VisualStudio.Language.StandardClassification;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Classification;
using Microsoft.VisualStudio.Text.Editor;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows.Controls;
using System.Windows.Thre... |
package org.motechproject.umurinzi.dto;
import lombok.Getter;
import lombok.Setter;
import org.motechproject.umurinzi.domain.enums.EmailSchedulePeriod;
public class EmailReportConfigDto {
@Getter
@Setter
private Boolean enableEmailReportJob = false;
@Getter
@Setter
private String emailReportStartDate;
... |
package de.katzenpapst.amunra.helper;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.AxisAlignedBB;
public class NbtHelper {
public static NBTTagCompound getAsNBT(AxisAlignedBB aabb)
{
NBTTagCompound result ... |
package com.lwt.qmqiu_sps1.bean
import org.springframework.data.annotation.Id
import org.springframework.data.mongodb.core.mapping.Document
@Document(collection = "gift_log")
data class GiftLog(
@Id
var _id:String?=null,
//0 购买 1赠送 2兑换
var type:Int? = 0,
//总花费
var cash... |
namespace Me20.Common.Interfaces
{
public interface IHaveInternalName
{
string InternalName { get; }
}
}
|
using Shouldly;
using Stryker.DataCollector;
using System;
using System.Diagnostics;
using System.Threading;
using System.Xml;
using Xunit;
namespace Stryker.Core.UnitTest.TestRunners
{
public class CoverageCaptureTests
{
private static bool WaitFor(object lck, Func<bool> predicate, int timeout)
... |
# Integers
# Literals generate a value of the "default" integer type (Int64 on my workstation)
1
1234
# Types of Literals
typeof(1)
# Internal variable, `Sys.WORD_SIZE`, indicates word architecture of target system
Sys.WORD_SIZE
# Synonyms for signed and unsigned default integers
Int
UInt
# Values that **do not** ... |
import React from "react";
import { Icons, MakeIcon, Icon } from "./icons";
import { Chatbot } from "../../components";
import Ebet from "../../images/ebet.png";
import "./home.scss";
import { Spin } from "antd";
import {
IChatbotPresentationalProps,
ChatbotPresentational,
} from "components/Chatbot/chatbotPresen... |
use strict;
use CXGN::Page;
my $page=CXGN::Page->new("chromosome6.html","html2pl converter");
$page->header("Mapping information for chromosome 6");
print<<END_HEREDOC;
<center>
<h1>Chromosome 6</h1>
<img alt="" src="/documents/maps/lpimp_ibl/IMAGES/lycopimp6.png" usemap="#synteny_map_chr6" />
<map name="synte... |
{
DocuGes - Gestion Documental
Autor: Fco. Javier Perez Vidal <developer at f-javier dot es>
This program 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... |
using System;
using System.Diagnostics;
using DediLib;
using Xunit;
using Xunit.Abstractions;
namespace Test.DediLib
{
public class TestInjectionContext
{
private readonly ITestOutputHelper _output;
public TestInjectionContext(ITestOutputHelper output)
{
_output = output;
... |
create dabatabase dashboard;
create user 'dashboard'@'localhost' identified by 'dashboard';
GRANT ALL PRIVILEGES ON * . * TO 'dashboard'@'localhost';
use dashboard;
/* Modulos de Puppet */
create table modulos (
id_modulo int not null auto_increment,
nombre char(25) not null unique,
primary key (id_modulo)
);... |
function Get-CommandDefinitionHtml {
# this tells powershell to allow advanced features,
# like the [validatenotnullorempty()] attribute below.
[CmdletBinding()]
param(
[ValidateNotNullOrEmpty()]
[string]$name
)
$command = get-command $name
# Look mom! I'm a ... |
# added for Dartium
# export DART_SDK=/usr/local/opt/dart/libexec
# export DARTIUM=/usr/local/opt/dart/Chromium.app
|
inherited frmCadProdutos: TfrmCadProdutos
Caption = 'Cadastro de Produtos'
ClientHeight = 407
PixelsPerInch = 96
TextHeight = 13
inherited PageControl1: TPageControl
Height = 388
inherited TabSheet1: TTabSheet
inherited DBText1: TDBText
DataField = 'PRO_CODIGO'
end
object Lab... |
#!/bin/bash
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or d... |
// @ts-check
const { getConfig } = require('@airbnb/config-babel');
const { getSettings } = require('@airbnb/nimbus-common');
const { context, tool } = process.beemo;
const { graphql, library, next, node, react, env } = getSettings();
module.exports = getConfig({
env,
esm: !!(context.args.esm || process.env.ESM)... |
Rails.application.routes.draw do
mount Korgi::Engine => "/korgi"
namespace :admin do
resources :posts
end
resources :posts
end
|
ALTER EXTERNAL DATA SOURCE hadoop_eds SET
LOCATION = 'hdfs://10.10.10.10:8020',
RESOURCE_MANAGER_LOCATION = '10.10.10.10:8032'
;
ALTER EXTERNAL DATA SOURCE hadoop_eds SET
CREDENTIAL = new_hadoop_user
;
ALTER EXTERNAL DATA SOURCE MyAzureInvoices
WITH (
TYPE = BLOB_STORAGE,
... |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE CPP #-}
module Test.Hspec.Wai.Internal (
WaiExpectation
, WaiSession(..)
, runWaiSession
, runWithState
, withApplication
, getApp
, getState
, formatHeader
) wh... |
package org.patternfly.sample
internal interface FormSample {
fun form() {
}
}
|
<?php
namespace App\Http\Controllers\Admin;
use Illuminate\Http\Request;
use Gufy\PdfToHtml\Config;
use setasign\Fpdi\Fpdi;
use setasign\Fpdi\PdfReader;
use App\Http\Controllers\Controller;
use Validator;
use App\Form;
use App\Notifications;
class DonorController extends Controller
{
/**
* Create a new cont... |
export const LoginServiceFactory = () => ({
events: {subscribe: f => f},
complete: true
});
|
cp tests/stu2 tests/7.out
./addstu tests/7.out 5056789 "Tom Jones" 3778 80.5
|
#! /bin/bash
# reference: https://blogs.msdn.microsoft.com/commandline/2017/12/08/cross-post-wsl-interoperability-with-docker/
export GO_VERSION=1.9.4
echo "Installing go $GO_VERSION"
wget https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz
export... |
/*
* MCA implementation for AMD CPUs
* Copyright (c) 2007-2012 Advanced Micro Devices, Inc.
*
* This program 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 2 of the License, or
* (at yo... |
package me.kalmanbncz.nd.ar.entity;
import com.badlogic.gdx.math.Vector3;
public class GroundMovement extends Movement {
public GroundMovement(int entityId) {
super(entityId);
}
@Override
void accelerate(float timeStep) {
Vector3 diff = tmp;
diff.set(destination).sub(position... |
/*++
Copyright (c) 1997 Microsoft Corporation
Module Name:
stack.c
Abstract:
Dumps the AML Context Structure in Human-Readable-Form (HRF)
Author:
Stephane Plante (splante) 26-Oct-1997
Environment:
User Mode.
Revision History:
--*/
#include "pch.h"
VOID
stackArgu... |
import 'package:sqlparser/sqlparser.dart';
import 'package:test/test.dart';
extension ExpectErrors on AnalysisContext {
void expectError(String lexeme, {AnalysisErrorType? type}) {
expect(
errors,
[analysisErrorWith(lexeme: lexeme, type: type)],
);
}
void expectNoError() {
expect(errors,... |
import 'package:postgresql/postgresql.dart' show Row;
import '../../entity/application.dart';
import '../../entity/application_environment.dart';
import '../../entity/application_revision.dart';
import '../../entity/aws_cloudfront.dart';
import '../../entity/aws_s3.dart';
import '../../entity/session.dart';
import '../... |
// +build ffmpeg30
package avfilter
func (l *Link) Status() int {
return int(l.CAVFilterLink.status)
}
func (l *Link) FrameCount() int64 {
return int64(l.CAVFilterLink.frame_count)
}
|
CREATE
VIEW `v_user_music_count` AS
select
`m_user`.`id` AS `userBean.id`,
count(`m_article`.`id`) AS `cnt`
from
((`m_article`
left join `r_music` ON ((`m_article`.`id` = `r_music`.`id`)))
left join `m_user` ON ((`m_article`.`user_id` = `m_user`.`id`)))
where
... |
use crate::puzzle_input;
pub fn run() {
let input = puzzle_input::read_all_lines("./input/2020-d01-input1.txt");
let expenses: Vec<i64> = input
.iter()
.map(|x| x.trim().parse::<i64>().unwrap())
.collect();
println!("** Part 1 Final: {:?}", check_two_expenses(&expenses));
print... |
Epure::Application.routes.draw do
resources :schedules
resources :schedules do
resources :entries, :except => [:show] do
collection do
get :search_course_names
get :search_lecturers
end
end
get "color_schemes", :to => "color_schemes#index"
post "color_schemes/reset", :t... |
import { Injectable } from "@nestjs/common";
import fetch, { RequestInit, Response } from "node-fetch";
@Injectable()
export class HttpService {
public fetch(uri: string, init?: RequestInit): Promise<Response> {
return fetch(uri, init);
}
}
|
---
date: 2000-01-01T00:00:00+00:00
title: Rails
author: bradrydzewski
weight: 12
draft: true
toc: false
---
# Rails Example
Help Wanted.
|
/*
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under
* one or more contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright ownership.
* Licensed under the Zeebe Community License 1.0. You may not use this file
* ... |
import StyleDictionary from "style-dictionary";
import MeiucaEngineCore from "meiuca-engine-core";
import * as cssFormatBlock from "./component-format-block/css";
import * as scssFormatBlock from "./component-format-block/scss";
import * as rnFormatBlock from "./react-native-format-block";
import transformer from "./re... |
# $1 : alias CN of certificate
# $2 : key-store name
# $3 : password
cd src/main/resources/keystore/ || exit
#openssl pkcs12 -in ${1}.p12 -nokeys -out ${2}
keytool -exportcert -alias ${1} -keypass keypass \
-keystore ${2}.p12 -storepass ${3} -file ${1}.crt -rfc
keytool -printcert -file ${1}.crt
echo "Done"
|
# ploc
ploc is a python program to count lines in a Python file.
It aims to demonstrate the following language features:
* Variables
* Text
* Functions
* Branching
* Looping
* Arrays
* File I/O
* Error Handling
* Classes
* Debugging (comment out any useful debug print statements)
* Testing
|
<?php
declare(strict_types=1);
namespace Thinktomorrow\Chief\Managers;
interface Manager
{
public function managedModelClass(): string;
public function route(string $action, $model = null, ...$parameters): string;
public function can(string $action, $model = null): bool;
}
|
mutable struct SVMSurrogate{X,Y,M,L,U} <: AbstractSurrogate
x::X
y::Y
model::M
lb::L
ub::U
end
function SVMSurrogate(x,y,lb::Number,ub::Number)
xn = reshape(x,length(x),1)
model = LIBSVM.fit!(SVC(),xn,y)
SVMSurrogate(xn,y,model,lb,ub)
end
function (svmsurr::SVMSurrogate)(val::Number)
... |
package gocron
import (
"sort"
"sync"
"time"
)
// Scheduler struct, the only data member is the list of jobs.
// - implements the sort.Interface{} for sorting jobs, by the time nextRun
type Scheduler struct {
jobs []*Job // Array store jobs
mu sync.RWMutex
running bool
stopChan chan struct{}
}
// NewSched... |
#!/bin/bash
TMP_FILE=tmp.smali
OLD_IFS=$IFS
for f in `grep -rn "IccCard;->" $1 | grep "invoke-virtual" | cut -d: -f1 | uniq | sort`
do
echo "replace file:$f"
cat /dev/null > $TMP_FILE
IFS=$'\n'
for l in `cat $f`
do
echo $l | grep "IccCard;->" | grep "invoke-virtual" -q
if [ $? -e... |
#!/bin/sh
set -e
wheel_gid=1
tty_gid=2
phys_gid=3
audio_gid=4
window_uid=13
window_gid=13
die() {
echo "die: $*"
exit 1
}
if [ "$(id -u)" != 0 ]; then
die "this script needs to run as root"
fi
[ -z "$SERENITY_ROOT" ] && die "SERENITY_ROOT is not set"
[ -d "$SERENITY_ROOT/Base" ] || die "$SERENITY_ROOT/... |
#!/bin/bash
if [ -z "$USERNAME" ] ; then
USERNAME=squid
fi
if [ -z "$PASSWORD" ] ; then
PASSWORD=squid
fi
if [ -z "$HTTP_PORT" ] ; then
HTTP_PORT=3128
fi
if [ ! -f $squid_conf_file ] ; then
echo "Missing squid3 configuration file"
exit 1
fi
# Copy artifact configuration file
if [ ! -f /etc/squid3/squid.c... |
require 'spec_helper'
describe AthenaHealth::Allergy do
let(:order_type_attributes) do
{
'ordertypeid': '123456',
'name': 'Some name'
}
end
subject { AthenaHealth::OrderType.new(order_type_attributes) }
it_behaves_like 'a model'
it 'have proper attributes' do
expect(subject).to hav... |
/* vi:set ts=4 sw=4 expandtab:
*
* Copyright 2016, Chris Leishman (http://github.com/cleishm)
*
* 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/LI... |
# Kubernetes Basic Commands List
```bash
kubectl config get-contexts
kubectl config use-context <context>
kubectl get po
kubectl logs -f <container>
kubectl exec -it <container> sh
```
|
import 'package:cirilla/mixins/mixins.dart';
import 'package:cirilla/widgets/cirilla_cache_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
class SliderBlock extends StatelessWidget with Utility {
final Map<String, dynamic> block;
const SliderBlock({Key key... |
'use strict';
const timeago = require('timeago.js');
const timeagoInstance = timeago();
$(document).ready(function() {
var action = '';
var index = 0;
var team_type = '';
function load_team(type) {
team_type = type;
$('#message').html('');
clear_table();
$('#team_list... |
import { Observable } from 'rxjs';
import { HttpClient } from '@angular/common/http';
import {
Inject,
Injectable,
} from '@angular/core';
import { Media } from '../../../../api/src/types/media/media';
@Injectable({
providedIn: 'root'
})
export class SailPicturesService {
constructor(@Inject(HttpClient) priva... |
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
namespace Microsoft.AspNetCore.SignalR
{
/// <summary>
/// Metadata that describes the <see cref="Hub"/> information associated w... |
import 'package:doing/components/camera.dart';
import 'package:doing/constants/colors.dart';
import 'package:doing/services/shared_preferences.service.dart';
import 'package:doing/widgets/inputs/text_input.dart';
import 'package:flutter/material.dart';
import 'package:doing/constants/shared_preferences.dart';
class Pr... |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... |
using UnityEngine;
using UnityEngine.SceneManagement;
public class SilentCreditsMusic : MonoBehaviour
{
[SerializeField] private AudioSource endPianoMusic1;
[SerializeField] private AudioSource endPianoMusic2;
public void SilentMusic()
{
endPianoMusic1.volume -= 0.25f;
endPianoMusic2.... |
package com.netcracker.tripnwalk.entry;
import com.netcracker.tripnwalk.entry.components.BillingLike;
import javax.persistence.*;
@Entity
@Table(name = "like_route")
public class Like {
public Like() {
}
public Like(BillingLike key) {
this.key = key;
}
public Like(Long idUser, Long idRo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.