text
stringlengths
27
775k
module Controller.GUIStateSync ( updateGUIStateWidgets ) where import Control.Lens hiding (index) import Control.Monad import Graphics.UI.Gtk hiding (set) import qualified Graphics.UI.Gtk as Gtk (set) import ...
package dsx.bps.crypto.xrp.datamodel import com.google.gson.annotations.SerializedName data class XrpLedger( val closed: Boolean, val transactions: List<XrpTx>? = null, @SerializedName("ledger_hash") val hash: String, @SerializedName("ledger_index") val index: Long, @SerializedName("parent...
package uniruse.mse.examregistration.user.model; public enum UserRole { STUDENT, PROFESSOR, ADMIN }
- Remove `Timestamp` API that depended on the `chrono` crate: ([#1665](https://github.com/informalsystems/ibc-rs/pull/1665)): - `Timestamp::from_datetime`; use `From<tendermint::Time>` - `Timestamp::as_datetime`, superseded by `Timestamp::into_datetime`
module WeakParameters class FileValidator < WeakParameters::BaseValidator private VALID_TYPES = [ StringIO, IO, Rack::Test::UploadedFile, ] def valid_type? VALID_TYPES.any? {|type| value.is_a?(type) } end def error_message "params[#{key.inspect}] must be a vali...
extern crate bindgen; use std::env; use std::io::Write; use std::path::PathBuf; #[cfg(not(target_os="windows"))] fn default_include_dir(_: env::VarError) -> String { "/usr/include".to_owned() } #[cfg(not(target_os="windows"))] fn default_library_dir(_: env::VarError) -> String { "/usr/lib".to_owned() } #[cf...
#!/bin/bash export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/root/xbinst_oem/runtime/platforms/xilinx_vu9p_faas_f3/driver export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib64 ./app $*
<?php #****************************************# # * @Author: lehieu008 # # * @Email: lehieu008@gmail.com # # * @Website: http://www.iscvietnam.net # # * @Copyright: 2008 - 2009 # #****************************************# if(!defined('BASEPATH'))exit('No direct script access al...
#!/bin/bash btr_path="$1" btrfs filesystem df "$btr_path"
class A { } class B { def main() { var s: String = new A() } } object Main { def main(args: Array[String]) { } }
#include "solution.hpp" static auto x = []() { // turn off sync std::ios::sync_with_stdio(false); // untie in/out streams cin.tie(NULL); return 0; }(); struct compare { bool operator()(const ListNode* l, const ListNode* r) { return l->val > r->val; } }; ListNode* Solution::mergeK...
# dm_Challege_基于移动网络通讯行为的风险用户识别 基于移动网络通讯行为的风险用户识别 线上0.853577 线下0.870+ 排名30
var elixir = require('laravel-elixir'); /* |-------------------------------------------------------------------------- | Elixir Asset Management |-------------------------------------------------------------------------- | | Elixir provides a clean, fluent API for defining some basic Gulp tasks | for your Larave...
import {createSpecBuilderClass, createConnectionBuilderClass, createUnionBuilderClass} from './base'; import {nextID} from '../id-sequence'; import {RepositoryBuilder} from './repository'; import {UserBuilder} from './user'; import {ReactionGroupBuilder} from './reaction-group'; import { CommitBuilder, CommitComme...
require "test_helper" class VdspDoubleTest < Minitest::Test def test_copy # c[i] = a[i] a = Vdsp::DoubleArray.create([1.0, 2.0, 3.0]) c1 = Vdsp::DoubleArray.new(3) c2 = Vdsp::DoubleArray.new(3) Vdsp::UnsafeDouble::copy(a, 0, 1, c1, 0, 1, a.length) Vdsp::UnsafeDouble::copy(a, 0, 2, c2, 0, 2, 2...
using System.Drawing; using System.Windows.Forms; using System.ComponentModel; namespace BizHawk.Client.EmuHawk { public class MenuButton : Button { [DefaultValue(null)] public ContextMenuStrip Menu { get; set; } protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); ...
;title Display ASCII binary (DISPBIN.ASM) ; This program displays a binary number entered from ; the keyboard as an ASCII character ;--------------------------------------------------------------------------- .model small .stack 100h .data msg1 db 'Enter a one-byte binary number',13,10,'$' msg2 db 1...
// Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 use crate::constants; use libra_secure_time::{RealTimeService, TimeService}; use libra_types::{ account_address::AccountAddress, chain_id::ChainId, transaction::{RawTransaction, Script}, }; /// Builds a `RawTransaction` to...
TRUNCATE `trivia_dev`.`games_options`; UPDATE `trivia_dev`.`stats` SET cant_total_questions=0, cant_correct_questions=0, cant_incorrect_questions=0, cant_unknown_questions=0 WHERE id>0;
#define xASM(x) __asm(x) #if 0 #undef get_current_fp_reg #define get_current_fp_reg(fp_reg) xASM("mov %[fp_reg], fp" : [fp_reg] "=r"(fp_reg) :); #endif
# frozen_string_literal: true module ActiveAny class Relation module FinderMethods def find_by(condition) where(condition).take end def first(limit = nil) if loaded limit ? records.first(limit) : records.first else limit ? spawn.records.first(limit) ...
using System.IO; using System.Text; using System.Text.Json; using System.Threading; using System.Threading.Tasks; using LiteDB; using StrawberryShake.Internal; using StrawberryShake.Persistence.LiteDB; using Xunit; namespace StrawberryShake.Persistence.SQLLite { public class LiteDBPersistenceTests { /...
export { BucketResolver } from './storage.bucket' export { StorageJobResolver } from './storage.job' export { ObjectResolver } from './storage.object'
<?php use Illuminate\Http\Request; use Telegram\Bot\Laravel\Facades\Telegram; use Telegram\Bot\Api; use GuzzleHttp\Client as GuzzleClient; use Psr\Http\Message\ResponseInterface; use \Illuminate\Support\Facades\Cache; use \Illuminate\Support\Facades\DB; /* |-------------------------------------------------------------...
DST=lyyang@lsasd2.ls.bnl.gov:/home/www scp djangosite/lattice/* $DST/lattice/ scp templates/lattice/* $DST/templates/lattice/
#pragma warning disable CS1591 using System.Collections.Generic; using Tortuga.Graphics.API; using System.Threading; using Vulkan; using Tortuga.Utils; using System; namespace Tortuga.Graphics { public enum CommandType { Primary, Secondary } public class CommandBufferService { ...
#!/bin/sh set -eu for dir in "$HOME"/.var/app/*; do mkdir -p \ "$dir/config" \ "$dir/local/share/themes" ! [ -d "$dir/config/fontconfig" ] && \ cp -al "$HOME/.config/fontconfig" "$dir/config/fontconfig" ! [ -f "$dir/config/gtkrc-2.0" ] && \ cp -al "$HOME/.config/gtkrc-2.0" "$dir/co...
module Tintin.Capabilities.Process ( Process , Capability , CommandName(..) , Arguments(..) , StdOut(..) , StdErr(..) , local , read , call ) where import Tintin.Core hiding (stdout, stderr, local) import Tintin.Capabilities import System.Exit (ExitCode(..)) data Process newtype CommandName = ...
import * as React from "react"; import FlipToggle from "./FlipToggle"; export interface Props { value: boolean; onToggle: any; } export interface State {} class Switch extends React.Component<Props, State> { render() { return ( <FlipToggle value={this.props.value} sliderWidth={20} ...
#ifndef __POINTATTRIBUTES_H__ #define __POINTATTRIBUTES_H__ #include <QVector3D> #include <QVector4D> #include <QtGlobal> #include <algorithm> #include <vector> #include "octree.h" class PointAttributes { private: std::vector<std::vector<float> > _attr; std::vector<quint64> _attr_size; std::vector<quint64> _att...
import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import Pokeball from '../pokeball.png'; import { connect } from 'react-redux'; class Home extends Component { render() { const { posts } = this.props; const postList = posts.length ? ( posts.map(post => { retur...
package main import ( "fmt" . "github.com/dravinbox/json2GoStruct/controller" "github.com/kataras/iris" "github.com/kataras/iris/context" flag "github.com/spf13/pflag" "io/ioutil" ) var ( web bool name string file string ) func main() { flag.BoolVarP(&web, "web", "w", false, "start web interface") flag.S...
import dev.programadorthi.dependencies.Dependencies plugins { id("com.android.application") id("kotlin-android") id("super-module") } android { defaultConfig { buildConfigField("String", "BASE_URL", "\"https://api.chucknorris.io/jokes/\"") buildConfigField("String", "DATABASE_NAME", "\...
#include <iostream> using std::cout, std::endl; template <typename T> T max(T value1, T value2) { return value1 > value2 ? value1 : value2; } int main() { int a{1}; int b{4}; cout << "max = " << max<int>(a, b) << endl; float c{2.4f}; float d{4.5f}; cout << "max = " << max<float>(c, d) <<...
#!/usr/bin/env python from resource_management.libraries.script import Script from resource_management.libraries.functions import default import os config = Script.get_config() nginx_user = config['configurations']['nginx-env']['nginx_user'] log_dir = config['configurations']['nginx-env']['nginx_log_dir'] pid_dir = ...
package main import ( "bytes" "compress/gzip" "crypto/rand" "encoding/gob" "errors" "fmt" "io" "io/ioutil" "os" "path/filepath" v1 "github.com/decred/politeia/tlog/api/v1" "github.com/google/uuid" "golang.org/x/crypto/nacl/secretbox" ) func blobify(re v1.RecordEntry) ([]byte, error) { var b bytes.Buffe...
// package enum provides an API for manipulating enumerations. package enum // Enum is a generic contract for all generated enums. type Enum interface { Ordinal() int String() string Tag() string IsValid() bool } // IntEnum is a specialisation for those enums that have int or similar as the underlying type. type ...
# IGTI-Python Bootcamp Desenvolvedor Python<br> Esses são os códigos desenvolvidos durante o bootcamp, do básico ao avançado.
package org.vulkanb.eng.graph.vk; import org.lwjgl.PointerBuffer; import org.lwjgl.system.MemoryStack; import org.lwjgl.util.vma.VmaAllocationCreateInfo; import org.lwjgl.vulkan.VkBufferCreateInfo; import java.nio.LongBuffer; import static org.lwjgl.system.MemoryUtil.NULL; import static org.lwjgl.util.vma.Vma.*; imp...
import MyHeader from '@/components/Header' export default { title: 'Example/Header', component: MyHeader } const Template = (args, { argTypes }) => ({ props: Object.keys(argTypes), components: { MyHeader }, template: '<my-header :user="user" @onLogin="onLogin" @onLogout="onLogout" @onCreateAccount="onCr...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Mtblib.Tools; using Mtblib.Graph.Component; using Mtblib.Graph.Component.DataView; namespace Mtblib.Graph.CategoricalChart { public class CMean: DataView { public CMean() {...
# !/bin/bash #Capture user information #Use read and echo option=0 name="" echo -n "Inser user option: " read option=$REPLY echo -n "Insert user name: " read name=$REPLY echo "Option: $option name: $name"
require 'cal/monthly_calendar' module Cal def self.new_monthly_calendar(*args) MonthlyCalendar.new *args end end
# frozen_string_literal: true require_relative './protocol' module DigitalFabric class RequestAdapter def initialize(agent, msg) @agent = agent @id = msg[Protocol::Attribute::ID] end def protocol 'df' end def get_body_chunk(request) @agent.get_http_request_body(@id, 1) ...
// Copyright 2016, the Dart project authors. // // 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 applicable law o...
#!/bin/bash set -e set -x wget -O src/test/resources/air.csv https://www.data.act.gov.au/api/views/94a5-zqnn/rows.csv?accessType=DOWNLOAD git commit -am "update air.csv" git push
import 'package:flutter/material.dart'; import 'package:toa_flutter/models/event.dart'; import 'package:toa_flutter/models/match.dart'; import 'package:toa_flutter/sort.dart'; import 'package:toa_flutter/providers/api.dart'; import 'package:toa_flutter/ui/widgets/match-list-item.dart'; import 'package:toa_flutter/ui/wi...
# encoding: utf-8 ### # to run use # ruby -I ./lib -I ./test test/test_commata.rb require 'helper' class TestCommata < MiniTest::Test def test_commata sample1, exp1 = TestBlockFile.read_utf8( 'commata1' ) sample2a, exp2a = TestBlockFile.read_utf8( 'commata2a' ) sample2b, ex...
(in-package :mjgame) ;; Minor thingy since cl-sdl2 doesn't seem to expose it, ;; probably not very important. ;; type should be a keyword (defun show-simple-message-box (type title message &optional (window nil)) (let ((message-type (case type (:error #x10) (:warning #x20) ...
#include <stdio.h> #include <stdbool.h> void swap(int *a, int *b){ int temp = *a; *a = *b; *b = temp; } void display(int arr[], int size){ for(int i=0; i<size; i++){ printf("%d ", arr[i]); } } void bubble(int arr[], int size){ bool swapped = false; for(int iteration=0; iteration<size...
package lib import com.gu.mediaservice.model.usage.{PendingUsageStatus, PublishedUsageStatus} import model._ import rx.lang.scala.Observable class UsageStream(usageGroup: UsageGroupOps) { val previewContentStream: Observable[ContentContainer] = PreviewCrierContentStream.observable val liveContentStream: Observab...
# -*- encoding : utf-8 -*- require 'rails_helper' describe Levels, "#move_up" do before :each do @level = create_level end describe "security filters" do describe "when any other user attempts to move a level up" do before :each do @user = create_user end it "raises Unauthoriz...
using System.Collections.Generic; namespace Plainion.WhiteBoard.Designer { public class ItemPropertyCollection : List<ItemProperty> { public ItemPropertyCollection() { } public ItemPropertyCollection( IEnumerable<ItemProperty> collection ) { Add...
require 'byebug' if RUBY_ENGINE != 'rbx' module Aatc class ReleaseCommand class GitError < StandardError end include Common def help_open(_args) puts "`aatc open [release-name] [*apps]`" puts "Opens a new release with the given release name, on the" puts "given apps. All trailing ...
// +build ide test_unit package resource_test import ( "github.com/akaspin/soil/agent/allocation" "github.com/akaspin/soil/agent/resource" "github.com/akaspin/soil/manifest" "github.com/stretchr/testify/assert" "testing" ) func TestPlan(t *testing.T) { left := allocation.ResourceSlice{ { Request: manifest...
DROP TABLE IF EXISTS voucher_hist; CREATE TABLE voucher_hist ( id IDENTITY PRIMARY KEY, phone_num VARCHAR (15) NOT NULL, voucher_cd VARCHAR (20), voucher_typ VARCHAR (20) NOT NULL , received_by VARCHAR (5), creat_by VARCHAR (20), updt_by VARCHAR (20), creat_dt DATE, updt_dt DATE );
defop eval ; the ToS pop ebx pop eax push ebx jmp [eax+dict_entry_code] defop doop ; the entry in eax push eval_ip mov eval_ip, [eax+dict_entry_data] jmp [d_next+dict_entry_code] defop next mov eax, [eval_ip] add eval_ip, ptrsize call [eax+dict_entry_code] jmp [d_next+dict_entry_code]
Check whether the given string is a subsequence of the plaintext alphabet. Example - For `s = "effg"` or `s = "cdce"`, the output should be `alphabetSubsequence(s) = false`; - For `s = "ace"` or `s = "bxz"`, the output should be `alphabetSubsequence(s) = true`. Input/Output - **[executio...
# Write your MySQL query statement below SELECT   A.PLAYER_ID, A.EVENT_DATE, SUM(b.games_played) AS games_played_so_far FROM   ACTIVITY A INNER JOIN   ACTIVITY B ON   A.PLAYER_ID = B.PLAYER_ID AND   A.EVENT_DATE >= B.EVENT_DATE GROUP BY 1, 2
// coverage:ignore-file /// A base class for [Exception]s that can be thrown when committing a /// transaction. abstract class TransactionException implements Exception { /// The id of the dataset for which the transaction failed. final String id; /// The error message of this exception. final String message;...
# frozen_string_literal: true require 'rails_helper' RSpec.feature 'Course: Lesson Plan Milestones' do let!(:instance) { Instance.default } with_tenant(:instance) do let!(:course) { create(:course) } let(:milestones) do [2.days.ago, 2.days.from_now].map do |start_at| create(:course_lesson_pl...
--- author: charlesg comments: true date: 2011-05-15 17:40:06+00:00 layout: post slug: the-tesla-coil-returns title: The Tesla Coil Returns wordpress_id: 540 categories: - Electrical - Projects --- tesurakoiru?
package actions import ( "encoding/json" "errors" "fmt" "log" "strings" "sync" ) // Interface for the ActionUtil type ActionUtilsInt interface { AddAction(str string) error GetStats() string } // A wrapper struct for the action utils type ActionUtil struct { } //json hints helps while de-serialization type ...
#pragma once #include <QString> #include <functional> #include "messages/Image.hpp" #include "messages/Link.hpp" namespace chatterino { class LinkResolver { public: static void getLinkInfo( const QString url, QObject *caller, std::function<void(QString, Link, ImagePtr)> callback); }; } // name...
class Injection < ActiveRecord::Base has_many :regimen def batch self.regimen.inject({}) do |rp, reg| if rp[reg.batch_no].nil? rp[reg.batch_no] = [reg] else rp[reg.batch_no] << reg end rp end end end
using System; using System.Threading; using System.Threading.Tasks; using Core.Aggregates; namespace Core.Storage { public interface IRepository<T> where T : IAggregate { Task<T> Find(Guid id, CancellationToken cancellationToken); Task Add(T aggregate, CancellationToken cancellationToken); ...
using Abp.Application.Services.Dto; using Abp.Runtime.Validation; using TakTikan.Tailor.Common; namespace TakTikan.Tailor.Authorization.Users.Delegation.Dto { public class GetUserDelegationsInput : IPagedResultRequest, ISortedResultRequest, IShouldNormalize { public int MaxResultCount { get; set; } ...
# CCTalk Rust library implementing the CCTalk protocol to handle payment devices. See examples for more information: * [Simple host](examples/cctalk-host) to communicate with client devices * Coin Acceptor device implementation (see [example](examples/coinacceptor)) This project is inactive and looking for maintaine...
namespace Blackwood.Services.Settings; public class AuthSettings { public string JWTSecret { get; set; } public string JWTIssuer { get; set; } public string JWTAudience { get; set; } public int JWTTimeToLive { get; set; } public int RefreshTokenTimeToLive { get; set; } }
<?php namespace Tests\Collection; use PHPUnit\Framework\TestCase; /** * ArrayKeyNotExistsExceptionTest Test Case * * Testing \Exceptions\Collection\ArrayKeyNotExistsException * * @package Tests\Collection * * @author Jason Napolitano <https://github.com/jason-napolitano> * @version 0.0.3 * @since 0.0.1 ...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: umbra.proto require 'google/protobuf' Google::Protobuf::DescriptorPool.generated_pool.build do add_file("umbra.proto", :syntax => :proto3) do add_message "umbra.pb.Message" do optional :method, :string, 1 optional :url, :string, 2 ...
# 实验1,运行demo ## 运行结果 ![Imgur](https://i.imgur.com/GAgbU4h.png) ## 参考资料 - https://github.com/stretchr/testify#assert-package
<?php /** * TJuiControlAdapter class file. * * @author Fabio Bas <ctrlaltca@gmail.com> * @link https://github.com/pradosoft/prado * @license https://github.com/pradosoft/prado/blob/master/LICENSE * @package Prado\Web\UI\JuiControls */ namespace Prado\Web\UI\JuiControls; /** * IJuiOptions interface * * IJuiO...
package middleware import ( "bytes" "compress/gzip" "net/http" "net/http/httptest" "testing" "time" "github.com/danjac/podbaby/api/Godeps/_workspace/src/github.com/labstack/echo" "github.com/stretchr/testify/assert" ) type closeNotifyingRecorder struct { *httptest.ResponseRecorder closed chan bool } func ...
#!/bin/zsh # init.zsh: # This file is called only once # It is desirable that the ZPLUG_ROOT and the ZPLUG_HOME is the same # because zplug should be installed with git clone URL /path/to/local_dir # e.g. ~/.zplug typeset -gx ZPLUG_ROOT="${${(%):-%N}:A:h}" # Unique array typeset -gx -U path typeset -gx -U fpath # ...
'use strict'; const path = require('path'); const writeJSON = require('write-json-file'); const loadJSON = require('load-json-file'); const readPkgUp = require('read-pkg-up'); const isCssColorHex = require('is-css-color-hex'); const isCssColorName = require('is-css-color-name'); const decamelizeKeys = require('decamel...
package fra.wardrobe class WardrobeFactory { companion object { fun getPossibleCombos(elements: ArrayList<Int>, wallLength: Int): ArrayList<ArrayList<Int>> { elements.sort() val combo: ArrayList<Int> = arrayListOf() val result: ArrayList<ArrayList<Int>> = arrayListOf(...
package com.github.cetonek.bigbiznis.application.utility.model data class OverviewAndGraph(val overview: List<Triple<*, *, *>>, val graph: List<Pair<*, *>>)
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Telligent.Evolution.Extensibility.Version1; using Telligent.Evolution.Extensibility.UI.Version1; namespace Telligent.BigSocial.Polling.Plugins { public class PollAnswerWidgetExtension : IPlugin, IScriptedContentFragm...
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; /** * Class Area */ class Area extends Model { protected $table = 'area'; protected $primaryKey = 'fix_id'; public $timestamps = true; protected $fillable = [ 'fix_id', 'view_id', 'area_name', 'area_...
import 'dart:async'; import 'package:amazing_combination/controllers/BrandController.dart'; import 'package:amazing_combination/models/Brand.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_webservic...
import { BaseEntity } from 'typeorm'; export declare class Comment extends BaseEntity { id: string; comment: string; commentBy?: string; user: string; createdAt: Date; updatedAt: Date; deletedAt: Date; }
// "Remove 'out' variance from 'T'" "true" // WITH_RUNTIME class Test<out T> { fun foo(t: <caret>T) {} fun bar(): T = TODO() }
/** 统一类名前缀 */ export const CLS_PREFIX = 'RSV'; /** 默认折叠尺寸 */ export const DEFAULT_COLLAPSE_PX = 24;
import axios from 'axios'; import router from 'vue-router' import Cookies from 'js-cookie' import {MessageBox} from 'element-ui'; //export const test = 'http://127.0.0.1:8092'; export const test = 'http://106.53.246.180:8092'; export const requestLogout = params => { return axios.get(`${test}/api/user/logout`, params)...
#ifdef LATTICE #include "/lpc_incl.h" #else #include "../lpc_incl.h" #endif // Copy from mapping.c to do mapping building INLINE_STATIC svalue_t *insert_in_mapping (mapping_t * m, char * key) { svalue_t lv; svalue_t *ret; lv.type = T_STRING; lv.subtype = STRING_CONSTANT; lv.u.string = key; re...
export PYTHONPATH=$PYTHONPATH:.. export PYTHONPATH=$PYTHONPATH:../NNSlicing STRATEGY=random # VICTIM=models/victim/tf_resnet10cifar10 VICTIM=resnet10cifar10 BUDGET=50000 ADVDIR=$VICTIM # ADVDIR=test export PYTHONPATH=$PYTHONPATH:.. CUDA_VISIBLE_DEVICES=1 \ python knockoff/adversary/transfer.py \ $STRATEGY \ $VICTIM...
<?php declare(strict_types=1); namespace Webthink\GuzzleJwt\Test\Unit\Token; use PHPUnit\Framework\TestCase; use Webthink\GuzzleJwt\Token\TimeoutToken; final class TimeoutTokenUnitTest extends TestCase { public function testCreateInvalidTimeoutTokenThrowsInvalidArgumentException() { $this->expectExc...
struct QualifiedError<E>(E); impl<E, T> From<E> for QualifiedError<T> where E: std::error::Error, T: From<E>, { fn from(e: E) -> QualifiedError<T> { QualifiedError(e.into()) } } fn infallible() -> Result<(), std::convert::Infallible> { Ok(()) } fn main() { let x = || -> Result<_, Qual...
// Package protein translates RNA sequences into proteins. package protein import ( "errors" ) var ( STOP = errors.New("stop") ErrInvalidBase = errors.New("invalid base") ) // IsStopCodon checks whether a codon is a stop codon. func IsStopCodon(c string) bool { return c == "UAA" || c == "UAG" || c == "...
#!/bin/sh #SBATCH --qos gpu_access # quality of service #SBATCH --gres=gpu:1 # I want one gpus #SBATCH --partition=gpu # partition to run on #SBATCH --nodes=1 # run on one node #SBATCH --time=11-00:00 # time (D-H...
use js_sys::Int32Array; use num_traits::zero; use num_traits::Num; use js_sys::Uint32Array; use crate::shape::*; use crate::tensor::*; impl<DType> Tensor<DType> where DType: Copy, DType: Num, { pub fn _reshape(&self, shape: &Vec<usize>) -> Tensor<DType> { let strides = compute_strides(shape); ...
import * as PIXI from 'pixi.js'; import { RenderMeshDTO, MeshesData, RenderMeshData, UpdateMeshData, UpdateMeshDTO, } from '@render/interfaces'; import { getMassCenter } from '@utils/math'; import app from '@render/app'; import { hexToRGB } from '@utils/parsers'; import getRandomColor from '@/utils/render/ge...
function Initialize-DevWorkspaceRoot([string]$rootDirectoryPath) { if (-NOT (Test-Path $rootDirectoryPath)) { New-Item $rootDirectoryPath -ItemType Directory } } function Get-SwellabyGitHubRepos([bool]$cloneSwellabyRepos, [string]$rootDirectoryPath) { if ($cloneSwellabyRepos) { Init...
using System; using System.Threading.Tasks; using Prism.Commands; using Prism.Mvvm; using Prism.Navigation; using Prism.Services; namespace PrismSample.ViewModels { public class MainPageViewModel : BindableBase, IInitialize, IConfirmNavigation, INavigationAware { private INavigationService _navigation...
#include <string> using namespace std; typedef unsigned int uint; class MatrixException{ public: string desc; public: MatrixException(string description) : desc(description){} }; template <class T, typename sizetype> class Matrix { sizetype x, y; T *arr; public: Matrix(sizetype px, sizetype py) : x(p...
# # optparse.rb - command-line option analysis with the OptionParser class. # # Author:: Nobu Nakada # Documentation:: Nobu Nakada and Gavin Sinclair. # # See OptionParser for documentation. # # == Developer Documentation (not for RDoc output) # # === Class tree # # - OptionParser:: front end # - OptionParser::Sw...
class ProductMigration def self.export_references(language = 'Java') top_10 = Product.where(:language => language).desc(:used_by_count).limit(10) top_10.each do |top_1| lines = Array.new response = Dependency.references language, top_1.prod_key, 0 total_entries = response[:count] pa...
require 'fog/joyent/models/analytics/metric' module Fog module Joyent class Analytics class Metrics < Fog::Collection model Fog::Joyent::Analytics::Metric def all data = service.describe_analytics.body['metrics'] load(data) end end end end end
/* Audio Template * * From: https://github.com/PokemonAutomation/Arduino-Source * */ #ifndef PokemonAutomation_AudioPipeline_AudioTemplate_H #define PokemonAutomation_AudioPipeline_AudioTemplate_H #include <cstddef> #include <vector> #include <QString> #include "Common/Cpp/AlignedVector.h" namesp...