text stringlengths 184 4.48M |
|---|
# Databricks notebook source
from packages.utils import utils
import json
import os
import pandas as pd
import numpy as np
from datetime import datetime, timedelta, date
import seaborn as sns
import matplotlib.pyplot as plt
import plotly.express as px
import gradio as gr
config = utils.read_json("./config.json")
data_... |
import React, { useEffect } from 'react'
import { LinkContainer } from 'react-router-bootstrap'
import { Table, Button, Row, Col } from 'react-bootstrap'
import { useDispatch, useSelector } from 'react-redux'
import Message from '../components/Message'
import Loader from '../components/Loader'
import { listOrders } fro... |
不仅for循环语句的圆括号被精简掉了,while和do..while都被合并到了for里
for循环有4种写法
1、for inition; condition; expression{...}
//即以前的for(inition; condition; expression){}
2、for condition{}
//即以前的while(condition){}
3、for{...}
//即以前的 for(;;){} 或while(true){}
这种合并和精简很有道理,因为for完全可以实现任何形式的循环,在c语言里,while也很多余。
4、循环基本都是为了处理各种数据结构,range工具可以方便地迭代数组、... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FigmaLand</title>
<link rel="shortcut icon" href="img/figmaland.ico" type="image/x-icon">
<link href=... |
package com.example.demo.entities.web;
import java.util.List;
import org.springframework.stereotype.Component;
import com.example.demo.dto.CustomerRequest;
import com.example.demo.entities.Customer;
import com.example.demo.mapper.CustomerMapper;
import com.example.demo.repository.CustomerRepository;
import jakarta.... |
---
id: 107
title: 'Low level debugolás, 1. rész: strace'
date: '2016-02-29T23:27:53+01:00'
author: janoszen
layout: post
guid: 'https://www.refaktor.hu/?p=107'
permalink: /2016/02/29/low-level-debugolas-1-resz-strace/
pyre_show_first_featured_image:
- 'yes'
pyre_portfolio_width_100:
- default
pyre_video:
-... |
class ElectricalAppliance {
constructor(name, power) {
this.power = power;
this.name = name;
this.isPlugged = false;
}
plugIn() {
this.isPlugged = true;
console.log(`${this.name} включен в розетку`);
}
unplug() {
this.isPlugged = false;
console.log(`${... |
<?php
namespace ChrisReedIO\AthenaSDK\Requests\Charts\SocialHistory;
use Saloon\Enums\Method;
use Saloon\Http\Request;
/**
* GetPatientSocialHistory
*
* Retrieves the social history information of a specific patient
*/
class GetPatientSocialHistory extends Request
{
protected Method $method = Method::GET;
... |
// -*- mode: SCAD ; c-file-style: "ellemtel" ; coding: utf-8 -*-
//
// Axoloti case.
//
// © 2017 Roland Sieker <ospalh@gmail.com>
// © 2013 M_G
// Licence: CC-BY-SA 4.0
// Based on M_G’s OpenSCAD Parametric Packaging Script v2, version
// 2.6c. Thingiveres thing https://www.thingiverse.com/thing:66030
// See the sour... |
-- Complexity: O(n)
fib :: Int -> Int
fib n = aux n 1 1
where aux 0 val1 val2 = val1
aux 1 val1 val2 = val2
aux n val1 val2 = aux (n-1) val2 (val1 + val2)
main :: IO ()
main = print $ fib 47 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>axios創建實例對象</title>
<link
crossorigin="annoymous"
href="https://cdn.bootcss.com/twitt... |
import * as React from 'react';
import { useState, useContext } from 'react';
import Typography from '@mui/material/Typography';
import { TextField } from '@mui/material';
import Button from '@mui/material/Button';
import Container from '@mui/material/Container';
import { SocketContext } from '../../Context';
import Gr... |
describe("Custom Command", () => {
// url: https://magento.softwaretestingboard.com
// email: aedyn.kewon@fixedfor.com
// password: *9kjceG5*TSWXhb
let loginDetails;
before(() => {
cy.fixture("magentoLoginCredentials").then((loginCredentials) => {
loginDetails = loginCredentials;
... |
import { Result, wrapResult } from "../../result/result";
import { dataview } from "./util";
export const FLOAT16_SIZE = 2;
/**
* read 16 bit (half precision) floating point number big endian
* @param buffer
* @param offset
* @returns float
*/
export const readFloat16be = (buffer: Uint8Array, offset: number): R... |
using HealthChecks.UI.Client;
using JS.Contas.Infra.Data;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Mic... |
<template>
<div class="form-list flex-grow-1 flex-column d-flex mw-100 ms-user-management">
<div class="d-flex flex-row title-box align-items-center gap-2">
<div class="icon24 back pointer" @click="this.$router.go(-1)"></div>
<div class="list-title flex-grow-1 text-start">Quản lý người dùng</div>
... |
const emailPattern = /([a-z0-9][-a-z0-9_\+\.]*[a-z0-9])@([a-z0-9][-a-z0-9\.]*[a-z0-9]\.(arpa|root|aero|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck... |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Conjugaison du verbe receler</title>
<style>
body{
background: #DDD;
text-align: center;
padding: 10px 0;
}
section{
background: #CCC;
padding: 10px;
}
.title{
background: #8e44ad;
padding:... |
/*
Covid 19 Data Exploration
Skills used: Joins, CTE's, Temp Tables, Windows Functions, Aggregate Functions, Creating Views, Converting Data Types
*/
use sql_project;
select * from covid_death;
select * from covid_vaccination;
-- select data that we are going to be using --
select location,date,total_cases,new_case... |
import { Text, Pressable, IPressableProps } from "native-base";
interface Props extends IPressableProps {
name: string
isActive: boolean
}
export function Group({name, isActive, ...rest}: Props) {
return (
<Pressable
w={24}
h={10}
mr={3}
bg="gray.600"
rounded="md"
justif... |
<?php
namespace App\Modules\SuperAdmin\Models;
use App\BaseModel;
use Inertia\Inertia;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Route;
use Illuminate\Database\QueryException;
use Illuminate\Notifications\Notifiable;
use App\Mo... |
package com.db.store.controller;
import com.db.store.dto.RoleDTO;
import com.db.store.service.RoleService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
import org.springframework.http.HttpStatus;
import org.springframework.validation.BindingResult;
im... |
/* vi: ts=8 sts=4 sw=4
*
* $Id$
*
* This file is part of the KDE project, module kdesu.
* Copyright (C) 2000 Geert Jansen <jansen@kde.org>
*
* This is free software; you can use this library under the GNU Library
* General Public License, version 2. See the file "COPYING.LIB" for the
* exact licensing terms... |
//
// ReposVC.swift
// GithubSearch
//
// Created by Shujat Ali on 4/26/21.
//
import UIKit
class ReposVC: BaseVC, UISearchBarDelegate, UITextFieldDelegate {
let searchBarPlaceholder = "Enter keywords"
let navigationTitle = "Repos"
@IBOutlet weak var tableView: UITableView!
@IBOutlet weak var ... |
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
/* Variables CSS */
:root{
--primary-color: #411DD2;
--secondary-color: #DF8888;
--light-brown-color:#9B8B81;
... |
package com.publicis.sapient.p2p.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Patte... |
import "../App.css";
import { useState } from "react";
import nalgene from "../assets/nalgene.png";
import regularmug from "../assets/regularmug.png";
import purelife from "../assets/purelife.png";
import gatoradesquirt from "../assets/gatoradesquirt.png";
import starbuckscup from "../assets/starbuckscup.png";
import g... |
#include <iostream>
#include <map>
#include <queue>
using namespace std;
class Solution {
public:
bool canConstruct(string ransomNote, string magazine) {
int lenR = ransomNote.length();
int lenM = magazine.length();
if (lenR > lenM)
{
return false;
} else {
... |
import { createSlice } from "@reduxjs/toolkit";
const initialState = {
currentUser: null,
token: null,
loading: false,
error: false,
};
export const userSlice = createSlice({
name: "user",
initialState,
reducers: {
loginStart: (state) => {
state.loading = true;
},
loginSuccess: (state,... |
@extends('/layout/layout')
@push('duar')
<link href="vendor/datatables/dataTables.bootstrap4.min.css" rel="stylesheet">
@endpush
@section('content')
<!-- Main Content -->
<div id="content">
<!-- Begin Page Content -->
<div class="container-fluid mt-5">... |
import { PlatformAccessory } from 'homebridge';
import { TuyaIRPlatform } from '../../platform';
import { APIInvocationHelper } from '../api/APIInvocationHelper';
import { BaseAccessory } from './BaseAccessory';
/**
* Do It Yourself Accessory
* An instance of this class is created for each accessory your platform re... |
#include "sort.h"
/**
* swap_element - Entry point
* @array: the array
* @a: index count
* @b: index count
*/
void swap_element(int *array, int a, int b)
{
int temp;
temp = array[a];
array[a] = array[b];
array[b] = temp;
} /* end function */
/**
* bubble_sort - Entry point to bubble sort
* @array: 'The a... |
import 'dart:convert';
class RegisterUserModel {
final String name;
final String email;
final String password;
final String passwordConfirmation;
RegisterUserModel({
required this.name,
required this.email,
required this.password,
required this.passwordConfirmation,
});
RegisterUserM... |
import { useEffect, useState } from "react";
import { FormattedMessage } from "react-intl";
import { useLocation, useNavigate } from "react-router-dom";
import { Button } from "reactstrap";
import { CollectionItemType } from "../../services/ItemsApiService";
import { useItemsApi } from "../../hooks/useItemsApi";
import... |
class UltrasonicSensor {
private:
int triggerPin;
int echoPin;
public:
UltrasonicSensor(int triggerPin, int echoPin) {
this->triggerPin = triggerPin;
this->echoPin = echoPin;
}
void setup() {
pinMode(triggerPin, OUTPUT);
pinMode(echoPin, INPUT);
digitalWrite(triggerPin, LOW);
}
floa... |
from django.contrib import admin
from .models import Project, Student
# Класс для настройки отображения модели Project в административной панели
class ProjectAdmin(admin.ModelAdmin):
# Список полей, которые будут отображаться в таблице проектов
list_display = ('title', 'student', 'annotation')
# Список пол... |
package com.fastcampus.getinline.controller.api;
import com.fastcampus.getinline.constant.ErrorCode;
import com.fastcampus.getinline.constant.PlaceType;
import com.fastcampus.getinline.dto.PlaceRequest;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupit... |
package com.camerafeed.MyOpenGL;
import android.opengl.Matrix;
import android.util.Log;
import java.util.Random;
/**
* Created by NoobsDeSroobs on 11-May-16.
*/
public class GeoData {
public float[] mVertices;
public short[] mIndices;
private GeoData() {
}
static public GeoData halfpipe() {
... |
# Jamie Lee
# CS 333
# Final Project
# Referee
from die import Die
import random
class Referee:
def __init__(self):
self.name = "Game Master - Rule Enforcer :)"
self.roundEnd = 0
# interaction between referee and die
def rollAdvantageDie(self):
die = Die()
# roll 1 dice
... |
import { call, put, takeEvery } from "redux-saga/effects";
import {
postTransactionRequested,
postTransactionSuccess,
postTransactionFailed,
getDetailTransactionSuccess,
getDetailTransactionFailed,
getDetailTransactionRequested,
checkPaymentSuccess,
checkPaymentFailed,
checkPaymentRequested,
history... |
"""
Module with functions which configure the model setup.
.. autosummary::
:toctree:
:nosignatures:
importer
dict_to_list
parameterimporter
parameterinterpolator
parameterinterpolatorstepwise
add_sellersparameters
import_parallelparameter
allocate_parallelparameter
write_p... |
import React from 'react';
import { BrowserRouter } from 'react-router-dom';
import { it, expect } from 'vitest';
import { NavMenu } from '@components/NavBar';
import { render } from '@testing-library/react';
import createMatchMedia from '../../helpers/createMatchMedia';
const MockNavMenu = () => (
<BrowserRouter>
... |
package adapter.rest;
import org.example.adapter.controller.rest.DoorRestController;
import org.example.config.spring.rest.RouteModule;
import org.example.core.usecase.port.DoorsExecutor;
import org.springframework.http.HttpStatus;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
impor... |
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'bundler/setup'
require 'srx'
require 'optparse'
require 'benchmark'
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: #{$PROGRAM_NAME} [options]"
opts.on('-sFILE', '--srx FILE', 'SRX file (optional)')
opts.on('-fFORMAT', '--format FORMAT', ... |
#!/usr/bin/env node
import 'source-map-support/register';
import * as cdk from '@aws-cdk/core';
import {AwsTrainingStack} from '../lib/aws-training-stack';
import {StackProps} from "@aws-cdk/core";
// cdk.App() is the app that is run when you invoke cdk deploy
// app is the parent which all our stacks will be attached... |
import { ChannelType, EmbedBuilder, VoiceState } from "discord.js";
import BaseClient from "@structures/BaseClient.js";
import * as fs from "fs";
import voiceStateUpdate from "@root/build/events/voice/VoiceStateUpdate";
export default class {
private client: BaseClient;
public constructor(client: BaseClient) {
th... |
library(dplyr) # for manipulating data
library(ggplot2) # for visualizations
# folders
pac_data_folder <- file.path('pac_results_data')
figures_folder <- file.path('pac_figures')
# scenario name
ifr_type <- 'med'
scen_descript <- '_example_low_R0'
scen_name <- paste0(ifr_type,'_IFR',scen_descript)
# full names for p... |
//Tatiana Fucsik
package edu.seminolestate.patients;
import java.time.temporal.ChronoUnit;
import java.time.LocalDate;
public class Outpatient extends Patient {
private int visitNumber;
private int clinicNumber;
private LocalDate procedureDate;
protected static final LocalDate DEFAULT_PROCEDURE_DATE = LocalDate.now(... |
This repository contains several scripts that simplify the interactions with singularity containers for our experiments.
## Install
To install this submodules in your project:
1) Run the following commands:
```
mkdir -p submodules
git submodule add ../../../AIRL_tools/singularity_scripts ./submodules/singularity_scri... |
---
title: "Figure Proportion of area represented"
author: "Anna Talucci"
date: "2024-03-08"
output: html_document
---
# clear environment
```{r}
rm(list=ls())
```
# Overview
Creat over view map with permafrost extent and summary of site data.
Notes:From PCN-Fire-Sysnthesis "Manuscript Map"
[Better colors for Mappin... |
package completions
import (
"fmt"
"github.com/urfave/cli/v2"
)
// defaultCompletions renders the default completions for a command.
func defaultCompletions() cli.BashCompleteFunc {
return func(c *cli.Context) { cli.DefaultCompleteWithFlags(c.Command)(c) }
}
// CompleteArgs provides autocompletions based on the ... |
use super::*;
#[component]
fn ValueInput<'a>(cx: Scope, name: &'a str, ty: &'a str, var: &'a str) -> Element {
view! {cx,
<div class="mb-4">
<label for={name} class="block font-bold text-gray-700 mb-2">
{name} ": "
</label>
<input type={ty} id={name} x-mo... |
develop a web page that contains a form with multiple input fields and it needs to be validated before submitting it, ensuring that all required fields are filled out correctly. how would you use jQuery to perform validation? what jQuery method or plugins would you utilize to validate the form inputs?
HTML:
<!DOCTYP... |
import { ComponentMeta, ComponentStory } from '@storybook/react'
import { SideBarItem } from 'src/components/elements/SideBar/SideBarItem/SideBarItem'
import { theme } from 'src/config/theme'
export default {
title: 'elements/SideBar/SideBarItem',
component: SideBarItem,
argTypes: {
item: {
description... |
package models
import (
"encoding/json"
"errors"
"strings"
)
// RenewalPreviewResponse represents a RenewalPreviewResponse struct.
type RenewalPreviewResponse struct {
RenewalPreview RenewalPreview `json:"renewal_preview"`
AdditionalProperties map[string]any `json:"_"`
}
// MarshalJSON impl... |
<!-- Rendering -->
<template>
<div>
<h1>
PageHome
</h1>
<h2>
Add artist
</h2>
<input type="text" v-model="newArtist">
<button @click="addArtist()">
Add artist
</button>
<hr>
<table border="1">
<tr>
<th>
ID
<... |
using Entities.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging.Configuration;
using Presentation;
using Repositories;
using Repositories.Contracts;
using Repositories.EntityFramework;
using Services;
using Services.Contracts;
using StoreApp.Infrastructure.Extensions;
using StoreApp.Model... |
import { AnimatePresence, motion } from 'framer-motion';
import React from 'react'
interface AccordionItemProps {
data: {
id: number,
question: string,
answer: string
},
isActive: boolean,
onClick: (id:number) => void
}
const AccordionItem = ({data,isActive,onClick} : Accordion... |
import {Fade, Grow, Tooltip, Zoom} from "@mui/material";
import {AppConfigState} from "../../store/slices/appConfig/appConfigSlice";
import {RootState} from "../../store";
import {useSelector} from "react-redux";
interface ITooltipsFinanceoProps {
placement?: "top" | "bottom" | "left" | "right" | any;
title: s... |
package com.example.service.impl;
import com.example.dto.expert.*;
import com.example.entity.Expert;
import com.example.entity.SubService;
import com.example.entity.enumeration.ExpertStatus;
import com.example.exceptions.subservice.SubServiceExistException;
import com.example.exceptions.subservice.SubServiceNotFoundE... |
<template>
<div>
<h3>Formulaire</h3>
<form v-on:submit.prevent="submitForm" class="mt-4">
<div class="mb-3">
<label for="frontTitle" class="form-label">Titre</label>
<input type="text" v-model="form.frontTitle" class="form-control" id="frontTitle"
... |
package com.online_reservation.Flight_Booking.Service;
import com.online_reservation.Flight_Booking.DTO.PassengerDTO;
import com.online_reservation.Flight_Booking.DTO.FlightDataDTO;
import com.online_reservation.Flight_Booking.DTO.NewBookingDTO;
import com.online_reservation.Flight_Booking.DTO.NewBookingDTOfromFE;
impo... |
import "reflect-metadata";
import { __prod__, COOKIE_NAME } from "./constants";
import express from "express";
import { ApolloServer } from "apollo-server-express";
import { buildSchema } from "type-graphql";
import { HelloResolver } from "./resolvers/hello";
import { PostResolver } from "./resolvers/post";
import { Us... |
import { Schema, model, Document } from "mongoose";
import { Chat } from "./chat";
import uniqueValidator from "mongoose-unique-validator";
import { UserType } from "./user";
export interface Message extends Document {
_id?: string;
sender: string | UserType;
body: string;
chat: string | Chat;
}
const message... |
#include "shell.h"
/**
**_strncpy - copies a string
*@dest: the destination
*@src: the source
*@n: number of characters
*Return: the concatenated string
*/
char *_strncpy(char *dest, char *src, int n)
{
int a, b;
char *st = dest;
a = 0;
while (src[a] != '\0' && a < n - 1)
{
dest[a] = src[a];
a++;
}
i... |
/* Module imports */
import { async, getTestBed, TestBed } from '@angular/core/testing';
import { BehaviorSubject, of, Subject, throwError } from 'rxjs';
/* Test configuration imports */
import { configureTestBed } from '@test/configure-test-bed';
/* Mock imports */
import { mockAuthor, mockGrainBill, mockHopsSchedul... |
<?php
namespace frontend\controllers;
use common\models\DocumentEmis;
use common\models\DocumentEmisSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
/**
* DocumentEmisController implements the CRUD actions for DocumentEmis model.
*/
class DocumentEmisController extends... |
from dependency_injector.wiring import (
Provide,
inject,
)
from fastapi import (
APIRouter,
Depends,
HTTPException,
status,
)
from returns.result import (
Success,
Failure,
)
from app.containers.api.services import ServiceContainer
from app.auth.utils.token_payload import CurrentToken
... |
"use strict";
const { Model } = require("sequelize");
module.exports = (sequelize, DataTypes) => {
class Order extends Model {
/**
* Helper method for defining associations.
* This method is not a part of Sequelize lifecycle.
* The `models/index` file will call this method automat... |
using MediatR;
using Poc.BucketS3.Domain.Commands;
using Poc.BucketS3.Domain.Interfaces;
namespace Poc.BucketS3.Domain.Handlers;
/// <summary>
/// Handler for creating a new S3 bucket.
/// </summary>
/// <remarks>
/// Initializes a new instance of the <see cref="CreateBucketHandler" /> class.
/// </remarks>
... |
import React, { useState } from 'react'
import "./sidebar.css";
import MainContent from '../mainContaint/MainContent';
import Navbar from '../navBar/Navbar';
import { BsNut } from 'react-icons/bs';
import { PiKey } from "react-icons/pi";
import { BiCube } from "react-icons/bi";
import { FaRegUserCircle } from 'react-ic... |
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ProductRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get th... |
#!/bin/bash
#
# disable-services.sh
#
# A walkthrough script for stopping and disabling services
#
# Sam DeCook
# Feb. 2024
clear
if [[ "$(id -u)" != "0" ]]
then
printf "${error}ERROR: The script must be run with sudo privileges!${reset}\n"
exit 1
fi
printf "${info}If your machine doesn't have systemctl... |
# !/usr/bin/env/ python
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.remote.webdriver import WebDriver
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
class BasePage:
def __init__(self, base_url: WebDriver = No... |
{{!< default}}
<main class="site__content background-alternate">
<section
class="section section--only-top print-padding-none"
aria-labelledby="h__header"
>
<div class="container">
{{#tag}}
<div class="article">
<div class="article__meta"... |
# Knowledge
- ### elementwise
- 각 계산을 한번에 실행함 / element별로 계산함
- 숫자가 클 때 유리하다
- ### Numpy
- numpy는 mutable이다
- 그래서 copy를 사용한다
- np.copy는 default가 deep copy다
- 이때의 copy는 **deep copy**이다
- np.view 는 default가 **shallow copy**다
- 사용 시기는 **원본 데이터를 지키고 싶을때 np.copy**
-
- copy의 종류가 여러개가 존재한다
- **d... |
const crypto = require('crypto');
const mongoose = require('mongoose');
const validator = require('validator');
const bcrypt = require('bcryptjs');
const userSchema = new mongoose.Schema({
name: {
type: String,
required: [true, 'Please tell us your name!'],
},
email: {
type: String,
required: [tr... |
const OrganizationRead = {
template: `
<div>
<b-overlay :show="isLoading">
<div v-if="organization">
<b-row class="mb-5">
<b-col v-if="organization.logo" cols="12" sm="auto">
<figure class="figure mx-5">
<b-img :src="organization.logo.image_url + '... |
package com.bridgelabz.student;
public class StudentManager {
private Student[] students;
private int capacity;
private int size;
// Constructor
public StudentManager(int capacity) {
this.capacity = capacity;
this.students = new Student[capacity];
this.size = 0;
}
... |
import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
import numpy as np
pygame.init()
display_width = 800
display_height = 600
display = pygame.display.set_mode((display_width, display_height), DOUBLEBUF | OPENGL)
pygame.display.set_caption("3D Transformations")
glClearColor(0.0... |
import { useState, useEffect } from "react";
import "./regurgitator.scss";
export default function RegurgitatorCore({
target,
children,
onRegurgitationChange,
overideRegurgitation,
}: {
target: string[];
children: any;
onRegurgitationChange?: Function;
overideRegurgitation?: string[];
}) {
const [reg... |
package org.neatcode;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
public class GameService {
private Queue<Player> players;
private Queue<Player> leaderBoard;
private Map<Integer, Integer> currentP... |
"use strict";
// In this challenge, a farmer is asking you to tell him how many
// legs can be counted among all his animals. The farmer breeds three species:
// chickens = 2 legs
// cows = 4 legs
// pigs = 4 legs
// The farmer has counted his animals and he gives you a subtotal for each species.
// You ha... |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!--/* BOOTSTRAP */-->
<link th:rel="stylesheet" th:href="@{/webjars/bootstrap/5.3.2/css/bootstrap.min.css} "/>
<!--/* STYLE */-->
<link rel="stylesheet" th:href="@{/css/style.css}" >
<title>Insert title here</title>
</head>
<body th:object="${pizza}">
<header ... |
require("dotenv").config();
import { Request, Response, NextFunction } from "express";
const User = require("../models/user");
const path = require("node:path");
const sendMail = require("../utils/sendMail");
const bycrypt = require("bcrypt");
const JWT = require("jsonwebtoken");
const sendToken = require("../utils/jw... |
import CreateTweet from "@/components/ui/CreateTweet";
import TweetCard, { TweetCardSkeleton } from "@/components/ui/TweetCard";
import { Tweet } from "@/types/Tweet";
import { Box, VStack } from "@chakra-ui/react";
import {
DocumentData,
FirestoreDataConverter,
QueryDocumentSnapshot,
SnapshotOptions,
collection,
... |
// https://codeforces.com/problemset/problem/1249/B1
// 1249B1 - Books Exchange (easy version)
// The only difference between easy and hard versions is constraints.
// There are n kids, each of them is reading a unique book. At the end of any day, the i-th kid will give his book to the pi-th kid (in case of i=pi the... |
package com.ca.mfd.prc.pm.entity;
import io.swagger.v3.oas.annotations.media.Schema;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.j... |
// Copyright 2023 Ant Group Co., Ltd.
//
// 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 ... |
import express from 'express';
import { Author } from '../entities/Author';
import { Article } from '../entities/Article';
import defaultDataSource from '../datasource';
const router = express.Router();
interface CreateArticleParams {
title: string;
body: string;
authorId: number;
}
interface UpdateArtic... |
<template>
<div v-if="product.valueOf()" class="flex">
<div class="w-1/2 px-16">
<PhotoGalleryView />
</div>
<div class="w-1/2 px-16">
<div class="divide-y divide-black divide-opacity-25">
<div class="m-4 mb-8">
<ProductTextDetailView :product="product.valueOf()" />
... |
using FluentAssertions;
using FormulaApp.Api.Controllers;
using FormulaApp.Api.Models;
using FormulaApp.Api.Services.Interfaces;
using FormulaApp.UnitTests.Fixtures;
using Microsoft.AspNetCore.Mvc;
using Moq;
namespace FormulaApp.UnitTests.Systems.Controllers;
public class TestFansController
{
[Fact]
public a... |
# Unveiling the World of DSA with C++ 🔍🔮
Hey there, fellow coding enthusiasts! 👋 Welcome to an exhilarating journey into the realm of Data Structures and Algorithms (DSA) using the power of C++. Today, I'm your guide on this exciting quest for knowledge and coding prowess. 🌟
## Let's Dive In: Binary Search Implem... |
import { Inter } from 'next/font/google'
import React, { useState } from 'react';
import {
Button,
Form,
Input,
Upload
} from 'antd';
import { InboxOutlined } from '@ant-design/icons';
import { createAccount, setUserData, uploadImg } from '@/config/firebase';
import { useRouter } from 'next/router';
c... |
import React, { FC } from "react";
import cn from "classnames";
import { ImageListItem } from "@mui/material";
import "./style.css";
import ImageMask from "./ImageMask";
interface IProps {
key: any;
src: string;
chosen: boolean;
setChosen: () => void;
}
const ImageItem: FC<IProps> = ({ key, src, chosen, setCh... |
import React, {useState} from "react";
import Breadcrumbs from "../breadcrumbs/breadcrumbs";
import CartItem from "../cart-item/cart-item";
import {useSelector} from "react-redux";
import {priceFormat, getSumWithCoupon} from "../../util";
import {PageTitle, AppRoute, Coupon} from "../../const";
import {Link} from "reac... |
import { Test, TestingModule } from '@nestjs/testing';
import { AuthResolver } from './auth.resolver';
import { AuthApplicationService } from '../application/auth-application.service';
import { describe } from 'node:test';
import { SigninUserInput } from './dto/signin-user.input';
import { SignupResponse } from './dto/... |
import { useAppDispatch, useAppSelector } from 'hooks/redux';
import { IconClose } from 'icons';
import { GlobalMessageVariants } from 'models/IGlobalMessage';
import { useEffect } from 'react';
import { appSlice } from 'store/reducers/AppSlice';
import styles from './GlobalMessage.module.scss';
const GlobalMessage = ... |
import React from 'react';
import classNames from 'classnames';
import { Typography, TypographyProps } from '../Typography/Typography.tsx';
import styles from './Title.module.css';
interface TitleProps extends TypographyProps {
level?: '1' | '2' | '3';
}
const Title = function ({
Component,
level = '1',
... |
package main
import (
"math"
"time"
)
type State struct {
Name string
ImageName string
ImageLicense string
ImageLicenseLink string
WeatherAverages map[Season]WeatherAverages
}
type WeatherAverages struct {
Temperature float64
Sunshine int
Humidity int
}
type Season int
const... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.