text stringlengths 184 4.48M |
|---|
import { env } from '$env/dynamic/public'
import { subjectsStore, lessonSearchParamsStore } from '/src/stores/lessonStore'
import { get } from 'svelte/store'
import { responseService } from "/src/utils/responseService"
export async function getSubjects()
{
const response = await fetch(import.meta.env.VITE_API_URL ... |
#include "ClapTrap.hpp"
int main(void)
{
ClapTrap mario("mario");
ClapTrap gigi("gigi");
ClapTrap gennaro("gennaro");
gennaro.setAttackDamage(42);
gennaro.setHitPoints(42);
gennaro.setEnergyPoints(42);
// //attack with reference (not requested by subject)
// mario.setAttackDamage(10);
// mario.attackWithRef... |
import { forwardRef, InputHTMLAttributes, ReactNode } from 'react'
import { PaymentMethodContainer, LabelContainer } from './styles'
type PaymentMethodProps = InputHTMLAttributes<HTMLInputElement> & {
label: string
icon: ReactNode
}
// eslint-disable-next-line react/display-name
export const PaymentMethodInput = ... |
import React, { createContext, useContext, useEffect, useState } from "react";
import {
GoogleAuthProvider,
createUserWithEmailAndPassword,
onAuthStateChanged,
signInWithEmailAndPassword,
signInWithPopup,
signOut,
} from "firebase/auth";
import { auth } from "../Firebase";
const UserAuthContext = createCo... |
#include <rawrbox/ui/container.hpp>
#include <rawrbox/ui/scripting/wrappers/ui_container_wrapper.hpp>
namespace rawrbox {
UIContainerWrapper::UIContainerWrapper(const std::shared_ptr<rawrbox::UIContainer>& ref) : _ref(ref) {}
UIContainerWrapper::~UIContainerWrapper() { this->_ref.reset(); }
rawrbox::UIContainer* U... |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>MDATA Tricks</title>
<meta content="Garrett Kaminaga" name="author">
</head>
<body>
<p><a name="appx"></a></p>
<h1>MDATA Tricks<br>
</h1>
My idea was to ha... |
//给你一个整数 n ,请你找出并返回第 n 个 丑数 。
//
// 丑数 就是只包含质因数 2、3 和/或 5 的正整数。
//
//
//
// 示例 1:
//
//
//输入:n = 10
//输出:12
//解释:[1, 2, 3, 4, 5, 6, 8, 9, 10, 12] 是由前 10 个丑数组成的序列。
//
//
// 示例 2:
//
//
//输入:n = 1
//输出:1
//解释:1 通常被视为丑数。
//
//
//
//
// 提示:
//
//
// 1 <= n <= 1690
//
// Related Topics 哈希表 数学 动态规划 堆(优先队列) 👍 8... |
import agent from '@/api/agent';
import Button from '@/components/buttons/Button';
import { useAddItemMutation, useGetBasketQuery } from '@/redux/services/bakset';
import { IProduct } from '@/types/products';
import Image from 'next/image';
import Link from 'next/link';
import { useEffect } from 'react';
import { FiSho... |
// ***********************************************
// -lm -lglut -lGLU -lGL
// Draw the shape (Click 4 points)
// press 'e' to translate
// press 'r' to rotate
// press 't' to scale
// press 'w' for up
// press 's' for down
// press 'a' for left
// press 'd' for right
//
// *... |
--@Autores: Emanuel Flores, Adolfo Barrero
--@Fecha creación: 01/12/2019
--@Descripción: Guarda las fotos de una mascota en el servidor
create or replace trigger guarda_mascota_foto
after insert or update on mascota
for each row
declare
v_blob blob;
v_nombre_directorio varchar2(30) := 'DATA_SERVER';
v_nomb... |
#!/bin/sh
# backup - Backup home folder to a remote address using borg.
#
# Setup:
# ======
# Add this to your `.zshenv` or similar:
# export BORG_PASSPHRASE=""
# export BORG_REPO=""
#
# Usage:
# ======
# To create: borg init -e repokey-blake2
# To export key: borg key export --paper > $(echo "$(hostname)-borg-key.txt... |
import React from 'react';
import calender from '../assets/calender.png';
import green_clock from '../assets/green_clock.png';
import spoon from '../assets/spoon.png';
import red_clock from '../assets/red_clock.png';
interface Task {
id: string;
creatorName: string;
name: string;
type: string;
deadline: stri... |
---
tree_title: Educative-Microsoft
description: This will cover up the problems/questions from the Microsoft Educative course.
last_modified: 2022-06-22T12:03:49.349
---
# Educative-Microsoft
## Top coding questions to crack interview @Microsoft
<div class="educative-microsoft-container">
<div class="educative-mic... |
---
title: "Computer Security Principles and Practice"
permalink: /Computer-Security-Principles-and-Practice/24-Wireless-Network-Security/
layout: default
---
# 24-Wireless Network Security
# **24.1 Wireless Security**
* Key factors: contributing to higher security risks (v.s. wired networks)
* Channel
... |
import { POST } from "@/helper/api_helper";
import { BASE_URL, LOGIN_URL, REGISTER_URL } from "@/helper/url_helper";
import { useUserStore } from "@/store/userStore";
import { useRouter } from "next/navigation";
import { useEffect, useState } from "react";
import Label from "./Label";
type AuthProps = {
type: string;... |
import StringReader from './StringReader.js'
// Scanner is an iterator class for scanning tokens within .p69 files.
export default class Scanner {
constructor(content) {
this._sr = new StringReader(content)
this._prefix = '$'
this._escapedPrefix = this._escapeForRegex(this._prefix)
this._prefixRegex = new Re... |
// this contains home page content
import { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import { Swiper, SwiperSlide } from 'swiper/react';
import { Navigation } from 'swiper/modules';
import SwiperCore from 'swiper';
import 'swiper/css/bundle';
import ListingItem from '../components/Li... |
import { useParams } from "react-router-dom"
import {useProduct} from "../../contexts/productContext"
import Banner from "../../components/Banner/Banner"
import shopSingleImg from "../../assets/images/shop-single.png"
import ProductCard from "../../components/Productcard/ProductCard"
import { BsStarFill } from "react-i... |
{% extends 'base.html.twig' %}
{% block title %}Listes des genres{% endblock %}
{% block body %}
<div class="container ">
<nav class="nav navbar">
<div class="col-sm-6">
<h1>Liste des genres</h1>
{{ include('_flash_messages.html.twig') }}
</div>
... |
import { Injectable } from '@nestjs/common';
import { HttpService } from '@nestjs/axios';
import { map } from 'rxjs';
@Injectable()
export class SpeciesService {
constructor(private httpService: HttpService) {}
async findSpecies(id: number) {
const data = this.httpService
.get(`https://pok... |
#include "tracker.as"
#include "helpers.as"
#include "admin_manager.as"
#include "log.as"
#include "query_helpers.as"
#include "game_timer.as"
#include "score_tracker.as"
#include "stage_snd.as"
#include "player_manager.as"
#include "vip_tracker.as"
#include "hitbox_handler.as"
// ------------------------------------... |
import { Injectable } from '@angular/core';
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Router, ActivatedRoute } from '@angular/router';
import { Observable } from 'rxjs';
import { AuthenticationService } from '../services/authentication.service';
import { take, map, tap } from 'rxjs/ope... |
//! This is a copy-paste of necessary types from `zksync-2-dev`
//! repository to avoid having a dependency on it.
//!
//! These are strictly the types that are necessary for
//! interacting with the RPC endpoints.
use chrono::{DateTime, Utc};
use ethers::{
abi::RawLog,
types::{Address, Bloom, Bytes, H160, H25... |
import { ShipsType } from '../types';
function collision(ships: ShipsType, locations: string[]) {
for (let i = 0; i < ships.length; i += 1) {
const shipLocations = ships[i].locations;
const allLocation = [...shipLocations];
for (let z = 0; z < shipLocations.length; z += 1) {
const shipLocationX = ... |
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server... |
_package user
$
#remex(:sw_tree_action)
$
_pragma(classify_level=basic, topic={graphics})
def_slotted_exemplar(:sw_tree_action,
## action, similar to sw_action, dedicated to tree_items.
##
{
{:name, _unset, :readable},
{:engine, _unset},
{:control, _unset},
{:properties, _... |
import React from "react";
import { useAuth0 } from "@auth0/auth0-react";
import { Link } from "react-router-dom";
export const Navbar = () => {
const { loginWithRedirect, logout, isAuthenticated, user } = useAuth0();
return (
<div>
<nav className="navbar navbar-expand-sm navbar-light bg-light">
... |
use std::sync::Arc;
use std::time::SystemTime;
use alacritty_terminal::index::Side;
use alacritty_terminal::selection::{Selection, SelectionType};
use alacritty_terminal::term::search::Match;
use alacritty_terminal::term::RenderableContent;
use alacritty_terminal::{
grid::Dimensions,
term::{cell::Flags, test::... |
import { BrowserRouter, Route, Routes } from "react-router-dom";
import Authentication from "./Pages/Authentication/Authentication";
import Dashboard from "./Pages/Dashboard/Dashboard";
import Administration from "./Pages/Dashboard/sub-components/Administration";
import AdminList from "./Pages/Dashboard/sub-components/... |
title:: Event Stream
categories:: Streams-Patterns-Events
related:: Classes/Stream, Classes/Event
summary:: A Stream that returns Events when called
An event stream is a normal link::Classes/Stream:: that returns events when called. (see class link::Classes/Event::). Usually, an event stream requires an event to be pa... |
package com.lvchuan.export;
import com.alibaba.excel.write.handler.WriteHandler;
import com.lvchuan.common.page.PageRequest;
import java.util.LinkedHashMap;
import java.util.List;
/**
* @description: 动态导出服务接口
* @author: lvchuan
* @createTime: 2023-12-06 10:56
*/
public interface IDynamicExportHandler<T> {
/*... |
import {
isElemNode,
findNodes,
removeNode,
unwrapNode,
insertBeforeNode,
appendNodes,
} from '@/utils/dom';
const reMSOListClassName = /MsoListParagraph/;
const reMSOStylePrefix = /style=(.|\n)*mso-/;
const reMSOListStyle = /mso-list:(.*)/;
const reMSOTagName = /O:P/;
const reMSOListBullet = /^(n|u|l)/;
... |
module Day22 (day22) where
import Common
import PathFinding
import Control.Monad.State
import Data.HashMap.Strict qualified as M
import Text.Parsec qualified as P
day22 :: AOCSolution
day22 input = show <$> ([part1, part2] <*> pure (target, g))
where
(depth, target) = parseInput input
g = buildGraph depth t... |
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:sarang_app/src/app.dart';
import 'package:sarang_app/src/features/authentication/presentation/bloc/auth_bloc.dart';
import 'package:sarang_app/src/features/likes_you/presentation/bloc/explore_people/explore_people_b... |
package com.example.sensorsproject
import android.annotation.SuppressLint
import android.graphics.Color
import android.hardware.Sensor
import android.hardware.SensorEvent
import android.hardware.SensorEventListener
import android.hardware.SensorManager
import androidx.appcompat.app.AppCompatActivity
import android.os.... |
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:mobx/mobx.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:url_launcher/url_launcher.dart';
part 'register_text_screen.g.dart';
c... |
#ifndef _STR_StreamModule_H_ // -*- mode: c++ ; c-file-style: "hopper" -*-
/*
* Copyright 1991-2010 Eric M. Hopper <hopper@omnifarious.org>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Fre... |
# [백준] 2565. 전깃줄 - Python
**[Gold V]**
https://www.acmicpc.net/problem/2565
## 풀이
전깃줄이 교차하는 경우를 생각해 보자.
A 전봇대에서 B 전봇대로의 모든 전깃줄을 시작부터 숫자가 작은 순서대로 하나하나 연결한다고 생각할 때,
도착하는 위치가 이미 존재하는 도착지들보다 더 작은 숫자라면, 전깃줄이 교차하게 된다.
따라서 그러한 전깃줄들을 제거하면 되는 문제이다.
이 과정에서, A 전봇대에서의 출발 위치를 기준으로 정렬하게 되면, 아래와 같다.
```python
[[1, 8],... |
import {useEffect, useState} from "react";
import {UseSSEHookData} from './useSSE.types.ts'
const getStateChanges = (eventSource) => {
switch (eventSource.readyState){
case eventSource.CONNECTING:
return {
loading: true,
open: false
}
case eve... |
import PropTypes from 'prop-types';
import { HiOutlineBookOpen } from 'react-icons/hi2';
import { FiDollarSign } from 'react-icons/fi';
const Course = ({ course, handleSelectedCourse }) => {
const { title, img, description, price, hours } = course;
return (
<>
<div className="bg-[#FFF] p-4 r... |
#pragma once
#include <mainframe/utils/string.h>
#include <mainframe/ui/modifierkey.h>
#include <string>
#include <map>
#include <nlohmann/json.hpp>
#include <fmt/format.h>
namespace bt {
class KeyMapping {
public:
size_t key = 0;
mainframe::ui::ModifierKey modifier;
bool operator==(const KeyMapping& other)... |
/*
*
* Component: `TableBody`.
*
*/
import { memo, Fragment, useCallback } from "react";
import createLazyLoadedComponent from "@exsys-patient-insurance/react-lazy";
import {
TableRowRecordType,
ColorNamesType,
TableColumnProps,
TableSelectionProps,
TableSelectionKeysType,
TableExpandedRowRenderType,
... |
import { newChain, addBlockToChain } from "../blockchain/blockchain";
import { blockToString } from "../blockchain/block";
import express from "express";
import cors from "cors"
import { createProxyMiddleware } from "http-proxy-middleware";
import { newP2PServer, P2PServerListen, P2PSyncChain } from "./p2pServer";
co... |
import contextlib
from rest_framework.permissions import DjangoModelPermissions
from rest_framework.serializers import ModelSerializer, ValidationError
from rest_framework import serializers
from django.contrib.auth import get_user_model
from account.models import *
from home.models import *
User = get_user_model()
... |
package br.com.brjdevs.miyuki.modules.db;
import br.com.brjdevs.miyuki.core.Module;
import br.com.brjdevs.miyuki.core.Module.*;
import br.com.brjdevs.miyuki.core.entities.ModuleResourceManager;
import br.com.brjdevs.miyuki.modules.cmds.PushCmd;
import br.com.brjdevs.miyuki.modules.cmds.manager.PermissionsModule;
impor... |
import { useState } from "react";
import { Link, useLocation } from "react-router-dom";
import "./Navbar.style.scss";
import logo from "../../logo.png";
export const Navbar = () => {
const [menuVisible, setMenuVisible] = useState(false);
const location = useLocation();
const toggleMenu = () => {
setMenuVisi... |
package com.sixint.dscatalog.services;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.when;
import static org.mockito.ArgumentMatchers.any;
import java.util.List;
import java.util.Optional;
import javax.persistence.EntityNotFoundException;
i... |
const express = require('express')
const app = express()
const cors = require('cors')
var bodyParser = require('body-parser')
const path = require('path');
// database connection
require('./config/database');
app.use('/uploads', express.static(path.join(__dirname, 'uploads')));
app.use(
cors(
{
origin: '... |
import time
import warnings
from functools import lru_cache
from typing import Optional, Dict, Union
import httpx
import requests
from random_user_agent.params import SoftwareName, OperatingSystem
from random_user_agent.user_agent import UserAgent
from requests.adapters import HTTPAdapter, Retry
DEFAULT_TIMEOUT = 10 ... |
<!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>Document</title>
</head>
<body>
<script>
// 在js中,一个对象是不允许作为另一个对象的属性名的
// 比如在如下的例子中,编译器会... |
<?php
/**
* The file that defines the core plugin class
*
* A class definition that includes attributes and functions used across both the
* public-facing side of the site and the admin area.
*
* @link https://www.welaunch.io
* @since 1.0.0
*
* @package WooCommerce_Catalog_Mode
* @subpackage Wo... |
<template>
<div id="setting" class="container">
<div class="navbar">
<Navbar :current-status="currentStatus" />
</div>
<div class="setting-account">
<div class="title">
<h1>帳戶設定</h1>
</div>
<!-- form block -->
<form class="setting-form" @submit.stop.prevent="for... |
import { Add, Send } from '@mui/icons-material';
import { Button, styled } from '@mui/material';
import React from 'react';
const ButtonDemo = () => {
const BlueButton = styled(Button)(({ theme }) => ({
backgroundColor: theme.palette.otherColor.main,
color: '#888',
margin: 5,
'&:hover': {
backgroundColor: ... |
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { BaseLayoutComponent } from './layouts/base-layout/base-layout.component';
import { AdminLayoutComponent } from './layouts/admin-layout/admin-layout.component';
import { ProductListComponent } from './pages/admin/p... |
package org.kalibro.core.abstractentity;
import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import org.junit.Before;
import org.junit.Test;
import org.yaml.snakeyaml.Yaml;
public class CollectionPrinterTest extends PrinterTestCase<Collection<?>> {
... |
'''
Copyright (c)2022 - Soffos.ai - All rights reserved
Updated at: 2023-10-09
Purpose: Easily use Emotion Detection Service
-----------------------------------------------------
'''
from .service import SoffosAIService
from .input_config import InputConfig
from soffosai.common.constants import ServiceString
from typin... |
using System;
using System.Runtime.CompilerServices;
using ToolSmiths.InventorySystem.Data.Enums;
using UnityEngine;
[assembly: InternalsVisibleTo("Tests")]
namespace ToolSmiths.InventorySystem.Data
{
/// <summary>
/// StatModifier have a type to determine how they apply their modifier value.
/// </summa... |
/**********************************************************
Add Google Fonts
**********************************************************/
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700;900&family=Nunito:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,200&family=Poppins:wght@300;400;500;600... |
import pygame as pg
import sys
import random
def main():
clock = pg.time.Clock()
# 練習1:スクリーンと背景画像
pg.display.set_caption("逃げろ!こうかとん")
screen_sfc = pg.display.set_mode((1600, 900)) # Surface
screen_rct = screen_sfc.get_rect() # Rect
bgimg_sfc = pg.image.load("fig/pg_bg.jpg") # Sur... |
#pragma once
namespace bsc
{
template <typename T>
struct vec4
{
union
{
struct { T x, y, z, w; };
struct { T r, g, b, a; };
struct { T p, q, s, t; };
T data[4];
};
vec4 ( void );
vec4 ( T v );
vec4 ( T x, T y,... |
<template>
<div class="container2">
<div class="login-form" style="max-width: 500px;">
<ValidationObserver v-slot="{ invalid }">
<form @submit.prevent="registers">
<h1 style="margin-left:42px">ĐĂNG KÝ</h1>
<div class="input... |
package com.example.greenwizard.viewmodel
import android.app.Application
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.LiveData
import androidx.lifecycle.viewModelScope
import com.example.greenwizard.data.LocationDatabase
import com.example.greenwizard.model.RecyclePoint
import com.example.green... |
import { useKeenSlider } from 'keen-slider/react';
import React, { useEffect, useState } from 'react';
import { Spinner } from 'react-activity';
import { Link, useParams, useSearchParams } from 'react-router-dom'
import AdCard from '../components/AdCard';
import { getAds } from './../api';
import { ArrowArcLeft, Check ... |
# coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
import React, { useEffect, useState } from 'react'
import { Form, Input, message, Select } from 'antd'
import { ButtonDanger, ButtonPrimary } from '@components/button/ButtonCustom'
import FormCustom from '@components/form/FormCustom'
import ModalCustom from '@components/modal/ModalCustom'
import UploadImage from '@com... |
package controller;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Scanner;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import entity.Task;
import impl.TaskDAOImpl;
import entity.TaskInfo;
public class ToDoListA... |
/* eslint-disable no-unused-vars */
import React, { useContext } from 'react';
import { Button, Container, Form, Nav, Navbar } from 'react-bootstrap';
import logo from '../../assets/icons/calender_icon.png'
import { AuthContext } from '../../Providers/AuthProvider';
import { Link } from 'react-router-dom';
const Heade... |
using Application.Commons;
using Application.IServices;
using DataAccess;
using Domain.Entities.Groups;
using Domain.Enums;
using Infrastructure.IRepositories.Groups;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;... |
using BlazorTraining.WebApi.Features.Blog;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSw... |
import Meta from '../components/Meta';
import EmptyBox from '../components/EmptyBox';
import { useState } from 'react';
function Watermark(){
const [imageurl, setImageurl] = useState(null);
const [loaded, setLoaded] = useState(false);
const metaDatas = {
title: "블록툴툴 워터마크",
description... |
# Backend
Backend service for the game. Computes the bot player's next move in the game board. This is done by applying the minimax algorithm with alpha-beta pruning.
## Development
Run `cargo run` to start the server.
By default the server is bound to 0.0.0.0:8080 but during development one may want to modify thes... |
<template>
<div class="c-chart__container">
<v-chart ref="chart" :option="chartOptions" />
</div>
</template>
<script>
import moment from "moment";
import { use } from "echarts/core";
import { CanvasRenderer } from "echarts/renderers";
import { LineChart } from "echarts/charts";
import {
TitleComponent,
To... |
import React from 'react';
import { Doughnut } from 'react-chartjs-2';
import { Chart, ArcElement } from 'chart.js';
import Labels from './Labels';
import { default as api } from '../store/apiSlice';
import { chartData, getTotal } from '../helper/helper';
Chart.register(ArcElement);
function Graph() {
const { dat... |
import { Component, OnInit, ElementRef, ViewChild } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { Router } from '@angular/router';
import Swal from 'sweetalert2';
import { Booking, User } from '../interfaces/interfaces';
import { AdminService } from '../services/adm... |
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('penduduk', function (Blueprint $table) {
... |
# Tic Tac Toe 게임 만들기
## 1. App 컴퍼넌트 만들기
- 기본 구조 준비
## 2. Board, Square 컴퍼넌트 만들기
- components / Board.js
- components / Sqaure.js
### (1) 3 X 3 게임판 만들기
### (2) 간단한 스타일링
## 3. props를 통해서 컴퍼넌트간 데이터 전달하기
- 부모(Board)에서 전달한 숫자를 Square Component에 출력하기
## 4. 사용자와 상호 작용하는 컴퍼넌트 만들기
- Square Component를 클릭하면 "click" 로그를 출력
#... |
import React from 'react';
import { Button, Modal } from 'rsuite';
import { useModalState } from '../../../misc/custom-hooks';
import ProfileAvatar from '../../dashboard/ProfileAvatar';
const ProfileInfoBtnModal = ({profile, children, ...btnProps}) => {
const {isOpen, open, close} = useModalState()
const {nam... |
#!/usr/bin/python3
"""create an empty class called Square"""
class Square:
"""create a square.
size (no type/value verification)
atributes:
size: private instance.
"""
def __init__(self, size=0):
self.__size = size
def area(self):
return self.__size * self.__size
@pr... |
const asyncHandler = require("express-async-handler")
const bcrypt = require("bcrypt");
const jwt = require("jsonwebtoken");
const User = require("../models/userModel");
const registerUser = asyncHandler(async (req,res)=>{
const {username, email , password } = req.body;
if(!username || !email || !password){... |
import Proyecto from "../models/Proyecto.js"
import Tarea from "../models/Tarea.js"
const agregarTarea = async (req,res) => {
const proyecto = req.body.proyecto
const proyectoExiste = await Proyecto.findById(proyecto)
if(!proyectoExiste){
const error = new Error("El Proyecto no existe")
re... |
<template>
<Layout v-bind="$attrs">
<template v-slot:banner>
<div
class="pt-6 text-center print:hidden"
:class="showReset ? 'pb-4' : 'pb-10'"
>
<p class="text-lg xl:text-xl font-bold">{{ searchTitle }}</p>
<ContentWrappe... |
<!DOCTYPE html>
{% load static %}
<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">
<meta name="description" content="Responsive Bootstrap4 Shop Template, Created by Imran Hossain from https://imr... |
<template>
<div id="app">
<tool-bar />
<router-view></router-view>
<Spinner :loading="lodingStatus" />
</div>
</template>
<script>
import ToolBar from './components/ToolBar.vue';
import Spinner from './components/Spinner.vue'
import Bus from './utils/bus.js';
export default {
name: 'App',
d... |
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... |
---
title: Web アプリケーションのレイアウトに flexbox を使用する
slug: Web/CSS/CSS_Flexible_Box_Layout/Using_flexbox_to_lay_out_web_applications
tags:
- Advanced
- CSS
- CSS Flexible Boxes
- Example
- Guide
- Web
translation_of: Web/CSS/CSS_Flexible_Box_Layout/Typical_Use_Cases_of_Flexbox
translation_of_original: Web/CSS/CSS_F... |
const AppError = require('./../utils/appError');
const sendErrorDevelopment = (err, req, res) => {
if(req.originalUrl.startsWith('/api'))
{
return res.status(err.statusCode).json({
status: err.status,
statusCode: err.statusCode,
message: err.message,
error... |
package net.x3djsonld.data;
import org.web3d.x3d.jsail.Core.*;
import org.web3d.x3d.jsail.EnvironmentalEffects.*;
import org.web3d.x3d.jsail.fields.*;
import org.web3d.x3d.jsail.Geometry2D.*;
import org.web3d.x3d.jsail.Grouping.*;
import org.web3d.x3d.jsail.Lighting.*;
import org.web3d.x3d.jsail.Navigation.*;
import o... |
import { cbtPrint } from 'hy-algokit'
class Heap<T> {
data: T[] = []
// 交换
swap(x: number, y: number) {
let temp = this.data[x]
this.data[x] = this.data[y]
this.data[y] = temp
}
insert(ele: T) {
this.heapifyUp(ele)
}
// 上滤操作
heapifyUp(ele: T) {
this.data.push(ele)
let index... |
import "./globals.css";
import { Toaster } from "react-hot-toast";
import { Suspense } from "react";
import type { Metadata } from "next";
import { Nunito } from "next/font/google";
import Navbar from "@/components/custom/Navbar";
import Loading from "./loading";
const nunito = Nunito({
weight: ["300", "400", "600"]... |
package road.core;
/**
*
* V2d represents a vector in a 2d space
*
*/
public record V2d(double x, double y) {
public static V2d makeV2d(final P2d from, final P2d to) {
return new V2d(to.x() - from.x(), to.y() - from.y());
}
public V2d sum(final V2d v){
return new V2d(this.x +v.x, this.y... |
// Copyright © 2023 Apple Inc.
#include <cassert>
#include <functional>
#include <limits>
#include "mlx/backend/common/reduce.h"
#include "mlx/primitives.h"
namespace mlx::core {
namespace {
template <typename U>
struct Limits {
static const U max;
static const U min;
};
#define instantiate_default_limit(type... |
<script setup>
import { reactive } from 'vue';
import DeleteBtn from './DeleteBtn.vue';
const pokemon = reactive({
savedPokemon:[],
signedInEmail: localStorage.getItem('userEmail') || ''
})
let user = pokemon.signedInEmail
import { computed } from 'vue';
const filteredPokemon = computed(() => {
if (!user)... |
import React, { useState, useEffect } from 'react';
import {
Box, Flex, Text, IconButton, Stack, useColorModeValue,
Icon, Button, Menu, MenuButton, MenuList, MenuItem,
Avatar, Image
} from "@chakra-ui/react";
import {
FiHome, FiMenu, FiUser, FiBarChart2, FiBookOpen, FiInfo, FiLogOut, FiActivity
} from "react-ic... |
import {
Body,
Controller,
Get,
Res,
Req,
HttpCode,
HttpStatus,
Post,
Request,
UnauthorizedException,
UseGuards,
Ip,
} from '@nestjs/common';
import { AuthGuard } from './auth.guard';
import { AuthService } from './auth.service';
@Controller('auth')
export class AuthController {
constructor(p... |
---
date: '2006-09-14 00:40:00'
layout: post
slug: using-svnsync
status: publish
title: using svnsync
wordpress_id: '163'
---
[Garrett](http://asdf.blogs.com/) helped write svnsync as part of [Subversion 1.4](http://subversion.tigris.org/svn_1.4_releasenotes.html), but I wasn't able to find any documentation for it, o... |
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:simple_moment/simple_moment.dart';
import './../../../models/_models/career_opening_model.dart';
import '../../../constants/index.dart';
import './../../../util/helper.dart';
// import './../../../util/faderoute.dar... |
// src/app/shared/free-dragging.directive.ts
import { DOCUMENT } from "@angular/common";
import { Directive, ElementRef, Inject, OnDestroy, OnInit } from "@angular/core";
import { fromEvent, Subscription, takeUntil } from "rxjs";
@Directive({
selector: "[appFreeDragging]",
})
export class FreeDraggingDirectiv... |
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
namespace Oxide.Plugins
{
[Info("Scientist Names", "Ultra", "1.1.3")]
[Description("Gives real names to scientists, bandits, murderers and scarecrows (instead of numbers)")]
class ScientistNames : RustPlugin
{
... |
---
sidebar_position: 2
title: SCOW管理员使用技巧
---
## 1. 系统报错:查看运行日志
:::tip
门户系统报错时,请查看portal-server(优先)和portal-web日志;管理系统报错时,请查看mis-server(优先)和mis-web日志。
:::
### 1.1 查看日志
各组件的实时日志是输出在`stdout`,可以通过`./cli compose logs -f `查看实时的日志输出:
```Bash
# 查看所有组件的日志
./cli compose logs -f
# 查看认证系统的日志
./cli compose logs -f auth
... |
import { getMonthName } from "../../$shared/utils";
import c from './MonthPicker.module.css';
import Text from "../Text/Text";
import { addMonths } from "date-fns";
interface Props {
month: number;
year: number;
onChange: (year: number, month: number) => void;
}
function MonthPicker(props: Props) {
const { mo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.