text stringlengths 27 775k |
|---|
import "./style.css";
const canvas = document.getElementById("canvas");
const ctx = canvas.getContext("2d");
canvas.width = 1024;
canvas.height = 512;
let leniency = 5;
const cloudImage = document.querySelector("#cloud");
const birdImage = document.querySelector("#bird");
const instructions = {
start: "Press <span... |
/**
* Class to model your SIOP request
*/
import ITestModel from './ITestModel';
import { ClaimToken } from '../../lib';
export default class RequestAttestationsOneSelfAssertedResponseOk implements ITestModel {
public clientId = 'https://requestor.example.com';
/**
* Define the model for the request
... |
use mysql;
select host, user from user;
-- 因为mysql版本是5.7,因此新建用户为如下命令:
create user IF NOT EXISTS huser identified by 'NcUE4mtaJRQr96sR';
-- 将hmpay数据库的权限授权给创建的huser用户,密码为NcUE4mtaJRQr96sR:
grant all on hmpay.* to huser@'%' identified by 'NcUE4mtaJRQr96sR' with grant option;
-- 这一条命令一定要有:
flush privileges; |
# epitech-emacs
Official Emacs configuration for Epitech students.
## Installation
- For local installation, run `./INSTALL.sh local`.
- For system-wide installation, run `sudo ./INSTALL.sh system` |
nodemcu-devkit
==============
This is history.
New board is NodeMCU-DEVKIT-V1.0, see also https://github.com/nodemcu/nodemcu-devkit-v1.0
A development kit for NodeMCU firmware.
It will make NodeMCU more easy. With a micro USB cable, you can connect NodeMCU devkit to your laptop and flash it without any trouble, jus... |
package fr.xgouchet.musichelper.ui.view;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.drawa... |
package bsttraversal
type BST struct {
Value int
Left *BST
Right *BST
}
func (tree *BST) InOrderTraverse(array []int) []int {
// Write your code here.
if tree == nil {
return array
}
left := tree.Left
if left != nil {
array = left.InOrderTraverse(array)
}
array = append(array, tree.Value)
right := tr... |
package tech.hostlematedevelopers.hostelmate.adapter
import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.LinearLayout
import an... |
const fs = require('fs');
const https = require('https');
const zlib = require('zlib');
const tar = require('tar');
const path = require('path');
const { getLicense, getSelectedDbs } = require('../utils');
let licenseKey;
try {
licenseKey = getLicense();
} catch (e) {
console.error('geolite2: Error retrieving Maxm... |
package ibb
import (
"context"
"encoding/json"
"github.com/ycd/ibb/pkg/resources"
)
// DamOccupancy contains information on the daily and annual
// changes of the occupancy rates of dams in Istanbul.
// https://data.ibb.gov.tr/en/dataset/istanbul-baraj-doluluk-oranlari-verisi
type DamOccupancy struct {
damOccupa... |
/*
* Copyright 2021 HM Revenue & Customs
*
* 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 or a... |
#!/usr/bin/env python3
import sys
import re
def case_print(f, c, s):
f.write('\tcase {}:\n'.format(c))
f.write('\t\treturn "{}";\n'.format(s))
info = {
'fmt': r'^#define (\w+)\s*(?:\\$\s*)?fourcc_code',
'basic_pre': r'^#define (I915_FORMAT_MOD_\w+)\b',
'basic_post': r'^#define (DRM_FORMAT_MOD_(?:INVALID|LINEAR|... |
# DCC605 File System Shell (DCC-FSSHELL).
1. Pode ser feito em dupla
1. Domingo Depois da Terceira Prova
Neste trabalho você vai implementar um shell para o sistema ext2. Para
realizar seu TP recomendo um bom entendimento do
[Fast File System](http://pages.cs.wisc.edu/~remzi/OSTEP/file-ffs.pdf). O mesmo
é a base do ... |
-- With prelude
range :: Int -> Int -> [Int]
range s e = [s..e]
-- With list recursion
range' :: Int -> Int -> [Int]
range' s e
| s > e = []
| otherwise = s : range' (s+1) e
|
#!/bin/bash
$SPARK_HOME/bin/spark-submit \
--class "preprocessingUtils.main" \
--master local[4] \
target/scala-2.10/preprocess-assembly-0.3.jar \
--outdir="../data/dogs_vs_cats/" \
--saveToHDFS=false \
--nPartitions=4 \
--dataFormat=text \
--sparse=false \
--textDataFormat=spaces \
--separateTrainTestFiles=false \
--... |
/*
Copyright 2019 The Kubernetes 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 or agreed to in writing, ... |
from __future__ import absolute_import
from todo.commands.toggle import ToggleCommand
class UncheckCommand(ToggleCommand):
def check_by_item(self, item):
item_toggled = item.copy()
item_toggled['done'] = False
return item_toggled
Uncheck = UncheckCommand()
|
<?php
/**
* Created by PhpStorm.
* User: Jozef Môstka
* Date: 29.5.2016
* Time: 9:54
*/
namespace testMagicMethods{
/**
* @property string test
* @method testCall($test)
*/
class Foo{
public $_test;
public function __construct($test) {
$this->_test=$test;
}
public function tetsFunc(){
retur... |
class Module
unless method_defined?(:__name__)
alias_method :__name__, :name
end
if method_defined?(:singleton_class?)
alias_method :__singleton_class__?, :singleton_class?
else
def __singleton_class__?
self != Class && ancestors.first != self
end
end
unless method_defined?(:__single... |
// Invoke 'strict' JavaScript mode
'use strict';
// Create the 'chat' module
angular.module('chat', []); |
import type { Vtt } from '../types'
// Taken from: https://stackoverflow.com/a/42761393
export function paginator(array: Vtt[], pageNumber: number, pageSize: number) {
// human-readable page numbers usually start with 1, so we reduce 1 in the first argument
return array.slice((pageNumber - 1) * pageSize, pageNumbe... |
/*
* 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 or agreed to in writing,
* software distributed... |
package testutils
import (
"fmt"
"net"
"sync"
"time"
"github.com/eclipse/paho.mqtt.golang/packets"
"github.com/superscale/spire/mqtt"
)
// Pipe ...
func Pipe() (*mqtt.Session, *mqtt.Session) {
a, b := net.Pipe()
t := time.Second * 1
return mqtt.NewSession(a, t), mqtt.NewSession(b, t)
}
// PubSubRecorder ..... |
namespace Extractor.WpfClient.Exporters
{
using System;
using System.Collections.Generic;
using Extractor.WpfClient.Contracts;
using System.IO;
public class TxtExporter : IExporter
{
public void Export<T>(
ICollection<T> fileInformations,
string folderToExportT... |
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System.Collections.Generic;
using Microsoft.Azure.Functions.Worker.Sdk;
using Xunit;
namespace Microsoft.Azure.Functions.SdkTests
{
public class ExtensionsC... |
require 'package'
class V2ray < Package
description 'A platform for building proxies to bypass network restrictions.'
homepage 'https://www.v2ray.com/'
version '{{VERSION}}'
case ARCH
when 'aarch64', 'armv7l'
source_url 'https://github.com/v2ray/v2ray-core/releases/download/{{VERSION}}/v2ray-linux-arm.z... |
use crate::components::{BlocksTile, CombatStats, Monster, Name, Position, Renderable, Viewshed};
use crate::config;
use rltk::{RandomNumberGenerator, RGB};
use specs::prelude::*;
pub fn random(ecs: &mut World, start: Position, cfg: &config::Monsters) {
let roll: i32;
{
let mut rng = ecs.write_resource:... |
package spatial.codegen.resourcegen
import scala.collection.mutable
import argon._
import argon.codegen.FileDependencies
import spatial.codegen.naming._
import argon.node._
import spatial.lang._
import spatial.node._
import spatial.metadata.access._
import spatial.metadata.control._
import spatial.metadata.memory._
i... |
package net.wuillemin.jds.common.exception
/**
* An exception that should be thrown when an authentication (would it be an initial authentication, a refresh or
* whatever related to authentication) is rejected.
*
* @param code The code of the exception
* @param args The arguments of the exceptions
*/
class Authe... |
package com.platform.dao;
import com.platform.entity.FootprintVo;
import java.util.List;
import java.util.Map;
/**
* @author lipengjun
* @email 939961241@qq.com
* @date 2017-08-11 09:14:26
*/
public interface ApiFootprintMapper extends BaseDao<FootprintVo> {
int deleteByParam(Map<String, Object> map);
L... |
# osgQt
A simple wrapper around OpenSceneGraph for Qt5
Warning
=======
At time of writing this code does not works with osg 3.6.4-rc3.
Note
--------
The provided Qt project file has include and library paths specific to my local setup.
This should be adjusted for your location of the osg library.
Tested with 32-bit ... |
#!/usr/bin/env bash
_=$(git rev-parse --show-toplevel)
retVal=$?
if [ $retVal -ne 0 ]; then
echo "$PWD does not seem to be in a git repo."
exit 1
fi
# Check there are no uncommitted changes
git_status=$(git status --porcelain=v1)
if [ "$git_status" != "" ]; then
echo "Worktree is dirty, please commit or ... |
package generators.css;
import java.util.ArrayList;
public class ColorBlender {
public static ArrayList<Color> blendColor(Color startColor, Color endColor, int midPoints) {
ArrayList<Color> colorBlended = new ArrayList<Color>();
midPoints++;
double redStep = (startColor.getRed() - endColor.getRed()) / (double... |
require "spec_helper"
describe ProposalMailer do
describe "comment_notification" do
let(:proposal) { create(:proposal) }
let(:person) { create(:person) }
let(:comment) { create(:comment, person: person, proposal: proposal) }
let(:mail) { ProposalMailer.comment_notification(proposal, comment) }
i... |
module Puppet::Parser::Functions
newfunction(:quick_include, :arity => 1, :doc => "Like hiera_include
function. Using an array as first and only parameter instead
") do |args|
answer = args[0]
if answer && !answer.empty?
method = Puppet::Parser::Functions.function(:include)
send(method, [answe... |
package com.me.chapter07
object Scala26_Collection_Method3 {
def main(args: Array[String]): Unit = {
// TODO Scala - 集合 - 常用方法
val list = List(1,2,3,4)
// TODO 集合数据的功能操作
// val newList = for ( i <- list ) yield {
// i * 2
// }
// println(newList)
... |
package me
// GENERATED SDK for me API
// Describe SOTP validation status
type SOTPValidate struct {
RemainingCodes int64 `json:"remainingCodes,omitempty"`
}
|
use std::fmt::Debug;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum KafcatError {
#[error("Timeout error")]
Timeout,
#[error(transparent)]
IoError(#[from] std::io::Error),
#[error(transparent)]
SerdeJsonError(#[from] serde_json::Error),
#[error(transparent)]
RdkafkaError(#[from]... |
unless ActiveSupport::Notifications.respond_to?(:subscribed)
module SubscribedBehavior
def subscribed(callback, *args)
subscriber = subscribe(*args, &callback)
yield
ensure
unsubscribe(subscriber)
end
end
ActiveSupport::Notifications.extend SubscribedBehavior
end
describe "using Ac... |
SECTION code_ctype
PUBLIC asm_iscntrl
asm_iscntrl:
; determine if char is 127 or <32, ie non-printable ascii
; enter : a = char
; exit : carry if a control char
; uses : f
cp 127
ccf
ret z
cp 32
ret
|
package com.landside.support.mvp
import android.content.Context
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.annotation.LayoutRes
import androidx.fragment.app.Fragment
import com.landside.shadowstate.ShadowState
import com.landside.s... |
/*
* 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")... |
class FetchHelpscoutArticlesJob
include Sidekiq::Worker
def perform
Helpscout::Article.fetch!
end
end
|
use rand::Rng;
pub fn private_key(p: u64) -> u64 {
rand::thread_rng().gen_range(2, p)
}
pub fn public_key(p: u64, g: u64, a: u64) -> u64 {
mod_exp(g, a, p)
}
pub fn secret(p: u64, b_pub: u64, a: u64) -> u64 {
mod_exp(b_pub, a, p)
}
fn mod_exp(mut base: u64, mut exp: u64, modulus: u64) -> u64 {
if modulus ==... |
/* Support for printing Modula 2 types for GDB, the GNU debugger.
Copyright 1986, 1988, 1989, 1991 Free Software Foundation, Inc.
This file is part of GDB.
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 Fou... |
package com.elpassion.android.commons.rxjavatest
import org.junit.Test
import rx.Observable
class ObservableExtensionTest {
@Test
fun shouldTestSubscriberAssertValue() {
Observable.just(2).test().assertValue(2)
}
@Test(expected = AssertionError::class)
fun shouldTestSubscriberThrowAssert... |
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Syndll2.Tests.BasicTests
{
[TestClass]
public class ByteFormatTests
{
[TestMethod]
public void Convert_To_SynelByte_Null()
{
var s = SynelByteFormat.Convert((byte[])null);
Assert.IsNull(s);
... |
2020年08月19日01时数据
Status: 200
1.钱枫又胖了
微博热度:1507983
2.警方初步判断老人被狗绳绊倒身亡为意外
微博热度:882078
3.这功夫有感脚
微博热度:869934
4.孟佳 我真的上台了
微博热度:865667
5.以家人之名
微博热度:784447
6.湖南卫视818晚会
微博热度:527641
7.乌童是个抖M吧
微博热度:440058
8.中国驻以使馆通报某中国工人聚居区疫情
微博热度:378836
9.豆瓣崩了
微博热度:357052
10.张萌张月同台
微博热度:355331
11.琉璃
微博热度:349944
12.黄子韬徐艺洋好甜... |
# Activate test environment on older Julia versions
if VERSION < v"1.2"
using Pkg: Pkg
Pkg.activate(@__DIR__)
Pkg.develop(Pkg.PackageSpec(; path=dirname(@__DIR__)))
Pkg.instantiate()
end
using AbstractPPL
using Documenter
using Test
@testset "AbstractPPL.jl" begin
include("deprecations.jl")
@... |
// flag api doc:
// http://developer.factual.com/display/docs/Core+API+-+Flag
var auth = require('./auth');
var Factual = require('../factual-api');
var factual = new Factual(auth.key, auth.secret);
factual.startDebug();
factual.post('/t/global/21EC2020-3AEA-1069-A2DD-08002B30309D/flag', {
problem: "duplicate",
u... |
# Uploadcare PHP
This is a set of libraries to work with [Uploadcare][1].
## Install
**Note**: php-curl must be installed.
Just clone source code anywhere you like inside your project:
git clone git://github.com/uploadcare/uploadcare-php.git
If you like, define some constants with Public and Secret keys withi... |
#ifndef _RENDER_MANAGER_H_
#define _RENDER_MANAGER_H_
#include "common/utils/singleton.h"
#include "cmake_val.h"
namespace BriskEngine {
enum class ENUM_GRAPIC_API_TYPE :unsigned {
DX12,
NA
};
class RendererManager : implements Singleton<RendererManager>
{
public:
inline ENUM_GRAPIC_API_TYPE getGra... |
% Trying SWI-Prolog delimited continuations
% trial/3 takes the names of three "reset points", one of "level_1", "level_2", "level_3"
% The innermost/3 predicate will shift/1 to the given reset points in turn. The code
% following the reset points performs another reset/3 on the received continuation, unless
% it is z... |
package i_introduction._0_Hello_World
import org.junit.Assert.assertEquals
import org.junit.Test
class N00StartKtTest {
@Test fun testOk() {
assertEquals("OK", task0())
}
} |
//! Typed AST module to access nodes in the tree.
//!
//! The nodes described here are those also described in the [GraphQL grammar],
//! with a few exceptions. For example, for easy of querying the AST we do not
//! separate `Definition` into `ExecutableDefinition` and
//! `TypeSystemDefinitionOrExtension`. Instead, a... |
#!/usr/bin/ruby -Wall
# ================================================================
# Please see LICENSE.txt in the same directory as this file.
# John Kerl
# kerl.john.r@gmail.com
# Copyright (c) 2004
# Ported to Ruby 2011-02-10
# ================================================================
require 'Bit_ari... |
<?php
namespace Aalberts\Models\Presenters\Cms;
use Aalberts\Models\Presenters\AbstractPresenter;
class RelatedproductPresenter extends AbstractPresenter
{
/**
* @return bool
*/
public function hasImage()
{
return ( $this->entity->relatedproductImages
&& count($this-... |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WaveEngine.Components.Cameras;
using WaveEngine.Framework;
using WaveEngine.Framework.Graphics;
namespace IsisTempleProject.Components
{
public class FollowCameraBehavior : Behavior
{
#region Variables
... |
package com.nickskelton.wifidelity.view.adapter
import com.nickskelton.wifidelity.R
sealed class BlockListItem(
val drawableIconRes: Int,
val titleText: String,
val subtitleText: String,
val onSelected: (BlockListItem) -> Unit
)
class NetworkBlockListItem(
networkName: String,
onSelected: (Bl... |
package certrotation
import (
"bytes"
"testing"
"time"
"github.com/openshift/library-go/pkg/crypto"
corev1 "k8s.io/api/core/v1"
)
func TestNeedNewSigningCertKeyPair(t *testing.T) {
certData1, keyData1, err := newSigningCertKeyPair("signer1", time.Hour*-1)
if err != nil {
t.Fatalf("Expected no error, but got... |
package controllers
import (
"fmt"
"github.com/bytesfield/golang-gin-auth-service/src/app/models"
userRepository "github.com/bytesfield/golang-gin-auth-service/src/app/repositories"
"github.com/bytesfield/golang-gin-auth-service/src/app/responses"
"github.com/bytesfield/golang-gin-auth-service/src/app/services"
... |
/*===================================================================
* Copyright (c) 2022 Oleg Naraevskiy Date: 02.2022
* Version IDE: MS VS 2019
* Designed by: Oleg Naraevskiy / noa.oleg96@gmail.com [02.2022]
*===================================================================*/
using Mod... |
using System;
namespace Tenant_Configuration_Server_Dotnet.Models {
public class TenantParameter<T> where T : ITenantParameter, new () {
public T GetInstance () {
return new T ();
}
}
} |
# controlled_context_demo_react
A demo for the tutorial at https://dev.to/charlesdlandau/react-usecontext-and-pre-initialized-providers-2gn5
|
package nl.jongensvantechniek.movierecommendations.service.social
import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD
trait GraphLoader {
/**
* @param sc
* @param dataSourcePath
* @return
*/
protected def loadGraph(sc: SparkContext, dataSourcePath: String): RDD[String] = {
sc... |
package org.jetbrains.plugins.scala
package codeInsight
package intention
package types
import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction
import com.intellij.openapi.command.undo.UndoUtil
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import com.intellij.psi... |
class MonkeyBaseException(Exception):
pass
class MonkeyTypeErrorException(MonkeyBaseException):
pass
class FileDownloadErrorException(MonkeyBaseException):
pass
class CaseBaseException(Exception):
pass
class CaseTypeErrorException(CaseBaseException):
pass
class DeviceNotConnectedException(... |
using System;
using MvvmCross.Binding;
using MvvmCross.Binding.Bindings.Target;
using MvvmCross.Platform.Platform;
using MvvmCross.Platform.UI;
using UIKit;
using AppRopio.Base.iOS.UIExtentions;
namespace AppRopio.Base.iOS.Binding
{
public class AnimatedVisibilityBinding : MvxConvertingTargetBinding
{
... |
/*
* Copyright 2020 Safeboda
*
* 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 or agreed to in... |
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using Mirror;
using SS3D.Content.Systems.Interactions;
using SS3D.Engine.Interactions;
using SS3D.Engine.Inventory;
namespace SS3D.Content.Items.Functional.Tools
{
// Simple flashlight
public class Flashlight : Item, IToggleable
{
... |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace TPS
{
public enum ComputeType
{
None,
Setup,
SetupImmediately,
DisableAll,
}
public enum UpdateMethodType
{
None,
Target,
Explode,
Gravity,
... |
module Robots
class Robot
attr_accessor :orientation, :position
attr_reader :commands, :status
def initialize(position:, orientation:, commands:, status: :operating)
@position = position
@orientation = orientation
@commands = commands
@status = status
end
def lose!
... |
require 'rails_helper'
RSpec.describe "API::V1::Users", type: :request do
before(:each) do
@user = create(:user)
@admin = create(:user, username: "Admin User", admin: true)
@token = Auth.create_token(@user.id)
@admin_token = Auth.create_token(@admin.id)
@token_headers = {
'Accept': 'applic... |
package lint
import (
"regexp"
yaml "gopkg.in/yaml.v3"
)
type regexpStr struct {
*regexp.Regexp
}
func (r *regexpStr) UnmarshalYAML(n *yaml.Node) error {
str := ""
n.Decode(&str)
r.Regexp = regexp.MustCompile(str)
return nil
}
type stringRequirement struct {
Template string
}
func (s *stringRequirement)... |
package u32
import (
"encoding/hex"
"strconv"
"strings"
)
type TCPFields struct {
SourcePort bool
DestinationPort bool
SequenceNumber bool
ACKNumber bool
DataOffset bool
Flags bool
WindowSize bool
Checksum bool
UrgentPointer bool
}
type TCPHeader struct {
Offset ... |
#include "include.h"
#define MAXN 100000
#define FLAT_CONST 298.256
#define ERAD 6378.139
#define RPERD 0.017453292
#define FONE (float)(1.0)
#define FTWO (float)(2.0)
void *check_malloc(size_t);
void *check_realloc(void *ptr,siz... |
import { Model } from 'mongoose';
import { Injectable, Logger } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { UserDocument } from 'src/schemas/user.schema';
import { OnEvent } from '@nestjs/event-emitter';
@Injectable()
export class AuthService {
private readonly logger = new Logger... |
global using CodeAnalysis.TestTools;
global using FluentAssertions;
global using NUnit.Framework;
global using Qowaiv.CodeAnalysis;
global using Qowaiv.CodeAnalysis.Diagnostics;
global using System.Linq;
|
package structure.wallbender
import structure.WallStructure
import structure.helperClasses.SpookyWall
fun WallStructure.color(l: List<SpookyWall>): List<SpookyWall> {
val sl = l.sortedBy { it.startTime }
this.color.colorWalls(sl)
return sl
}
|
//! # The manifest (`*.txt`) files
mod lines;
use std::collections::BTreeMap;
use std::{fmt, io};
use futures_util::{TryStream, TryStreamExt};
use nom_supreme::final_parser::Location;
use thiserror::Error;
use self::lines::{file_line, version_line};
pub use self::lines::{FileLine, VersionLine};
#[derive(Debug, Cop... |
import 'package:flutter/material.dart';
class HomePage extends StatefulWidget {
const HomePage({Key key}) : super(key: key);
@override
HomePageState createState() => new HomePageState();
}
class HomePageState extends State<HomePage> {
String firstname;
String lastname;
String emailId;
String mobileno;
... |
/*
// Licensed to DynamoBI Corporation (DynamoBI) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. DynamoBI licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may ... |
#ifndef READXML_HEADER
#define READXML_HEADER
#include <optixu/optixpp_namespace.h>
#include <optixu/optixu_aabb_namespace.h>
#include <optixu/optixu_math_stream_namespace.h>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <cmat... |
using Test, OffsetArrays
using VanFoFy.Ellipticals: Theta, theta
@testset "θ-functions" begin
ω1 = complex(1.0)
ω3 = exp(1im)
tol_check = 1e-15
tol_compute = 1e-20
θ = Theta(ω1, ω3, tol_compute)
z = 0.63256929128615824176 + 0.47122375149242207160im
th = OffsetArray{ComplexF64}(undef, 1:4... |
<?php
declare(strict_types=1);
namespace Rector\Reporting\EventSibscriber;
use Rector\ChangesReporting\Output\ConsoleOutputFormatter;
use Rector\Core\Configuration\Configuration;
use Rector\Core\EventDispatcher\Event\AfterReportEvent;
use Rector\Reporting\DataCollector\ReportCollector;
use Symfony\Component\Console\... |
import React from 'react';
import { TwitterEmbedElement } from '@artibox/slate-common/embed/strategies/twitter';
import { RenderElementProps } from '../../../../core';
import { useLoadTwitterEmbedApi } from '../hooks/useLoadTwitterEmbedApi';
import { useLoadTwitterEmbedHtml } from '../hooks/useLoadTwitterEmbedHtml';
e... |
package com.hxbreak.animalcrossingtools.ui.flutter
import android.os.Bundle
import android.view.View
import androidx.activity.OnBackPressedCallback
import androidx.fragment.app.viewModels
import androidx.navigation.fragment.findNavController
import androidx.navigation.fragment.navArgs
import com.google.android.materia... |
#pragma once
#include "drape_frontend/map_shape.hpp"
#include "drape_frontend/shape_view_params.hpp"
#include "drape/constants.hpp"
namespace df
{
class ColoredSymbolShape : public MapShape
{
public:
ColoredSymbolShape(m2::PointD const & mercatorPt, ColoredSymbolViewParams const & params,
Tile... |
package shared
import (
"fmt"
"github.com/pkg/errors"
"io/ioutil"
"strconv"
"strings"
)
// intToDigitArr takes a number and returns an array of digits (e.g. 12345 => [1 2 3 4 5])
func IntToDigitArr(num int) []int {
if num < 10 {
return []int{num}
}
result := []int{num % 10}
return append(IntToDigitArr(num/... |
import pytest
from django.contrib.auth import get_user_model
from django.test import Client
def test_user_guest():
c = Client()
resp = c.get("/require-user")
assert resp.status_code == 403
assert resp.json() == {"message": "You have to log in"}
def test_async_user_guest():
c = Client()
resp ... |
##
## Copyright [2013-2016] [Megam Systems]
##
## 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 or agr... |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#nullable disable
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System... |
package com.satendranegi.javalearnings;
public class TernaryOperator {
public static void main(String[] args) {
int i = 2;
int j = 3;
//via if else selection
if(i>3)
j = 1;
else
j = 2;
System.out.println(j);
//via ternary operator
... |
package hr.foi.daspicko.iotmas.repositories;
import hr.foi.daspicko.iotmas.models.Agent;
import org.springframework.data.repository.CrudRepository;
import java.util.List;
public interface AgentRepository extends CrudRepository<Agent, Long> {
}
|
from PIL import Image
import numpy as np
from robopilot.utils import img_to_binary, binary_to_img, arr_to_img, \
img_to_arr, normalize_image
class ImgArrToJpg():
def run(self, img_arr):
if img_arr is None:
return None
try:
image = arr_to_img(img_arr)
jpg =... |
Since I've had a reasonable amount of contact with Ruby, I decided to do some
unrelated exercises here. They are poorly implemented.
|
package com.megatest.myapplication.framework.presentation.list
import android.view.View
import androidx.fragment.app.viewModels
import androidx.navigation.findNavController
import androidx.navigation.fragment.findNavController
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.Line... |
using CSharpFunctionalExtensions.Internal;
using System;
using System.Runtime.Serialization;
namespace CSharpFunctionalExtensions
{
[Serializable]
public partial struct Result<T, E> : IResult, IValue<T>, ISerializable
{
private readonly ResultCommonLogic<E> _logic;
public bool IsFailure =>... |
## Currency Converter
```bash
git clone git@github.com:lis-space/currency-converter.git
cd currency-converter
echo "OER_APP_ID = 'YOURAPPID'" >> app/app/settings_local.py
./bin/up.sh
```
## API
Currencies list:
> http://0.0.0.0:8000/converter/currencies/
Rates list:
> http://0.0.0.0:8000/converter/rates/
Convert:
... |
begin work;
truncate employees restart identity cascade;
truncate departments restart identity cascade;
truncate companies restart identity cascade;
truncate truckplans restart identity cascade;
truncate trucks restart identity cascade;
-- alter sequence employees_employeeid_seq restart;
-- alter sequence departments... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.