text stringlengths 27 775k |
|---|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
#if UNITY_EDITOR
using System;
using System.Collections.Generic;
using System.Xml;
using System.Xml.Linq;
namespace Microsoft.Build.Unity.ProjectGeneration.Template... |
import random
class Color(object):
def __init__(self, r, g, b):
self.r = r
self.g = g
self.b = b
@classmethod
def random(cls):
r = random.randint(0, 255)
g = random.randint(0, 255)
b = random.randint(0, 255)
return Color(r, g, b)
... |
import styled from 'styled-components';
import { secondaryColor, media } from 'styles';
export default styled.div`
color: ${secondaryColor};
font-weight: 700;
text-align: center;
font-size: 5em;
margin-bottom: 5%;
${media.tablet`
margin-bottom: 20px;
`};
`;
|
#!/usr/bin/python
# -*- coding: ascii -*-
# $Id$
#
# Author: Filippo Rivato
# Date: 2015/10/04
__author__ = "Filippo Rivato"
__email__ = "f.rivato@gmail.com"
__name__ = _("Flatten")
__version__= "0.0.2"
from CNC import CNC,Block
from ToolsPage import Plugin
#========================================================... |
require "rails_helper"
RSpec.describe Queries::GetPublishIntent do
let(:timeout) { false }
before do
request_stub = stub_request(:get, %r{.*content-store.*/publish-intent#{base_path}})
if timeout
request_stub.to_timeout
else
request_stub.to_return(status: status, body: body.to_json)
e... |
$elastomer = Elastomer::Client.new url: ENV["ELASTICSEARCH_URL"] || "http://localhost:9200"
|
#!/bin/sh
# REQUIRES: command -v clangd
. test/lib.sh
cat >> .config/kak/kakrc << EOF
set-option global lsp_diagnostic_line_error_sign ' X'
set-option global lsp_diagnostic_line_hint_sign '¿ '
set-option global lsp_diagnostic_line_info_sign '¡ '
set-option global lsp_diagnostic_line_warning_sign 'W '
EOF
ca... |
# -*- encoding : utf-8 -*-
require 'rademade_admin/routing/mapper'
require 'simple_form'
require 'select2-rails'
require 'carrierwave'
require 'light_resizer'
module RademadeAdmin
class Engine < ::Rails::Engine
isolate_namespace RademadeAdmin
config.assets.paths << "#{config.root}/vendor/assets/javascript/b... |
import 'dart:developer';
import 'package:encrypted_shared_preferences/encrypted_shared_preferences.dart';
import 'package:flutter/material.dart';
class ThemeProvider with ChangeNotifier {
final _prefs = EncryptedSharedPreferences();
static const _keyTheme = 'themeApp';
static const _dark = 'dark';
static con... |
## Anot.js 2.x
> Anot 是Anot not only templateEngine的缩写。 它是一款迷你,易用、高性能的前端MVVM框架, fork于avalon。
>2.0版进行了大量的精简, 移除了非现代浏览器的兼容代码, 移除组件API, 正式引入web component。
>> 2.x版本为 全新版本, 只兼容支持type="module"的浏览器。
```bash
# 开发模式
npm start
```
```bash
# 打包
npm run prod
```
执行完, 会打包为2个版本, 分别是
- anot.js 普通版(需要支持es6 module的现代浏览器)
- anot.to... |
## Redis[remote dictionary server]: NoSQL
### 简介
1. redis 简介
- key-value 的 NoSQL {内存级别}开源数据库 vs RDBM
- [集群]高并发 + 高性能 + 高扩展 + 高可用
- 多种数据结构[**本质是计算向数据移动**{server 有很多方法 | 与 memcache 的 string 比可以只取一些字段}] + 速度快
- 内存 + 异步持久化 + string max 512m
- 解决[分布式]缓存{超热的 key} + 锁 + 数据存储 + 解决方案
- feature: IO{epoll} + ... |
/**
* "This vocabulary defines terms used in SHACL, the W3C Shapes Constraint Language."@en
* @type <http://www.w3.org/2002/07/owl#Ontology>
* @label-en W3C Shapes Constraint Language (SHACL) Vocabulary
* @declare prefix-
* shnamespace-
* http://www.w3.org/ns/shacl#
* @suggestedShapesGraph <http://www.w3.org/n... |
#!/usr/bin/env ruby
# encoding: UTF-8
require 'optparse'
require 'druid-tools'
def doit(druid, flags)
puts "Processing #{druid.id}"
begin
item = Dor::Item.find(druid.druid)
ap({:item => item, :collections => item.collections}) if flags[:debug]
# remove all collections
item.collections.dup.... |
cat > dataset.csv << EOF
f1,ans
0.1,0
0.7,1
0.6,1
0.2,0
0.8,1
EOF
|
import 'package:canton_design_system/canton_design_system.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:notes_app/src/models/note.dart';
import 'package:notes_app/src/ui/providers/note_pro... |
#!/bin/bash
## ABSOLUTE path to the spawn-fcgi binary
SPAWNFCGI="/usr/bin/spawn-fcgi"
## ABSOLUTE path to the PHP binary
FCGIPROGRAM="/usr/bin/php-cgi"
## ABSOLUTE path to UNIX socket
FCGISOCKET="/var/run/php.socket"
## uncomment the PHPRC line, if you want to have an extra php.ini for this user
## store your cu... |
class CompanySerializer < ActiveModel::Serializer
attributes :id, :name, :url, :description
has_many :positions
has_many :users
end
|
package net.yuzumone.tootrus.data.mastodon
import com.sys1yagi.mastodon4j.MastodonClient
import com.sys1yagi.mastodon4j.api.Range
import com.sys1yagi.mastodon4j.api.entity.Status
import com.sys1yagi.mastodon4j.api.method.Timelines
import javax.inject.Inject
import javax.inject.Named
interface TimelineRepository {
... |
class User
include DataMapper::Resource
property :id, Serial
property :name, String
property :email, String
property :username, String
property :role, String
property :created_at, DateTime
property :updated_at, DateTime
validates_presence_of :name, :username
validates_... |
/*
* The Shadow Simulator
* See LICENSE for licensing information
*/
use test_utils::set;
use test_utils::TestEnvironment as TestEnv;
// The number of random values to generate with each method.
const RGENLEN: usize = 200;
// The number of buckets to use when checking random value distribution.
const BUCKETLEN: us... |
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -instcombine -S | FileCheck %s
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
; TODO: Replace with boolean Phi.
define i1 @test_eq(i1 %cond) {
; CHECK-LABEL: @test_eq(
; CHECK-NEXT: entry:
; CHECK-NEXT: br i1 [[COND:%... |
using System;
using UniRx;
using UnityEngine.Networking;
public static class NetworkingExtensions
{
public static IObservable<string> ObserveRequestResult(this UnityWebRequest request)
{
if (request.downloadHandler == null)
{
request.downloadHandler = new DownloadHandlerBuffer();
... |
#!/bin/bash
# Commands that you want to be run once connected can go here
cd /home/pi/iqube-web
/usr/bin/npm install
sudo /usr/bin/node /home/pi/iqube-web/app.js &
# uncomment for testing:
#/home/pi/bin/test-turnkey.sh
#startx /home/pi/raspberry-pi-turnkey/xinitrc_ap
startx /home/pi/raspberry-pi-turnkey/xinitrc
|
import 'dart:io';
import 'package:path/path.dart' as path;
final Directory externalStorage = new Directory(path.current); |
<?php
namespace LeKoala\CommonExtensions;
use SilverStripe\ORM\DataObject;
use SilverStripe\Forms\FieldList;
use SilverStripe\ORM\DataExtension;
use LeKoala\CmsActions\CustomAction;
use SilverStripe\Forms\GridField\GridField;
/**
* Makes record locked
*
* Unlocking require special action
*
* @property \LeKoala\... |
#pragma once
#include "../Interfaces/hooks.h"
#include "../main.h"
//Hooks
namespace ThirdPerson
{
void OverrideView(CViewSetup* pSetup);
void FrameStageNotify(ClientFrameStage_t stage);
}
|
#include "match4.h"
unsigned char PLAYER_TURN = 0;
char PLAYER_PIECE[2] = {'X', 'O'};
unsigned char get_player_turn(void)
{
return (PLAYER_TURN);
}
unsigned char set_player_turn(unsigned char player)
{
if (player == 0 || player == 1)
{
PLAYER_TURN = player;
}
return (PLAYER_TURN);
}
unsigned char get_next_p... |
package org.dnltsk.luggagelift.order.confirm
import org.dnltsk.luggagelift.luggage.LuggageRepository
import org.junit.Assert.assertEquals
import org.junit.Test
class OrderConfirmHttpControllerTest {
@Test
fun `correct number of luggageIds are generated`() {
val controller = OrderConfirmHttpController... |
'use strict';
const Joi = require('joi');
const internals = {};
// Root schemas
exports.handler = [
Joi.string(),
Joi.object({
template: Joi.string(),
context: Joi.object(),
options: Joi.object()
})
];
// Manager schemas
exports.viewOverride = Joi.object({
path: [Joi.arr... |
-- |Processing of data from the lodestone and database
module Data.Krile.FFData
where
|
#!/usr/bin/env perl
use v5.18;
use warnings FATAL => 'all';
package ServedObject;
use Net::DBus;
use parent qw(Net::DBus::Object);
use Net::DBus::Exporter qw(com.zbentley.ipc.gelatin);
sub new {
my ( $class, $service ) = @_;
return $class->SUPER::new($service, "/ipc/gelatin");
}
dbus_method("test_method",... |
# frozen_string_literal: true
require 'google/apis/options'
# these require solve load order issues (undefined constant Google::Apis::ServerError and Signet::RemoteServerError, rescued in multiple places)
require 'google/apis/errors'
require 'signet/errors'
# As stated in https://github.com/googleapis/google-api-rub... |
# Base64URL
```js
import { Base64URL } from "https://code4fukui.github.io/Base64URL/Base64URL.js";
const bin = new Uint8Array([1, 2, 3]);
const s = Base64URL.encode(bin);
console.log(s);
const bin2 = Base64URL.decode(s);
console.log(bin2);
```
|
## ----------- General functions
name(d :: AbstractDeviation) = d.name;
short_description(d :: AbstractDeviation) = d.shortStr;
long_description(d :: AbstractDeviation) = d.longStr;
norm_p(d :: AbstractDeviation) = d.normP;
"""
$(SIGNATURES)
Retrieve data values
"""
get_data_values(d :: AbstractDeviation{F1}) w... |
# vortex-cypher-layers
layer configurations for my Vortex Cypher
## Default Layer
This is the stock Vortex Cypher layout without any modifications.

|
<?php
declare(strict_types=1);
namespace Emonkak\Validation\Tests\Type;
use Emonkak\Validation\Collector\CollectorInterface;
use Emonkak\Validation\Type\ArrayOf;
use Emonkak\Validation\Type\TypeInterface;
use PHPUnit\Framework\TestCase;
/**
* @covers \Emonkak\Validation\Type\ArrayOf
*/
class ArrayOfTest extends T... |
import { Component, OnInit } from '@angular/core';
// Imports
import { AngularFirestore, AngularFirestoreCollection } from '@angular/fire/firestore';
import { Observable } from 'rxjs';
import { Item } from 'src/app/interfaces/item.interface';
@Component({
selector: 'app-photos',
templateUrl: './photos.component.h... |
/**
* File: RandomWorld.java
* Author: William Forte
* Time: 9:52:46 AM
* Date: Mar 24, 2016
* Project: Survival
* Package: survival.main.generation.worlds
*/
package survival.main.generation.worlds;
import java.awt.Graphics2D;
import java.util.Random;
import backbone.engine.main.BackboneGameStateManager;
imp... |
import {Routes, RouterModule} from '@angular/router';
import {Maps} from './maps.component';
import {GoogleMaps} from './components/googleMaps/googleMaps.component';
import {NgModule} from "@angular/core";
import {MarkerResolver} from "./components/googleMaps/marker-resolver.service";
import {MarkerService} from "./c... |
package org.torproject.android.service.vpn;
/*
* Copyright (c) 2013, Psiphon Inc.
* All rights reserved.
*
* 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,... |
namespace Line.Messaging
{
/// <summary>
/// Response from Get User Profile API.
/// https://developers.line.me/en/docs/messaging-api/reference/#get-profile
/// </summary>
public class UserProfile
{
/// <summary>
/// Display name
/// </summary>
public string Dis... |
package org.odk.collect.android.support
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import androidx.fragment.app.FragmentManager
import org.odk.collect.geo.maps.MapFragment
import org.odk.collect.geo.maps.MapPoint
class FakeClickableMapFragment : MapFragment {
private var idCounte... |
export const environment = {
apiGatewayBaseUrl: 'https://{APIKEY}.execute-api.{REGION}.amazonaws.com',
production: true,
};
|
package es.weso.rdfshape.server.api.routes.data.logic.operations
import cats.effect.IO
import es.weso.rdfshape.server.api.routes.data.logic.operations.DataQuery.{
DataQueryResult,
successMessage
}
import es.weso.rdfshape.server.api.routes.data.logic.types.Data
import es.weso.rdfshape.server.api.routes.endpoint.log... |
;RUN: not ch6_read_ir %s 2> %t.err
;RUN: FileCheck --input-file=%t.err %s
;CHECK: Error while processing the bitcode file
|
alias cp='cp'
wget --user=hassio --password='wukong2019hassio' ftp://127.0.0.1/share/wukongdata/config.yml
cp -f config.yml /root/.wukong/config.yml
python3 wukong.py
|
<?php
declare(strict_types=1);
namespace DigitalCz\DigiSign\Resource;
use ArrayObject;
use DigitalCz\DigiSign\Exception\RuntimeException;
use Psr\Http\Message\ResponseInterface;
/**
* @template T
*
* @extends ArrayObject<int|string, T>
*/
class Collection extends ArrayObject implements ResourceInterface
{
/... |
package vampirefsm.controllers
import javax.inject.{Inject, Singleton}
import journeys.VampireFSMJourneyService
import play.api.data.Form
import play.api.data.Forms._
import play.api.data.validation.{Constraint, Invalid, Valid, ValidationError}
import play.api.i18n.{I18nSupport, MessagesApi}
import play.api.mvc._
impo... |
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\Korisnik;
class KorisnikController extends Controller
{
public function addKorisnika()
{
return view("welcome");
}
public function selectData()
{
$korisnici = Korisnik::all();
return view("... |
import { Matrix4 } from 'three'
import { getComponent } from '@xrengine/engine/src/ecs/functions/ComponentFunctions'
import { Object3DComponent } from '@xrengine/engine/src/scene/components/Object3DComponent'
import { accessSelectionState } from '../services/SelectionServices'
const IDENTITY_MAT_4 = new Matrix4().id... |
---
title: Status
category: Backend
order: 4
---
### Goals for this Release
* Real name entry upon registration
* Support for comments
* Ability to download episodes in advance of listening to them
### Next Release
The Android app has a 1 month release cycle.
|
SECTION rodata_font
SECTION rodata_font_8x8
PUBLIC _zx7_font_8x8_zx_system
PUBLIC _zx7_font_8x8_zx_system_end
_zx7_font_8x8_zx_system:
BINARY "font_8x8_zx_system.bin.zx7"
_zx7_font_8x8_zx_system_end:
|
import 'package:flutter/material.dart';
class AnimatedListStateWidget extends StatefulWidget {
AnimatedListStateWidget({Key? key}) : super(key: key);
@override
_AnimatedListStateWidgettState createState() =>
_AnimatedListStateWidgettState();
}
class _AnimatedListStateWidgettState extends State<AnimatedLi... |
import argparse
import itertools
import json
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
from common import add_db_args
from common import add_plot_limit_args
from common import set_db_connection
from common import set_plot_limits
from matplotlib.colors import LogNorm
fr... |
<?php
/**
* @file
* Include this file to include all classes of Glamus Utils.
*
* For more information on how to install check README.md.
*/
require_once dirname(__DIR__) . "/src/FileUtils.php";
require_once dirname(__DIR__) . "/src/JsonHandler.php";
require_once dirname(__DIR__) . "/src/StringUtils.php";
requir... |
/**
* \file
* \copyright
* Copyright (c) 2012-2022, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#pragma once
#include <boost/property_tr... |
package com.ajoshow.mock.web.dto;
import com.ajoshow.mock.domain.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonUnwrapped;
/**
* Created by andychu on 2017/4/22.
*/
@JsonIgnoreProperties(ignoreUnknown... |
<?php
namespace App\Jobs;
use App\Mail\DeleteReviewMailable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Mail;
class DeleteReviewJob extends Job implements ShouldQueue
{
use SerializesModels;
/**
* Create a new job instance.
*
... |
---
layout: post
title: Halte au magasin funèbre
description: Pamphlet anti-"marché noir" !
authors:
- Dirty Henry
wordpress_id: 339
date: "2006-11-16 12:38:00 +0100"
categories:
- Artistes
tags:
- Oasis
cover: noel-gallagher-live.jpg
---
Y'en a marre tes potes !
Qu'il n'y ait plus de place pour le concert "Noe... |
# bin
Stash spot for my ~/bin and /usr/local/bin all comments and criticism
is much appreciated.
If there is any licensed code in here, please notify me! It is also
not my intention to claim others code as my own and try my best to
include a link to any orginal source when this is the case.
|
/* @flow */
import { FetchHistoryArguments, HistoryResponse, ModulesInject } from '../../flow_interfaces';
import operationConstants from '../../constants/operations';
import utils from '../../utils';
export function getOperation(): string {
return operationConstants.PNDeleteMessagesOperation;
}
export function va... |
/*
* Copyright (c) Intellinium SAS, 2014-present
*
* SPDX-License-Identifier: Apache-2.0
*/
package io.runtime.mcumgr.response.log;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.runtime.mcumgr.response.McuMgrResponse;
public class McuMgrLev... |
<?php
namespace App;
trait CacheFlushableAfterCreatedModelTrait
{
public static function bootCacheFlushableAfterCreatedModelTrait()
{
static::created(function (){
\Cache::tags([self::class])->flush();
});
}
} |
package ch.dreipol.multiplatform.reduxsample.shared.utils
import java.util.*
actual fun AppLanguage.Companion.fromLocale(): AppLanguage {
return fromValue(Locale.getDefault().language)
} |
package com.motiz88.rctmidi.webmidi.impl;
import com.facebook.react.bridge.ReadableMap;
public class MIDIOptions {
private boolean software = false;
private boolean sysex = false;
public boolean getSoftware() {
return software;
}
public boolean getSysex() {
return sysex;
}
public MIDIOptions(... |
import { Request, Response } from "express"
import { ExampleService } from '../services/exampleService'
export class ExampleController{
public exampleService: ExampleService
constructor() {
this.exampleService = new ExampleService()
}
public async dispatchPub(req: Request, res: Response){
await this.... |
#include <iostream>
#include <numeric>
using namespace std;
int mult(int x, int y) { return x * y; }
void src1013()
{
// P361,利用普通函数来定义函数对象
cout << "--->" << "代码10-13(利用普通函数来定义函数对象)" << "<---" << endl;
int A[] = { 1, 2, 3, 4, 5 };
const int N = sizeof(A) / sizeof(int);
cout << "The result by multipling all el... |
import { ASTNode, NameNode, DefinitionNode } from 'graphql';
export declare type NamedDefinitionNode = DefinitionNode & {
name?: NameNode;
};
export declare function resetComments(): void;
export declare function collectComment(node: NamedDefinitionNode): void;
export declare function pushComment(node: any, entity:... |
# bad args
Code
encode_unit(2, prune_method()$values, direction = "forward")
Condition
Error in `encode_unit()`:
! `x` should be a dials parameter object.
i This is an internal error in the dials package, please report it to the package authors.
---
Code
encode_unit(z, prune... |
package com.dietsodasoftware.yail.xmlrpc.model.customfields;
import com.dietsodasoftware.yail.xmlrpc.model.CustomField;
import com.dietsodasoftware.yail.xmlrpc.model.CustomField.Field;
import com.dietsodasoftware.yail.xmlrpc.model.CustomField.FormFieldFormatting;
import com.dietsodasoftware.yail.xmlrpc.model.CustomFie... |
namespace UglyToad.PdfPig.DocumentLayoutAnalysis.Export.Alto
{
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Xml.Serialization;
public partial class AltoDocument
{
/// <summary>
/// [Alto] Modern OCR software stores information on glyph level... |
create or replace package file_pkg_version is
pkg_version varchar2(200) := '1.0';
function get_version return varchar2;
end file_pkg_version;
/
|
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.hardware.PwmControl;
import com.qualcomm.robotcore.hardware.Servo;
import com.qualcomm.robotcore.hardware.ServoControllerEx;
import org.fi... |
import 'dart:async';
import 'dart:io';
import 'package:path/path.dart';
import 'package:path_provider/path_provider.dart';
import 'package:sqflite/sqflite.dart';
class CartDatabase {
static final CartDatabase _instance = CartDatabase._();
static Database _database;
CartDatabase._();
factory CartDatabase() {... |
package lacour.vincent.calculadora
import net.objecthunter.exp4j.ExpressionBuilder
import java.lang.Exception
class Evaluator(var label: String) {
fun addElement(element: Char): String {
this.label += element
return this.label
}
fun removeLastElement(): String {
this.label = labe... |
# frozen_string_literal: true
ENV['RAILS_ENV'] ||= 'test'
require_relative '../config/environment'
require 'rails/test_help'
require 'webmock/minitest'
require 'info_server'
require 'simplecov'
SimpleCov.start 'rails' do
add_filter 'Rakefile'
add_filter '.rake'
add_filter '/app/controllers/graphql_controller.r... |
FactoryGirl.define do
factory :delivery_organisation do
sequence(:natural_key) { |n| 'D%05d' % n }
name 'Government Delivery Organisation'
website 'http://example.com/government-delivery-organisation'
department
end
end
|
#!/usr/bin/env bash
#############################
# Include scripts
#############################
source /bootstrap/configuration.sh
source /bootstrap/environment.sh
source /bootstrap/semaphore-dependencies.sh
check_dependency "keystone"
#############################
# variables and environment
#####################... |
using System.Collections.Generic;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
namespace Strive.Core.Services.Permissions
{
public interface IPermissionLayersAggregator
{
ValueTask<Dictionary<string, JValue>> FetchAggregatedPermissions(Participant participant);
ValueTask<List<Perm... |
package org.dbtools.licensemanager
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Optional
import javax.inject.Inject
/**
* Extension for LicenseManager plugin
*/
open class LicenseManagerExtension @Inject constructor(
defaultOutputDir: String
) {
@get:Optional
@get:Input
var excludeA... |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Entitas.CodeGeneration.Plugins.ComponentLookupGenerator.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-genera... |
--FILE--
<?php
require \implode(\DIRECTORY_SEPARATOR, [__DIR__, '..', '..', 'vendor', 'autoload.php']);
function throwException()
{
defer($_, function () {
echo "after exception\n";
});
echo "before exception\n";
throw new \Exception('My exception');
}
try {
throwException();
} catch (\... |
# frozen_string_literal: true
#
# A presenter which, for a patient, displays any HD preferences (for example when or where they
# have HD) that do not match their current HD profile.
#
require_dependency "renalware/hd"
module Renalware
module HD
class UnmetPreferencesPresenter
include ActionView::Helpers
... |
const evaluate = require("../src/evaluator");
describe("Evaluating primitives", () => {
test("It should properly evaluate a number", () => {
expect(evaluate(JSON.stringify(42))).toEqual(42);
expect(evaluate(JSON.stringify(3.1415))).toEqual(3.1415);
});
test("It should properly evaluate a string", () => ... |
-- begin SAMPLER_CUSTOMER
create table SAMPLER_CUSTOMER (
ID varchar(36) not null,
VERSION integer not null,
CREATE_TS timestamp,
CREATED_BY varchar(50),
UPDATE_TS timestamp,
UPDATED_BY varchar(50),
DELETE_TS timestamp,
DELETED_BY varchar(50),
--
NAME varchar(50) not null,
LA... |
import {
generateId,
ADD_CARD_SUCCESS,
UPDATE_CARD_SUCCESS,
UPDATE_SELECTED_DECK,
GOTO_NEXT_CARD_INDEX,
GOTO_CARD_INDEX
} from '../actions'
import { combineReducers } from 'redux'
function decksReducer(decks = {}, action) {
if (action.type === ADD_CARD_SUCCESS) {
let card = action.payload.card
i... |
from typing import List
from functools import partial
import torch
from torch import nn
from catalyst.metrics.functional import dice
class DiceLoss(nn.Module):
"""The Dice loss.
DiceLoss = 1 - dice score
dice score = 2 * intersection / (intersection + union)) = \
= 2 * tp / (2 * tp + fp + fn)
""... |
extern crate bio;
mod pairwise;
use pyo3::prelude::*;
use pyo3::wrap_pyfunction;
use bio::alignment::distance;
use crate::pairwise::{Aligner, Alignment};
#[pyfunction]
fn levenshtein(a: &str, b: &str) -> PyResult<u32> {
Ok(distance::levenshtein(a.as_bytes(), b.as_bytes()))
}
#[pymodule]
fn pyrustbio(_py: Pyth... |
package com.j0rsa.cracker.tracker.service
import arrow.core.Either
import arrow.core.Right
import arrow.core.Left
import com.j0rsa.cracker.tracker.NotFound
import com.j0rsa.cracker.tracker.TrackerError
import com.j0rsa.cracker.tracker.handler.TagRow
import com.j0rsa.cracker.tracker.model.*
import com.j0rsa.cracker.tra... |
<?php
namespace App\Http\Controllers\Front\Blog;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Admin\WebsiteInfo;
class BlogController extends Controller
{
public function index(){
$model = new WebsiteInfo();
$model_data = $model->wherepermalink('blog')->wherestatus('0'... |
class CreatePalettes < ActiveRecord::Migration
def change
create_table :palettes do |t|
t.string :palette_name
t.string :color1
t.string :color2
t.string :color3
t.string :color4
t.string :color5
t.timestamps null: false
end
end
end
|
var expect = require('chai').expect;
var sinon = require('sinon');
module.exports = function(Bookshelf) {
describe('Model Registry', function() {
before(function() {
this._relation = sinon.spy(Bookshelf.Model.prototype, '_relation');
this.morphTo = sinon.spy(Bookshelf.Model.prototype, 'morphTo');
});
... |
// IGNORE_BACKEND: JS_IR
// EXPECTED_REACHABLE_NODES: 1110
package foo
fun box(): String {
var b: Byte = 0x7F
b++
if (b.toInt() != -0x80) return "fail1a: $b"
b--
if (b.toInt() != 0x7F) return "fail1b: $b"
var s: Short = 0x7FFF
s++
if (s.toInt() != -0x8000) return "fail2a: $s"
s--
... |
docker_id="openmcp"
imagename="keti-coap-generator"
version="v1.1"
# make image
docker build -t $docker_id/$imagename:$version . && \
# push image
docker push $docker_id/$imagename:$version
|
part of 'images_bloc.dart';
abstract class ImagesState extends Equatable {
final String query;
const ImagesState(this.query);
}
class ImagesInitial extends ImagesState {
const ImagesInitial() : super("");
@override
List<Object> get props => [];
}
class ImagesLoading extends ImagesState {
const ImagesLo... |
package org.bouncycastle.cavp.test;
public interface DigestProcessor
{
void update(byte[] msg);
byte[] digest();
}
|
#!/usr/bin/env python3
from typing import List, Tuple
import re
import sys
from PIL import Image
import hashlib
in_image_dir = sys.argv[1]
out_image_dir = sys.argv[2]
parse_ocr_re = re.compile(r'^([^:]+):(\d+),(\d+),(\d+),(\d+):(.*)$')
page_limit = 24
def unquote(t):
return t.replace('_', ' ')
def clean(t):... |
define(["require", "exports", "SeedModules.AngularUI/modules/boot"], function (require, exports, boot) {
"use strict";
exports.__esModule = true;
var settings = JSON.parse(document.getElementById('seed-ui').getAttribute('data-site'));
var ngTableDefaults = {
options: {},
schema: {},
... |
package org.devshred.tracks.waypoints
import org.devshred.tracks.utils.getCoordinatesFromGoogleMapsLink
import org.devshred.tracks.waypoints.PoiType.FOOD
open class Buffet(coordinates: Coordinates) : CustomPointOfInterest(coordinates, name = "Buffet", type = FOOD) {
companion object {
fun fromRow(row: Lis... |
package path
import "testing"
var PrefixPairs = []struct {
A string
B string
}{
{"", ""},
{"foo", ""},
{"", "foo"},
{"foobar", "foobar"},
{"abcd", "abef"},
}
func BenchmarkCompareAfterPrefix(b *testing.B) {
for i := 0; i < b.N; i++ {
for _, pair := range PrefixPairs {
CompareAfterPrefix(pair.A, pair.B)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.