text
stringlengths
184
4.48M
<?php namespace App\Http\Requests; use App\Exceptions\ApiFailedException; use Illuminate\Contracts\Validation\Validator; use Illuminate\Foundation\Http\FormRequest; class ResumeRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ ...
/** * Definition for a binary tree node. * class TreeNode { * val: number * left: TreeNode | null * right: TreeNode | null * constructor(val?: number, left?: TreeNode | null, right?: TreeNode | null) { * this.val = (val===undefined ? 0 : val) * this.left = (left===undefined ? nul...
import React from 'react'; import PageTitle from '../PageTitle'; import '../../stylesheets/portfolio.css'; import ProjectCard from './ProjectCard'; import { projects } from './ProjectData'; const Portfolio = () => { const title = 'My Latest Project'; const desc = 'Checkout my latest JavaScript, React and Rails pro...
# Zitadel Postrges Traefik Secure This repo is a minimal template to use Traefik v2 on localhost with HTTPS support. To get started, just clone this repo: ## Thanks [traefik-v2-https-ssl-localhost](https://github.com/Heziode/traefik-v2-https-ssl-localhost) [jimsgarage zitadel](https://github.com/JamesTurland/Jims...
from django.shortcuts import render, HttpResponse from django.http import JsonResponse from rest_framework import viewsets, status #gives access to @api_view decorator from rest_framework.decorators import api_view # access to Django REST Framework page with JSON data from rest_framework.response import Respon...
import random import numpy as np from PIL import Image as image # 进行聚类中心获取 def get_centroids(data, clusters, k): k_centroids = [] for i in range(k): cluster_indices = np.nonzero(clusters[:, :, 0] == i) cluster_points = data[cluster_indices] centroids = np.mean(cluster_points, axis=0) ...
<h2 class="text-info">Manage Users <small class="text-muted">For <holder id="txt-org-name"></holder></small> <button class="btn btn-outline-secondary" id="btn-show-users" disabled="disabled">Show Users</button></h2> <hr class="mb-12"> <form class="form-inline"> <div class="form-group mb-2"> <label for="stat...
import Sequelize from 'sequelize'; const { Op } = Sequelize; const getRandomIndex = (size) => Math.floor(Math.random() * size); const shuffleCards = (cards) => { for (let i = 0; i < cards.length; i += 1) { const randomIndex = getRandomIndex(cards.length); const currentItem = cards[i]; const randomItem ...
<!DOCTYPE html> <html lang="pt-br" xmlns:th="http://www.thymeleaf.org"> <head> <meta charset="UTF-8"> <title>API REST Senai</title> <style> /* Estilos CSS anteriores aqui */ body { font-family: Arial, sans-serif; } h1 { color: #333; } ...
import Overlay from "./Overlay"; import Wrapper from "./Wrapper"; import FigureContainer from "./FigureContainer"; import SmallLake from "./images/Lake_Misasako.jpg"; import Mountains from "./images/mountains.jpg"; import Lake from "./images/lake.jpg"; import Forest from "./images/forest.jpg"; // import Beach from "./i...
<?php namespace matpoppl\ImageCaptcha; class GDImage { public $gd; private $width = null; private $height = null; private function __construct($gd, $width = null, $height = null) { if (! $gd) { throw new \InvalidArgumentException('Unsupported GD resource'); } ...
<div class="mt-4"> <app-search-profile [withUsernameField]="false" [endPointResource]="'employee'" (searchCompleted)="searchCompleted($event)"></app-search-profile> </div> <div> <div id="divData" style="display:none;" class="card-shadow"> <form [formGroup]="frmGroup" (validSubmit)="formSubmit()"> ...
import { builtinEquations } from "./logic/equations"; import { InputData, Interval, NumberFunction, OrdinaryDifferentialEquation, Point, } from "./logic/definitions"; /** Абстрактный класс чтения входных данных. */ abstract class Reader { protected abstract get selectedEquationIndex(): number; protected...
import React from 'react'; import {FlatList, SafeAreaView, StyleSheet, View} from 'react-native'; import colors from '../../../config/colors'; import {BackBtnHeader} from '../../components/headers/BackBtnHeader'; import {CompletedAssetItem} from './CompletedAssetItem'; import Strings from '../../../config/strings'; imp...
namespace ecommerce.sdk.douyin; [Description("发布商品和发布SPU前需要调用此接口查看类目是否为SPU类目,如果是,会返回对应的管控策略和SPU发布表单")] [DouyinRetCode(10000,"success","","","")] [DouyinRetCode(50002,"业务处理失败","读取失败","isv.business-failed:2012013","检查参数入参")] [DouyinRetCode(80000,"风控拦截","操作人非法","isv.risk-control-failed:20121002","查看操作人信息")] public class ...
import 'package:flutter/material.dart'; import '../../constants/colors.dart'; import '../screens/customer-folder/customer_model.dart'; import 'bottom-app-bar-widget/bottom_app_bar_traight.dart'; class CustomerContactWidget extends StatefulWidget { CustomerModel contactList; CustomerContactWidget({ Key? key, ...
package com.jones.goldenmonitor.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import sp...
// // MenubarPresenter.swift // Timer // // Created by Anton Cherkasov on 23.02.2024. // import Foundation protocol MenubarPresenterProtocol { func menuWillOpen() func menuItemHasBeenClicked(_ id: MenuIdentifier) func timerDidChange(state: TimerState) func presentStatistics(_ interval: TimeInterval) } final c...
import datetime import flask import flask_json from typing import List import request_context import request_utils import scope.database.date_utils as date_utils import scope.database.patient.activities import scope.database.patient.safety_plan import scope.database.patient.scheduled_assessments import scope.database....
// // UIButton+Extension.m // Weibo11 // // Created by JYJ on 15/12/5. // Copyright © 2015年 itheima. All rights reserved. // #import "UIButton+Extension.h" @implementation UIButton (Extension) #pragma mark --- 创建默认按钮--有字体、颜色--有图片---有背景 + (instancetype)buttonWithTitle:(NSString *)title titleColor:(UIColor *)title...
// Funções geradoras function* geradora1() { // Código qualquer ... yield "valor 1"; // Código qualquer ... yield "valor 2"; // Código qualquer ... yield "valor 3"; } const g1 = geradora1(); // Iteração usando for ... of em uma função geradora for (let valor of g1) { console.log(valor); } // Função ...
// Validate form responsible for adding new expense $("#formExpense").validate({ rules: { amount: { required: true, amountMin: true, max: 99999999.99, decimalPlaces: true }, dateOfExpense: { dateTime: true, min: "2000-01...
import React, { useState, useEffect } from "react"; import { useParams } from "react-router-dom"; import { getMovieDetails } from "../../api"; import Layout from "../../components/Layout"; import EmptyDataMessage from "../../components/EmptyDataMessage"; import Details from "../../components/Details"; import Tabs from...
import os import os.path import torch import numpy as np import pandas import csv import random from collections import OrderedDict from .base_video_dataset import BaseVideoDataset from lib.train.data import jpeg4py_loader from lib.train.admin import env_settings import cv2 from lib.train.dataset.depth_utils import ge...
data_manipulation with ‘dyplr’ 2022-09-22 ``` r select(litters_data, group, litter_number, gd0_weight, pups_born_alive) ## # A tibble: 49 × 4 ## group litter_number gd0_weight pups_born_alive ## <chr> <chr> <dbl> <dbl> ## 1 Con7 #85 19.7 3 ## 2 Con7 #1/2/95/...
import Paper from '@mui/material/Paper'; import Table from '@mui/material/Table'; import TableBody from '@mui/material/TableBody'; import TableCell from '@mui/material/TableCell'; import TableContainer from '@mui/material/TableContainer'; import TableHead from '@mui/material/TableHead'; import TablePagination from '@mu...
package com.example.lsn03app.presentattion.view import android.content.Context import android.content.Intent import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.view.View import androidx.lifecycle.ViewModelProvider import com.example.lsn03app.databinding.ActivityTaskBinding import c...
/* * MIT License * * Copyright (c) 2022-present Alan Yeh <alan@yeh.cn> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights *...
Use Case: Downloading data from the Sequence Read Archive (SRA) Code details and examples: To download data from the SRA, you can use the SRA Toolkit which provides the `fastq-dump` command for this purpose. 1. First, you need to have the SRA Toolkit installed. If you do not have it installed, you can download it from...
/** Authors: Michael Berg <michael.berg@zalf.de> Maintainers: Currently maintained by the authors. This file is part of the util library used by models created at the Institute of Landscape Systems Analysis at the ZALF. Copyright (C) 2007-2013, Leibniz Centre for Agricultural Landscape Research (ZALF) This progra...
import Homepage from "./components/homepage"; import CreateContentType from "./components/CreateContentType"; import { Route, Routes, useLocation } from 'react-router-dom'; import MainPage from "./components/MainPage"; import { Provider } from "react-redux"; import appStore from "./components/utils/appStore"; import PD...
#ifndef HITTABLE_LIST_H #define HITTABLE_LIST_H #include "hittable.h" #include <memory> #include <vector> using std::shared_ptr; using std::make_shared; /** * Class representing a list of hittable objects. */ class hittable_list : public hittable { public: hittable_list() {} hittable_list(shar...
package com.amswh.iLIMS.partner; import com.amswh.framework.Constants; import com.amswh.iLIMS.domain.PartyGroup; import com.amswh.iLIMS.service.ConstantsService; import com.amswh.iLIMS.service.PartyService; import com.amswh.iLIMS.service.PartygroupService; import com.amswh.iLIMS.utils.MyStringUtils; import jakarta.an...
import { withProjectAuth } from "@/lib/auth"; import { addDomain, removeDomain, validateDomain } from "@/lib/api/domains"; import prisma from "@/lib/prisma"; import { changeDomainForImages, changeDomainForLinks, deleteDomainLinks, setRootDomain, } from "@/lib/api/domains"; export default withProjectAuth(async ...
# 09.1 Weekday Lesson Plan: Introduction to Node.js and ES6 ## Overview This lesson introduces Node.js and the new syntax that comes with ES6. This includes arrow functions and new variables `let` and `const`. We will also cover template literals and how they can be helpful in the development process. > **Important*...
import React, { useEffect, useState } from "react"; import { FaStar } from "react-icons/fa"; import { Link } from "react-router-dom"; const Products = () => { const [products, setProducts] = useState([]); useEffect(() => { fetch("data.json") .then((res) => res.json()) .then((data) => setProducts(d...
using System; public class Aluno { private int matricula; public string nome; private double notaProva1; private double notaProva2; private double notaTrabalho; public Aluno(int matricula, string nome) { this.matricula = matricula; this.nome = nome; notaProva1 = 0....
<h2>Intersection of Two Arrays</h2> <p>Given two integer arrays <code>nums1</code> and <code>nums2</code>, return <i>an array of their intersection</i>. Each element in the result must be <b>unique</b> and you may return the result in <b>any order</b>.</p> <h3>Example 1:</h3> <p><b>Input:</b> <code>nums1 = [1, 2, ...
import asyncHandler from 'express-async-handler'; import Permission from '../model/permissionModel.js'; // Permission create controller export const createPermission = asyncHandler(async (req, res) => { const { name } = req.body; const findPermission = await Permission.findOne({ name }); if (findPermission) { ...
import React from 'react' import {makeStyles} from '@material-ui/core/styles' import InputAdornment from '@material-ui/core/InputAdornment' import IconButton from '@material-ui/core/IconButton' import SendIcon from '@material-ui/icons/Send' import TextField from '@material-ui/core/TextField' import {stdCornerRadius} fr...
package com.example.myapplication2 import android.graphics.Paint import androidx.compose.foundation.Canvas import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxSize import androidx.c...
import type { GetStaticProps, NextPage } from "next"; import Layout from "../../components/layout"; import useTranslation from "next-translate/useTranslation"; import type { PrivacyPolicy as PrivacyPolicyType } from "../../types/privacyPolicy"; import PrivacyPolicyPages from "../../data/privacyPolicy"; import Link from...
import java.util.InputMismatchException; import java.util.Scanner; public class Triangle { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int a, b, c; System.out.println("Введите длину стороны a:"); a = scanner.nextInt(); System.out.print...
import { memo, useCallback, useMemo } from "react"; import { Button, Card } from "react-bootstrap"; const Comment = (props) => { console.log("I have rendered!") const createdDt = useMemo(() => new Date(props.created), [props.created]); return <Card style={{margin: "0.5rem"}}> <p>{props.comment}<...
<doc> <head> <title>Grammatica Reference Manual</title> </head> <body> <h1>Handling Ambiguities</h1> <p>Grammar ambiguities are points in the grammar where multiple alternatives conflict. As the parser is deterministic, a single alternative must be chosen and grammar ambiguities are theref...
package requesters; import Organization.OrganizationType; import exceptions.WrongArgumentInRequestInScriptException; import utility.ScriptChecker; import java.io.InputStream; import java.util.NoSuchElementException; import java.util.Scanner; /** * Позволяет запрашивать у пользователя (читать из файла скрипта) тип о...
/* * Copyright (C) 2023 Hong Qiaowei <hongqiaowei@163.com>. 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, or * any later vers...
package vip.sunke.mybatis; import freemarker.template.Configuration; import freemarker.template.Template; import freemarker.template.TemplateException; import freemarker.template.Version; import java.io.*; import java.util.Locale; import java.util.Map; /** * @author sunke * @Date 2019-04-29 14:07 * @description ...
const express = require("express"); const axios = require("axios"); require("dotenv").config(); const app = express(); const port = process.env.PORT || 3000; app.get("/", (req, res) => { let dataToPost = []; const url = `${process.env.MAIN_URL}`; const method = "GET"; // or 'POST', 'PUT', 'DELETE', etc. con...
import { useContext } from 'react'; import axios from 'axios'; import { useQuery } from '@tanstack/react-query'; import { useParams } from 'react-router-dom'; import { lang } from '../../dictionary'; import { Context } from '../../AppContext'; import Card from '../Cards/Card'; import CardLoader from '../CardLoader/Car...
/* * I2C Link Layer for Samsung S3FWRN5 NCI based Driver * * Copyright (C) 2015 Samsung Electrnoics * Robert Baldyga <r.baldyga@samsung.com> * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2 or later, as pu...
""" test with the TimeGrouper / grouping with datetimes """ from datetime import datetime from io import StringIO import numpy as np import pytest import pytz import pandas.util._test_decorators as td import pandas as pd from pandas import ( DataFrame, DatetimeIndex, Index, MultiIndex, Series, ...
/*! * Copyright (c) 2017-present, SeetaTech, Co.,Ltd. * * Licensed under the BSD 2-Clause License. * You should have received a copy of the BSD 2-Clause License * along with the software. If not, See, * * <https://opensource.org/licenses/BSD-2-Clause> * * ---------------------------------------------------...
import React from "react"; import styled from "styled-components"; import { Link, useNavigate } from "react-router-dom"; import ReactWhatsapp from 'react-whatsapp'; import { FaFacebook, FaInstagram, FaYoutube, FaTwitter, FaLinkedin, FaWhatsapp, } from "react-icons/fa"; import { callNum } from "../../utils/...
DEMO INSTRUCTIONS This is a demonstration of the JavaHelp viewer running in a web browser using the Java Plug-in with JDK1.1.6 or later (does not work with JDK1.2). JavaHelp does not run correctly in web browsers and the appletviewer due to a limitation in Swing 1.1 Beta3. This limitation will be corrected by Swing1...
<template> <div class="container"> <div class="container-fluid justify-content-center"> <div class="row mt-5" > <div class="col-sm-3" v-for="(transaction, index) in transactions" :key="index"> <ProductCard v-bind:product="transaction"/> </div> ...
# SASS 🚀 Sass (short for syntactically awesome style sheets) is a preprocessor scripting language that is interpreted or compiled into Cascading Style Sheets (CSS). SassScript is the scripting language itself. # SASS Practices Repository ⭐ This repository contains various SASS practices to improve SASS skills and k...
package com.cxyhome.top.common.util; import java.util.HashMap; import java.util.Map; import java.util.UUID; /** * ID 生成类 */ public class IdGenerator { private final static char[] digits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',...
<?php /** * BuyByRaffleRaffleClassMgr * * This class manages the raffle classes used in the plugin. It allows for setting * the raffle classes upon plugin activation and provides a method to retrieve * a raffle class ID by its name. */ namespace Sgs\Buybyraffle; class BuyByRaffleRaffleClassMgr { /** * ...
import 'package:flutter/material.dart'; import 'package:phoenix_mobile/utils/ui/colors.dart'; import 'package:phoenix_mobile/utils/ui/fonts.dart'; class CardTransactionContainer extends StatelessWidget { final String title; final String prise; final String secondaryTitle; final String usdValue; final VoidCa...
<div class="container"> <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css'> <header> <nav> <ol class="breadcrumb repo-breadcrumb"> <li class="breadcrumb-item"><a href="/administrator" [routerLink]="['/administrator']" c...
import { Injectable } from '@angular/core'; import { HttpRequest, HttpHandler, HttpEvent } from '@angular/common/http'; import { Observable, throwError } from 'rxjs'; import { catchError } from 'rxjs/operators'; import { AuthorisationService } from './authorisation.service'; @Injectable({ providedIn: 'root' }) expor...
package com.jnv.common.accesslog.filter; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; import javax.annotation.Resource; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet....
<?php namespace App\Http\Controllers\backend; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Model\Category; use App\Model\Product; use App\Model\Supplier; use App\Model\Unit; use Auth; use App\Model\Purchase; use Illuminate\Support\Facades\DB; use App\Model\Invoice; use App\Model\InvoiceDe...
# -*- coding: utf-8 -*- """ Created on Tue Aug 30 20:02:42 2022 WNBA VIZZIES @author: ericd """ import pandas as pd import matplotlib.pyplot as plt from matplotlib.offsetbox import OffsetImage, AnnotationBbox import matplotlib.ticker as mtick ########################### WNBA EFFICIENCY PLOT############################...
import { useMemo } from 'react'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import styles from './index.scss'; interface Props { status: string; } const Index: React.FC<Props> = ({ status }) => { const result = useMemo<[string, JSX.Element, string]>(() => { if (status === 'ENABLE') { ...
import { useEffect } from "react"; import { useDispatch } from "react-redux"; import { setLoading, setSnackbar } from "redux/features/layoutSlice"; const useLayout = (props: { isError: boolean; isLoading: boolean; errorMessage: string; }) => { const { isError, isLoading, errorMessage } = props; const dispatc...
use starknet::{ContractAddress, ClassHash, contract_address_const}; use starknet::testing::cheatcode; use super::_cheatcode::handle_cheatcode; mod events; mod l1_handler; mod contract_class; mod tx_info; mod fork; mod storage; #[derive(Drop, Serde, PartialEq, Clone, Debug, Display)] enum CheatTarget { All: (), ...
package ir.enigma.app.ui.main import androidx.compose.runtime.MutableState import androidx.compose.runtime.mutableStateOf import androidx.lifecycle.viewModelScope import dagger.hilt.android.lifecycle.HiltViewModel import ir.enigma.app.data.ApiResult import ir.enigma.app.model.Group import ir.enigma.app.repostitory.Mai...
"use client"; import NoteDeleteModal from "@/components/Note/NoteDeleteModal"; import NoteEditModal from "@/components/Note/NoteEditModal"; import NoteShareModal from "@/components/Note/NoteShareModal"; import { AuthToken } from "@/features/auth/authSlice"; import { NoteData } from "@/services/notes"; import styles fr...
import React from 'react' import { render, fireEvent } from 'react-testing-library' import OfferButton from '../components/OfferButton' describe('OfferButton', () => { const props = { handleClick: jest.fn(), id: 1 } it('renders the OfferButton', () => { const { queryByText } = render(<OfferButton />) const...
#pragma once #include <iostream> #include <fstream> #include <string> #include <vector> #include <chrono> #include <thread> #include <queue> #include <boost/lockfree/queue.hpp> #include <boost/algorithm/string/join.hpp> namespace bulk { typedef struct { std::string _text; std::chrono::system_clock::time_poi...
<template> <div class="container"> <h2>{{this.post.title_post}}</h2> <h6 v-if="(this.post.content != '')" class="data">Creato il: {{ updateDate }}</h6> <h5 v-if="this.post.category" >Categoria: {{ this.post.category.name }}</h5> <div class="tags" v-for...
--- id: 62015a5da1c95c358f079ebb title: Passo 37 challengeType: 0 dashedName: step-37 --- # --description-- O pseudosseletor `:first-of-type` é utilizado para focar no primeiro elemento que corresponde ao seletor. Crie um seletor `h1 .flex span:first-of-type` para escolher o primeiro elemento `span` no contêiner `.fl...
// Copyright 2022-2023 @Polkasafe/polkaSafe-ui authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. import { AutoComplete, Form, Input } from 'antd'; import { DefaultOptionType } from 'antd/es/select'; import React, { use...
package com.bachlinh.order.web.dto.resp; import com.fasterxml.jackson.annotation.JsonProperty; public class AdminProductResp { @JsonProperty("id") private String id; @JsonProperty("name") private String name; @JsonProperty("price") private String price; @JsonProperty("size") privat...
import { PaperBaseScene } from "./PaperBaseScene"; export default class Invaders extends PaperBaseScene { player: Phaser.Physics.Arcade.Sprite; keys: Phaser.Types.Input.Keyboard.CursorKeys; enemyVelocity: number = 65; enemyGroup: Phaser.Physics.Arcade.Group; bulletGroup: Phaser.Physics.Arcade.Group; constr...
import json from datetime import timedelta, datetime, UTC from unittest.mock import patch from django.apps import apps from django.test import SimpleTestCase, TestCase from django.utils.timezone import now from freezegun import freeze_time from gcp_pilot.exceptions import DeletedRecently from gcp_pilot.mocker import p...
import { auth, firestore, storage } from "firebase-admin"; import { FieldValue } from "firebase-admin/firestore"; import * as functions from "firebase-functions"; const client = require("firebase-tools"); export const deleteAccountHandler = async (data, context) => { // Validate auth status and args if (!context |...
package com.ticketmaster.example.commons.persistence.model; import java.util.Date; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; /** * * Acting as a entity listener to any type of model entity. * Annotated with PrePersist and PreUpdate. * It always being called before persisting and ...
<!-- INDEX É A PAGINA INICIAL--> <!DOCTYPE html> <!-- indica ao navegador para usar a versão recente--> <html> <!-- pai/raiz de todas as tags--> <head> <!-- Manter informações da pagina--> <meta charset="utf-8"/> <!-- Uso de caracteres especiais --> <title>Página Inicial</title> <!-- Meta tags--> <met...
-- Created on: 1991-05-06 -- Created by: Laurent PAINNOT -- Copyright (c) 1991-1999 Matra Datavision -- Copyright (c) 1999-2014 OPEN CASCADE SAS -- -- This file is part of Open CASCADE Technology software library. -- -- This library is free software; you can redistribute it and/or modify it under -- the terms of the GN...
#ifndef ALARMTOQUEUE_H #define ALARMTOQUEUE_H /******************************************************************************* * ALMA - Atacama Large Millimiter Array * (c) European Southern Observatory, 2011 * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Less...
import UnionFind from "./UnionFind"; const minCostToConnectCities = (n: number, connections: number[][]): number => { const uf = new UnionFind(n); // Sort connections by cost connections.sort((a,b) => a[2] - b[2]); let totalCost = 0; connections.forEach((connection) => { if(!uf.conn...
import styles from "./Trending.module.css"; import Header from "../../components/Header/Header"; import Sidebar from "../../components/Sidebar/Sidebar"; import Post from "../../components/Post/Post"; import { useEffect, useState } from "react"; import { useGetTrending } from "../../hooks/useGetTrending.js"; import axio...
import { Field, InputType } from '@nestjs/graphql' import { IsEmail } from 'class-validator' import { IsExistingByUuid } from 'src/commons/validators/is-existing-by-uuid.validator' import { IsStrongPassword } from '../../commons/decorators/is-strong-password.decorator' @InputType() export class UserCreateInput { @Fie...
import React, { useEffect, useMemo, useState } from 'react'; import { Formik, Form as FormikForm, Field, ErrorMessage } from 'formik'; import * as Yup from 'yup'; import { Button, Form, Col, InputGroup, Modal } from 'react-bootstrap'; import { useLocalStorage } from '@uidotdev/usehooks'; import { useNavigate } from 're...
import 'package:firebase_flutter_app/provider/auth_provider.dart'; import 'package:firebase_flutter_app/screens/home_screen.dart'; import 'package:firebase_flutter_app/screens/register_screen.dart'; import 'package:firebase_flutter_app/widgets/custom_button.dart'; import 'package:flutter/material.dart'; import 'package...
import { createRouter, createWebHashHistory } from 'vue-router' import HomeView from '../views/HomeView.vue' const routes = [ { path: '/', name: 'home', component: HomeView }, { path: '/about', name: 'about', // route level code-splitting // this generates a separate chunk (about.[has...
Tutorial 32: Handling Events in React //App.js: import React from "react" function handleClick() { console.log("I was clicked") } // https://reactjs.org/docs/events.html#supported-events function App() { return ( <div> <img onMouseOver={() => console.log("Hovered!")} src="https://www.fi...
package main import ( "bytes" "database/sql" "log" "net/http" "net/http/httptest" "testing" _ "github.com/denisenkom/go-mssqldb" ) func setupTest() { // Initialize db with a connection to your test database // Update the connection string with your test database details db, err := sql.Open("sqlserver", "se...
package com.imtilab.bittracer.utils import groovy.util.logging.Slf4j import com.imtilab.bittracer.constant.Constants import net.sf.json.JSONArray import org.apache.commons.collections.CollectionUtils import org.apache.commons.lang3.time.DateFormatUtils import java.text.SimpleDateFormat import java.time.* import java....
## 题目描述 尽管奶牛们天生谨慎,她们仍然在住房抵押信贷市场中受到打击,现在她们开始着手于股市。 Bessie 很有先见之明,她不仅知道今天 $s$ 只股票的价格,还知道接下来一共 $d$ 天的(包括今天)。给定一个 $d$ 天的股票价格矩阵以及初始资金 $m$,求最优买卖策略使得总获利最大化。每次必须购买股票价格的整数倍,同时你不需要花光所有的钱(甚至可以不花)。考虑这个牛市的例子(这是 Bessie 最喜欢的)。在这个例子中,有 $2$ 只股票和 $3$ 天。奶牛有 $10$ 的钱来投资。 |股票 | 今天的价格 | 明天的价格 | 后天的价格 | | :----: | :----: | :----: | :----: | ...
#include "3-calc.h" #include <stdio.h> #include <stdlib.h> #include <string.h> /** * main - perform math operations * @argc: argument count * @argv: argument vector * Return: 98 on error, 99 on illegal op or 0 otheriwse */ int main(int argc, char *argv[]) { int (*func)(int, int); if (argc != 4) { printf("E...
import { Link as ScrollLink } from 'react-scroll'; import {Box, Button, Text, VStack} from '@chakra-ui/react'; import { motion } from "framer-motion"; import { ChevronDownIcon } from '@chakra-ui/icons'; import React from "react"; import './home.scss'; const MotionBox = motion(Box); type ScrollTextProps = { to: ...
import java.awt.BorderLayout; import java.awt.Color; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.util.Stack; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; import javax.swing.JButton; import javax.swing.JFrame; import javax...
import { RouteProps } from 'react-router-dom'; import MainPage from '@/pages/MainPage/ui/MainPage'; import { AboutPage } from '@/pages/AboutPage'; import { NotFound } from '@/pages/NotFoundPage/ui/NotFound'; import { ProfilePage } from '@/pages/ProfilePage'; import { RegistrationSuccess } from '@/pages/RegistrationSucc...
from django.db import models from django.contrib.auth import get_user_model User = get_user_model() class BaseModel(models.Model): created_at = models.DateTimeField('Добавлено', auto_now_add=True) is_published = models.BooleanField( 'Опубликовано', default=True, help_text='Снимите гал...
package app.model; import java.time.LocalDate; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import org.springframework.format.annotation.DateTimeFormat; ...
function init() { // Grab a reference to the dropdown select element let selector = d3.select("#selDataset"); // Use the list of sample names to populate the select options d3.json("static/js/samples.json").then((data) => { let sampleNames = data.names; sampleNames.forEach((sample) => { selector...