text stringlengths 184 4.48M |
|---|
const fs = require('fs');
const requestHandler = (req,res) =>{
const url = req.url;
const method = req.method;
if (url === '/') {
res.setHeader('Content-Type', 'text/html');
res.write('<html>');
res.write('<head>');
const messages = fs.existsSync('messages.txt') ? fs.readFil... |
# 면접 1주차
## 1. ==와 equal
### equal
+ 값 그 자체를 비교(객체 내부의 값을 비교)
### ==
+ 주소값을 비교(객체 인스턴스의 주소값을 비교)
## 2. Array, LinkedList, ArrayList의 특징
<img src="https://user-images.githubusercontent.com/101400894/210812278-015e4c0c-7944-4595-80c1-1b7f7aec8cdf.png" alt="image" style="zoom:67%;" align="left"/><img src="https:/... |
//##0. zero capture case
somestat = 9
def funto(x int ) int {
hh = 9
def inner(y int) int {
return 7 + y + somestat
}
return inner(12)
}
def doings() String {
b = funto(5)
return "" + b
}
~~~~~
//##1. simple localvar ref
somestat = 9
def funto(x int ) int {
hh = 9
def inner(y int) int {
return x+7 + y +... |
import { create } from 'zustand'
import { devtools, persist } from 'zustand/middleware'
import { type ThemeName } from '~/themes/themes'
import { createActionName, type DevTools, type Persist, type Slice } from '~/types/storeTypes'
// State
interface SettingsState {
theme: ThemeName;
}
const settingsState: Setting... |
import React from 'react';
import {shallow} from 'enzyme';
import {Input} from '@components/Input';
import RegistrationSurnameInput from '../surname/surname_input.jsx';
import {updateValues} from '@blocks/actions/form';
jest.mock('@blocks/actions/form', () => ({
updateValues: jest.fn()
}));
const componentProps =... |
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { environment } from '../environments/environment';
import { LoggedInComponent } from './menupanel/login/logged-in.component';
import { LoginComponent } from './menupanel/login/login.component';
import { PortalCompo... |
package ua.khpi.oop.darius.task02;
public class ArrayEx {
public static void main(String[] args) {
double[] numbers = { 1.1, 2.2, 3.3 };
System.out.print("Array: ");
printArray(numbers);
System.out.println();
System.out.println("calcSum1(): " + calcSum1(numbers));
System.out.println("calcSum2(): " + calcS... |
ch14-spring-mybatis: spring集成mybatis
实现步骤:
1、使用的是mysql库,使用学生表 student2(id int 主键列, 自动增长
name varchar(80)
age int
)
2、创建maven项目
3、加入依赖gav
spring, mybatis, mysql驱动
mybatis-spring依赖(mybatis网站提供,用于spring项目... |
package com.eduardo.ecommerce_golosinas.presentation.screens.profile.update
import android.content.Context
import androidx.compose.runtime.*
import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.eduardo.ecommerce_golosinas.domain.model.User
i... |
import {
Button,
Popover,
PopoverContent,
PopoverTrigger,
} from "@nextui-org/react";
import { includes } from "lodash";
import { FormattedMessage, useIntl } from "react-intl";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { postAskForOrop } from "../lib/api";
import { useState } f... |
/*
* BSD 3-Clause License
*
* Copyright (c) 2024, Bram Stout Productions
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* ... |
<!DOCTYPE html>
<html lang="pl">
<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">
<link rel="stylesheet" href="styl6.css">
<title>Style w JavaScript</title>
</head>
<body>
<div id="l... |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" >
<title>Gridea扩展(一)- 代码高亮 | GeraltXLi</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmO... |
@extends($activeTemplate . 'layouts.master_with_menu')
@section('content')
@php
$kycContent = getContent('kyc.content', true);
$walletImage = fileManager()->crypto();
$profileImage = fileManager()->userProfile();
@endphp
<div class="row gy-4">
@if ($user->kv == 0)
... |
package com.its.membership_board.service;
import com.its.membership_board.dto.BoardDTO;
import com.its.membership_board.dto.PageDTO;
import com.its.membership_board.repository.BoardRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.sprin... |
import {View, Text, Image, Dimensions, Pressable, Alert} from 'react-native';
import React, {useState, useEffect} from 'react';
import {app} from '../../../../constants/app';
import Icon from 'react-native-vector-icons/AntDesign';
import {currencyFormatter} from '../../../../helpers';
import {IProduct} from '../../../.... |
import React, {useEffect, useState} from 'react'
import { Box } from '@chakra-ui/react'
import Card from './Card'
import firebase from "firebase";
import {useNavigate} from 'react-router-dom'
import {auth, db, storage} from '../repository/firebase/firebase';
const Category = ({ data }) => {
const [userUid, setUse... |
package com.cocktails.cocktail.service.mapper;
import com.cocktails.cocktail.dto.IngredientDto;
import com.cocktails.cocktail.model.CocktailIngredient;
import com.cocktails.cocktail.model.Ingredient;
import com.cocktails.cocktail.model.emuns.IngredientType;
import com.cocktails.cocktail.model.emuns.Unit;
import lombok... |
import React, { Component } from "react";
import { connect } from "react-redux";
import { getMovies, addMovieFavorite } from "../../actions";
import MovieCard from "../MovieCard/MovieCard";
import SearchMovie from "../SearchMovie/SearchMovie";
export class FrontPage extends Component {
render() {
return (
... |
package org.live.sys.controller;
import org.live.common.constants.SystemConfigConstants;
import org.live.common.response.ResponseModel;
import org.live.common.response.SimpleResponseModel;
import org.live.common.shiro.RetryLimitHashedCredentialsMatcher;
import org.live.common.support.ServletContextHolder;
import org.l... |
package lesson_fifteen
import (
"bufio"
"errors"
"fmt"
"log"
"os"
"strconv"
)
var pl = fmt.Println
func Start() string {
pl("Lesson Fifteen Started.")
pl("File I/O")
// f - file
// err - error
f, err := os.Create("15.lesson_fifteen/data.txt")
if err != nil {
log.Fatal(err)
}
defer f.Close() // whene... |
import { useState } from "react"
import IconCalender from "../icons/IconCalender"
import IconCloseMenu from "../icons/IconCloseMenu"
import IconDown from "../icons/IconDown"
import IconPlanning from "../icons/IconPlanning"
import IconReminders from "../icons/IconReminders"
import IconTodo from "../icons/IconTodo"
impor... |
import { vi } from "vitest";
import userEvent from "@testing-library/user-event";
import { renderWithProviders, wrapWithRouter } from "../../utils/testUtils";
import LoginForm from "./LoginForm";
import { screen } from "@testing-library/react";
beforeAll(() => vi.clearAllMocks);
const handleLoginOnSubmit = vi.fn();
... |
<!DOCTYPE html>
<html>
<head>
<title>Home</title>
<!-- Link to Bootstrap CSS and your custom styles.css -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles.css') }}"... |
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>简易备忘录</title>
<!-- 引入自定义 CSS 样式 -->
<link rel="stylesheet" href="../../static/css/Memorandum.css">
</head>
<body>
<div id="memo-container">
<h1>备忘录</h1>
... |
console.log("Create an array called ages that contains the following values: 3, 9, 23, 64, 2, 8, 28, 93.");
let ages = [3, 9, 23, 64, 2, 8, 28, 93]; // created new array with ages listed above
console.log(ages);
console.log("A. Programmatically subtract the value of the first element in the array from the value in ... |
import db_connection from "@/utils/db/connection";
const commonHeaders = {
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
"Access-Control-Allow-Headers": "Content-Type, Authorization",
};
async function fetchAl... |
// Copyright(C) 2002-2003 Hugo Rumayor Montemayor, All rights reserved.
using System;
using System.Text;
using System.IO;
namespace Id3Lib
{
#region Global Fields
/// <summary>
/// Type of text used in frame
/// </summary>
public enum TextCode:byte
{
/// <summary>
/// ASCII(ISO-8859-1)
/// </summary>
ASC... |
# the bit that exports worker profile class and uses the RVL
# an RPC stub is the thing on the client that makes a calling request and waits for the response
from .config import comms_config, default_service_config
from .utils import deserialize, GET
from .simplex_stubs import AsyncSimplexStub, CoroSimplexStub, SyncSi... |
const dogs = [
{
name: 'Snickers',
age: 2,
},
{
name: 'Hugo',
age: 8,
},
];
// read html
function makeGreen(){
const p = document.querySelector('p');
p.style.color = '#BADA55';
p.style.fontSize = '50px';
}
// regular
console.log("hello");
// interpolated
... |
{% extends "base.html" %}
{% load static %}
{% block page_header %}
<div class="container header-container">
<div class="row">
<div class="col"></div>
</div>
</div>
{% endblock %}
{% block content %}
<link rel="stylesheet" href="{% static 'css/item_detail.css' %}" />
<div class="container">
<div ... |
import React from 'react'
import { connect } from 'react-redux'
import './cart-icon-styles.scss';
import {ReactComponent as ShoppingIcon} from '../../utilities/shopping-bag.svg';
import {toggleCartDropdown} from '../../redux/cart/cart.action'
import {selectCartItemCount} from '../../redux/cart/cart.selectors'
const C... |
#' Modèle de Mélange Gaussien (GMM) en classification
#' Fonction de Classification
#'
#' @param Xtrain Variables descriptives des individus de l'échantillon d'apprentissage
#' @param Xtest Variables descriptives des individus de l'échantillon test
#' @param z Variable réponse à prédire pour les individus de l'échantil... |
# workflow 101
### Github ssh-key setup
1. check your account: click on your avatar→settings→SSH and GPG keys(left sidebar)→confirmed SSH keys are empty
2. check if /.ssh folder is empty, if not delete all files inside
```jsx
rm -rf ~/.ssh/*
```
1. (optional)these 2 commands you can skip if you never set config bef... |
import { Link } from "react-scroll";
import { LayoutSectionInitial } from "../../shared/layouts/LayoutSectionInitial";
import { Box, Button, Container, Divider, Typography } from "@mui/material";
import { useState } from "react";
import { ScrollRestoration } from "react-router-dom";
const backgroundHome =
require("... |
import "./App.css";
import Headers from "./components/layout/Header";
import Footer from "./components/layout/Footer";
import Home from "./components/Home";
import { Route, BrowserRouter as Router, Routes } from "react-router-dom";
import { HelmetProvider } from "react-helmet-async";
import {ToastContainer} from 'react... |
package com.reserve.restaurantservice.dto;
import com.reserve.restaurantservice.entities.RestaurantLocation;
import com.reserve.restaurantservice.entities.RestaurantType;
import javax.persistence.Id;
import java.util.HashSet;
import java.util.Set;
public class RestaurantDto {
@Id
private Integer restaurantI... |
Kubernetes manages pod-to-pod communications through a combination of network plugins, services, and DNS resolution. Here's how pod-to-pod communication works in Kubernetes:
1.Pods and IP Addresses:
Each pod in a Kubernetes cluster is assigned a unique IP address. These IP addresses are routable within the cluster's ... |
<!DOCTYPE html>
<html lang="ru">
<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>studio</title>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/mo... |
<div class="container">
<div class="card-index">
<div class="card">
<label for="tool">What are you looking for?</p>
<%= form_tag tools_path, method: :get do %>
<%= text_field_tag :query,
params[:query],
class: "form-group",
placeholder: "Find a tool"
%... |
package chapter12_Enum.listing11;
// Use static import to bring sqrt() and pow() into view.
//import static java.lang.Math.sqrt; //static import
//import static java.lang.Math.pow; //static import
import static java.lang.Math.*; //static import
import static java.lang.System.out; //static import
class Quadraticv1 {
... |
<template>
<div class="container">
<div>
<ticker :ticker="getTickerFromAssociationsArray(all_associations)" :up="getUpOrDown(all_associations)"></ticker>
<br/>
<p>
<span>Select the number of months to display:
<select v-model="history">
<option value=0>ALL</option>
... |
import {createSlice} from '@reduxjs/toolkit';
const initialState: any = {
user: null,
isLoggedIn: true,
authToken: null,
};
export const userReducer = createSlice({
name: 'user',
initialState,
reducers: {
setAuthToken: (state, action) => {
state.authToken = action.payload;
},
setUser: (s... |
package com.example.notes.controller;
import com.example.notes.model.AuthenticationTokenBody;
import com.example.notes.security.util.JwtUtil;
import com.example.notes.service.UserDetailsDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springfram... |
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
and... |
---
title: Exercises
nav_order: 95
has_children: false
layout: default
---
## Exercises
Practice your command-line skills with the following exercises.
**Note:** To download each file to your terminal, right-click on the file and select copy link address. Then, use the following command by replacing `<Address>` with... |
<!DOCTYPE html>
<html>
<head>
<title>ARP Privilege Escalation</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://fonts.googleapis.com/css2?family=Rale... |
import React, { useEffect, useState } from 'react';
import { Collapse, CardBody, Card, CardHeader } from 'reactstrap';
const CardFaq = (props) => {
const [collapse, setCollapse] = useState([]);
useEffect(() => {
const isOpen = [];
props.content.forEach((item) => {
isOpen.push(item.isOpen);
});
setCollapse... |
/*
16562-친구비
우선 union을 이용하여 친구비를 한 번만 낼 수 있는 그룹을 찾는다.
union을 할 때, parent는 친구비가 더 낮은 친구를 위주로 union을 한다.
union 작업이 다 끝난 뒤에는 parent가 음의 값을 가지는 경우 친구비를 계산하여 모든 친구와 친구가 되기 위해 필요한 친구 비를 구한다.
그리고 k를 기준으로 친구를 할 수 있음과 없음을 구분하여 결과를 출력한다.
*/
#include <iostream>
#include <algorithm>
#include <vector>
#include <limits.h>
... |
package com.water.controller;
import com.water.constans.BaseConstants;
import com.water.dto.MoveDTO;
import com.water.dto.PointDTO;
import com.water.entity.Marker;
import com.water.result.Result;
import com.water.service.MarkerService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframe... |
import { ChangeEvent,KeyboardEvent, useState } from "react"
import AddBoxTwoToneIcon from '@mui/icons-material/AddBoxTwoTone';
type AddItemFormPropsType = {
callback: (title: string)=> void
style: {[key:string]:string}
}
export function AddItemForm(props: AddItemFormPropsType)
{
let [title, setTitle] ... |
# Render yml/yaml files action
This action retrieves secrets and variables from the GitHub context and replaces with values in file(s) (yml/yaml extensions) stated in target parameter if it finds a string with *ENV_* prefix that is *ENV_<variable/secret name>*. If file parameter is given true then it processes single ... |
# Test Containers
## What is Testcontainers?
It’s a Java library that allows you to bring up docker images during the testing process and use real images of databases, message queues, etc.. instead of mocking or using H2. There are some ready-to-use test containers (Mysql, Kafka,…) but if you can’t find your desired m... |
/*
* This source file is part of the tqmesh library.
* This code was written by Florian Setzwein in 2022,
* and is covered under the MIT License
* Refer to the accompanying documentation for details
* on usage and license.
*/
#pragma once
#include <vector>
#include <utility>
#include "Mesh.h"
#include "MeshCleanup... |
# 如何在 GitHub 中创建自动拉取请求清单
> 原文:<https://www.freecodecamp.org/news/create-a-pr-checklist-in-github/>
如果你曾经参与过一个项目,不管是你工作中的应用还是开源工具,你很可能已经创建了一个拉请求。这要求您的代码更改为合并到主代码库中。
我们使用拉请求来确保只有高质量的代码被合并到我们的主要分支中。但是有时候,在开发一个新特性的艰苦的编码会议之后,我们会错过一些小事情。
在最坏的情况下,这些错误可能会被队友忽略,并合并到主代码库中,造成错误或低效。在最好的情况下,发现这些微小的问题会占用其他团队成员的时间去注意和指出。
我特别容易打开... |
import React from "react";
import classes from "./Navbar.module.css";
import { AiFillCodeSandboxSquare } from "react-icons/ai";
import {
TbUserSquareRounded,
TbCircleKey,
TbHexagonLetterO,
} from "react-icons/tb";
import { RiQuestionnaireLine } from "react-icons/ri";
import { LiaCoinsSolid } from "react-icons/lia... |
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { TypeOrmModule } from '@nestjs/typeorm';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { UserModule } from './user/user.module';
import { join } from 'pat... |
<!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>
<div id="app"></div>
<template id="da">
<h2>你好</h2>
... |
//
// VehicleDetailView.swift
// TaskApp
//
// Created by Filip Nesic on 19.4.24..
//
import SwiftUI
struct VehicleDetailView: View {
var selectedModel: VehicleModel
private var formattedNumber: String {
let formatter = NumberFormatter()
formatter.minimumFractionDigits = 0
... |
= About WinZoomPanel
== WinZoomPanel
The WinZoomPanel™ is a control container which allows the user to zoom into its contents and then to scroll through the zoomed contents. It offers all of the same features as the link:winpanel.html[WinPanel], with the exception of the
link:{ApiPlatform}win.misc{ApiVersion}~infragi... |
import React, { useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { useNavigate, useParams } from "react-router";
import { setCart, setCartItem } from "../redux/CartSlice";
import { toast } from "react-toastify";
import { motion } from "framer-motion";
function Info() {... |
/*
Cleaning Data in SQL Queries
Skills used: Self Joins, CTE's, Substring Operations, Windows Functions, Converting Data Types, Flagging Duplicates, Deleting Unused Data
*/
SELECT *
FROM PortfolioProject..NashvilleHousing
--------------------------------------------------------------------------------
-- Standard... |
# frozen_string_literal: true
RSpec.describe Sentence, type: :model do
describe 'associations' do
it { should have_many(:entities) }
end
describe 'validations' do
it { should validate_presence_of(:content) }
it { should validate_uniqueness_of(:content).with_message('has already been taken') }
end
... |
import pytest
DISCOUNT_PROMOS = {
'11': {
'promo_id': 301,
'promo_type': 'one_plus_one',
'promo_title': 'Два по цене одного',
},
'12': {
'promo_id': 302,
'promo_type': 'gift',
'promo_title': 'Блюдо в подарок',
},
'13': {
'promo_id': 303,
... |
import {
TableContainer,
Paper,
Table,
TableBody,
TableRow,
TableCell,
Typography,
} from '@mui/material';
import useStoreContext from '../../app/context/StoreContext';
import { curranctFormat } from '../../app/util/util';
export default function BasketSummary() {
const { basket } = useStoreContext();
... |
<%= form_for @booking do |f|%>
<% @booking.errors.full_messages.each do |error| %>
<ul>
<li><%= error %></li>
</ul>
<% end %>
<div class="booking">
<div class="row">
<div class="form-group">
<%= f.label :requested_date, "Date of booking:",:class=>"col-sm-8 control-label ml-... |
import type { NextPage } from "next";
import Card from "../components/Card";
import styles from "../styles/Home.module.css";
import { Input, Button, Link } from "@nextui-org/react";
import { Text } from "@nextui-org/react";
import { useRouter } from "next/router";
import { useCallback, useState } from "react";
import {... |
import express, { Router, Request, Response, RequestHandler } from "express";
import { RouterHandler } from "./RouteHandler";
import { STATUS_CODE } from "../enum/statusCode";
import { addExpressHandlers } from "../helpers/expressHandlers";
export class RouteManager {
private route: Router;
public readonly path: s... |
import React, { ChangeEventHandler, useEffect, useState } from 'react';
import styled from 'styled-components';
import useTheme from '@material-ui/core/styles/useTheme';
import Avatar from '@material-ui/core/Avatar';
import Fab from '@material-ui/core/Fab';
import Chip from '@material-ui/core/Chip';
import IconButton ... |
import React from "react";
import { useState } from "react";
import { Routes, Route } from "react-router-dom";
import Dashboard from "./Dashboard";
import Resume from "./pages/resume";
import Home from "./pages/Home";
import { CssBaseline, ThemeProvider } from "@mui/material";
import { ColorModeContext, useMode } from ... |
extends Node
class_name ThothSerializer
######################################
## variable serialization
######################################
static func _serialize_variable(variable, object_convert_to_references = false):
match typeof(variable):
TYPE_NIL:
return null
TYPE_VECTOR2:
return _serialize_vect... |
<template>
<v-container>
<v-row>
<v-col class="text-left">
<span class="body-1">Dodatno pretraži prema:</span>
</v-col>
</v-row>
<v-row>
<v-col>
<v-select
v-model="selectedBotanicalFamilies"
label="Botaničkoj porodici"
placeholder="npr. Usnač... |
/**
* Heading
*
* Set heading size and vertical spacing
*
* @param {int} modular-scale-factor - Heading size on the modular scale
* @param {int} [top-vertical-rhythm-factor: 1] - Heading top margin in vertical rhythm unit
* @param {int} [bottom-vertical-rhythm-factor: 1] - Heading bottom margin ... |
import copy
import datetime as dt
import pytest
from transactions.clients.trust import event_stats
_UNCHANGED_EVENT_STATS = [
{
'created': dt.datetime(2020, 4, 3, 3, 2),
'detailed': {'card': {'CheckBasket': {'success': 2, 'error': 1}}},
'success': 2,
'error': 1,
'name': 'b... |
def goodIntegers(arr: list) -> list[int]:
"""Returns list of numbers that its value is equal to number of elements less than themselves.
Args:
arr (list): list of integers, non-repeated
Returns:
list[int]: list of good integers
"""
n = len(arr)
goodIntegers = []
arr.sort()
... |
select * from
CovidDeaths order by 3,4;
--select * from
--CovidVaccinations order by 3,4;
select Location, date,total_cases,new_cases,total_deaths,population
from CovidDeaths
order by 1,2;
--total cases vs total deaths
select location,date,total_cases,total_deaths,(total_deaths/total_cases) * 100 as DeathPercentag... |
import {
HttpException,
HttpStatus,
Injectable,
NotFoundException,
} from '@nestjs/common';
import { InjectModel } from '@nestjs/sequelize';
import { validate } from 'uuid';
import { User } from '../users/user.model';
import { Task } from './task.model';
import { ListService } from '../lists/list.service';
... |
import 'dart:developer';
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:qr_code_scanner/qr_code_scanner.dart';
import 'inicio.dart';
import 'edicao.dart';
import 'contatos.dart';
import 'sobre.dart';
class Scanner extends StatelessWidget {
final s... |
/** @format */
import React, { useState, useEffect } from 'react';
import { isEmpty } from 'lodash';
import { useDebounce } from '../utils/hooks';
import { TextField, InputAdornment } from '@material-ui/core';
import { Search, Clear } from '@material-ui/icons';
function SearchFilter(props) {
const { keyword, setKey... |
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8" name="viewport" content="Width=device-width, initial-scale=1">
<style>
* { margin: 0; padding: 0;}
header { background:wheat; display:flex; justify-content: space-between; margin-bottom: 10px;}
... |
<!DOCTYPE html>
<!--suppress ALL -->
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org">
<head th:replace="fragments/head :: head"></head>
<body>
<div class="container">
<div th:replace="fragments/header :: header"></div>
<div class="container">
<form class="form-horizontal" th:obje... |
import { createEffect } from 'solid-js'
import { createMachine, assign } from 'xstate'
import { useMachine } from '../hooks/useMachine'
const toggleMachine = createMachine({
id: 'toggle',
initial: 'inactive',
context: {
count: 0,
disabledCount: 0,
},
states: {
inactive: {
entry: assign({ di... |
<template>
<div class="mx-10 md:mx-0">
<p class="text-center text-main-700 tracking-widest">{{ chartTitle }}</p>
<div :id="props.id" ref="elPieChart" class="w-full lg:h-96 h-64"></div>
<ul class="md:flex md:justify-center lg:block">
<li v-for="item of districtsData" :key="item.president" class="trac... |
// Libraries
import React from 'react';
import axios from 'axios';
import { useAppDispatch, useAppSelector } from '../../redux/hooks';
// CSS
import './playlist.css';
import { setSelectedSong } from '../../redux/slices/songSlice';
import { ItemSong } from '../../typeInterface/InterfaceSong';
import { PlaylistItem } f... |
<?php
namespace App\Http\Controllers\Admin;
use App\Enums\AppointmentStatus;
use App\Http\Controllers\Controller;
use App\Models\Appointment;
use Illuminate\Http\Request;
class AppointmentController extends Controller
{
public function index(Request $request) {
$status = (int)$request->status;
re... |
import { Request, Response } from 'express';
import bcrypt from 'bcrypt';
import jwt from 'jsonwebtoken';
import { User } from '../../models/User';
export async function loginUser(req: Request, res: Response) {
try {
const { email, password } = req.body;
const user = await User.findOne({ email });
if (!user) {... |
// ========== AUTH LANDING PAGE ==========
// This page is used to display the login page when a user is not yet logged in / displays an error page when the login fails / displays a loading page when the login is in progress
// === Imports ===
// - Auth0
import { useAuth0 } from "@auth0/auth0-react";
// - React
imp... |
/*
File Name: MapEditor.h
Project Name: The balloon
Author(s)
Main: Hyunjin Kim
All content 2021 DigiPen (USA) Corporation, all rights reserved.
*/
#pragma once
#include "../../Engine/Headers/Engine.h"
#include "../../Engine/Headers/Vec2.h"
#include "../../Engine/Headers/texture.h"
#include "../../Engine/Headers/Soun... |
import numpy as np
class Dense:
def __init__(self, n_units, ativacao, inicializador, use_bias, input_dim=None):
"""
n_units: nº de neurônios da camada atual
ativacao: Classe da função de ativação
inicializador: Classe do inicializador
bias: Se a camada terá um viés
... |
#ifndef DALU_DOCKING_H
#define DALU_DOCKING_H
#include <ros/ros.h>
#include <tf2_ros/transform_listener.h>
#include <geometry_msgs/TransformStamped.h>
#include <geometry_msgs/PoseStamped.h>
#include <math.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#include <std_msgs/Bool.h>
#include <std_msgs/Empty.h>
#includ... |
package com.example.bluetooth_checkin;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import java.util.Set;
import java.util.ArrayList;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;
... |
import React, { useState, useEffect } from "react";
import { useNavigate } from "react-router-dom";
import { BallTriangle } from "react-loader-spinner";
const StartPage = () => {
const navigate = useNavigate();
const [name, setName] = useState('');
const [topic, setTopic] = useState('');
const [passcode, se... |
use bevy::{prelude::*, render::view::RenderLayers};
use bevy_vector_shapes::{prelude::ShapePainter, shapes::LinePainter};
use crate::{
game::{
health::Health,
player::{calories::Calories, Player},
DespawnOnExitGame,
},
AppState,
};
const BAR_LENGTH: f32 = 1.0;
const BAR_WIDTH: f32 = 0.03;
const TEXT_SCALE: f... |
/**
* Copyright 2022 Huawei Technologies 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... |
/*
* Copyright (c) 2024 AVI-SPL, Inc. All Rights Reserved.
*/
package com.avispl.symphony.dal.avdevices.wirelesspresentation.mersive.solsticepodgen3.common;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* ActiveRoutingProperty
*
* @author Harry / Symphony Dev Team<br>
... |
<!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>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>... |
from typing import Optional, Callable, List
import torch
import torchmetrics
from torch import nn
from torchmetrics import Accuracy, AveragePrecision, AUROC, Dice, F1Score
from vision_models_playground.datasets.datasets import get_voc_detection_dataset_yolo, get_voc_detection_dataset_yolo_aug
from vision_models_playg... |
import torch
from torchvision import models as resnet_model
from torch import nn
import timm
import torch.nn.functional as F
class SEBlock(nn.Module):
def __init__(self, channel, r=16):
super(SEBlock, self).__init__()
self.avg_pool = nn.AdaptiveAvgPool2d(1)
self.fc = nn.Sequential(
... |
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<title>商品信息编辑</title>
<link href="css/jquery.stepy.css" th:href="@{/css/jquery.stepy.css}" rel="stylesheet">
<div th:include="common :: commonheader"></div>
<link rel="stylesheet" th:href="@{/layui/css/layui.css}">
<style>
... |
package HomeTask01_2;
// 2. Описать в ООП стиле логику взаимодействия объектов реального мира между собой: шкаф-человек.
// Какие члены должны быть у каждого из классов (у меня на семинаре студенты пришли к тому, чтобы продумать
// логику взаимодействия жена разрешает открыть дверцу шкафа мужу, по... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.