text stringlengths 184 4.48M |
|---|
const supertest = require('supertest');
const expect = require('expect');
var app = require('./server').app;
describe('server', () => {
describe('GET /', => {
it('should return hello world response', (done) => {
supertest(app)
.get('/')
.expect(200)
//.expect('Hello World!')
//.expect({
// ... |
//
// KSLiveProvider.swift
// KSHLSPlayer
//
// Created by Ken Sun on 2016/1/18.
// Copyright © 2016年 KS. All rights reserved.
//
import Foundation
/**
* Provider has its own mechanism to maintain playlist and TS segments. The only thing you have
* to do is push and add segment to it. Please follow the rules:
... |
//Да се напише програма, която дефинира клас Gilishte, определящ адрес, площ и цена на
//жилище, данните за всички жилища се съхраняват в масив от обекти. Дефинират се и класове Apartament
//с етаж и Kashta с размер на двор, наследници на Gilishte. Да се въведат n жилища от различен тип
//(апартамент или къща). Да се ... |
import React, { useEffect, useState, useCallback } from 'react';
import { Text, View, ScrollView, Image, Pressable, Alert, Keyboard, TouchableWithoutFeedback, } from 'react-native';
import { StatusBar } from 'expo-status-bar';
import Styles from '../Styles/Styles';
import ButtonStyles from '../Styles/ButtonStyles';
imp... |
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { t... |
<?php
/**
*@copyright : ToXSL Technologies Pvt. Ltd. < www.toxsl.com >
*@author : Shiv Charan Panjeta < shiv@toxsl.com >
*
* All Rights Reserved.
* Proprietary and confidential : All information contained herein is, and remains
* the property of ToXSL Technologies Pvt. Ltd. and its partners.
* Unauthorized c... |
<html>
<head>
<title></title>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
<child>
<h1 slot ="header">Dell1</h1>
<h1 slot ="footer">Dell2</h1>
</child>
</div>
<script>
... |
# 511. Game Play Analysis I
[Question Link](https://leetcode.com/problems/game-play-analysis-i/)
## Intuition
Knowledge of this test:
- if you don't use `inplace = True` in rename, the output will not change the name of the column.
So you have 2 choices:
- No.1:
```
result = activity.rename(columns={'event_date':'firs... |
#pragma once
#include <string>
#include <fstream>
#include <iostream>
#include "tape_exceptions.hpp"
namespace tape_simulation {
template<typename T>
class tape final {
std::fstream file_;
int size_;
static constexpr int elem_sz = sizeof(T);
public:
tape(std::string path) : file_(path, st... |
package model
import (
"ecommerce/database"
"html"
"log"
"strings"
"golang.org/x/crypto/bcrypt"
"gorm.io/gorm"
)
type User struct {
gorm.Model
Username string `gorm:"size:255;not null;unique" json:"username" validate:"required,min=2,max=30"`
// Email string `gorm:"size:255;not null;" json:"email" ... |
package com.oym.oa.dao;
import com.oym.oa.entity.Employee;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository("employeeDAO")
public interface IEmployeeDAO {
/**
* 插入员工信息
* @param employee
*/
void insert(Employee empl... |
const int switchPin = 12; // switch input
const int leftMotor1Pin1 = 3; // pin 2 on L293D
const int leftMotor1Pin2 = 4; // pin 7 on L293D
const int rightMotor1Pin1 = 5; // pin 2 on L293D
const int rightMotor1Pin2 = 6; // pin 7 on L293D
const int leftEnablePin = 8; // pin 1 on L293D
const int rightEnablePin = 9; // pin ... |
package com.hazz.kotlinmvp.view
import android.content.Context
import android.graphics.drawable.Drawable
import android.os.Build
import android.support.annotation.DrawableRes
import android.support.v4.content.ContextCompat
import android.text.TextUtils
import android.util.AttributeSet
import android.view.View
import a... |
public class Pawn extends ChessPiece {
public Pawn(String color) {
super(color);
}
@Override
public String getColor() {
return this.color;
}
//метод позволяющий определять может ли фигура двигаться в какую либо позицию
//в него передается шахматная доска, линия и колонка с... |
import { SORT_BY_NAME, SORT_ASCENDING } from '../constants';
import { LibraryItem } from '../models/library-item.model';
export class ItemLibrary {
constructor(
private items: Map<string, LibraryItem> = new Map(),
private sortMode: string = SORT_BY_NAME,
private sortDirection: string = SORT_ASCENDING
) {}
ge... |
package com.appn.core_common.base.delegate
import android.content.Context
import android.os.Bundle
import android.view.View
/**
* Fragment 代理类,用于框架内部在每个Fragment 的对应生命周期中插入需要的逻辑
*/
interface FragmentDelegate {
fun onAttach(context: Context)
fun onCreate(savedInstanceState: Bundle?)
fun onCreateView(vi... |
const assert = require('assert');
const ToolsSchema = require('./../database/mongodb/schemas/toolsSchema');
const MongoDb = require('./../database/mongodb/mongodb');
const MOCK_DEFAULT_ITEM = {
title: `Notion - ${Date.now()}`,
link: "https://notion.so",
description: "All in one tool to organize teams and i... |
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Admin</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5... |
"""
This module defines a base class, Base, for managing the 'id' attribute in future classes.
"""
class Base:
"""
Base class for managing the 'id' attribute in future classes.
Attributes:
None
Methods:
__init__(self, id=None): Constructor for the Base class.
Class Attributes:
... |
package DesensitizedUtils
import (
"fmt"
"reflect"
"strconv"
"strings"
)
type DesensitizedUtils struct {
}
func (DesensitizedUtils) ChineseName(name string) string {
if name == "" {
return ""
}
s := hide(name, 1, len(name)/3)
return s
}
func (DesensitizedUtils) Email(email string) string {
if email == ""... |
package qiao;
import java.util.HashSet;
import java.util.Set;
/**
* Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.
A region is captured by flipping all 'O's into 'X's in that surrounded region.
For example,
X X X X
X O O X
X X O X
X O X X
After running your function, the board shoul... |
$primary-color: #444;
$secondary-color: #eece1a;
$show-home-image: true;
$home-image: url(../img/background.jpg);
$background-opacity: 0.9;
@import "menu";
@mixin easeOut {
transition: all ease-out;
transition-duration: 1s;
}
* {
box-sizing: border-box;
}
@mixin background {
@if $show-home-image {
&#bg-... |
import { useEffect, useState } from "react";
import {
Box,
Card,
CardContent,
Container,
TextField,
Typography,
} from "@mui/material";
import { LoadingButton } from "@mui/lab";
const API_KEY = "4490f3b5fd564a37ac8143640232405";
const API_WEATHER = `https://api.weatherapi.com/v1/current.json?key=${API_KEY}... |
package Pages;
import Steps.Hooks;
import io.appium.java_client.AppiumBy;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.supp... |
import React, { useEffect, useState } from "react";
import {
Image,
Container,
FlexWrapper,
NavbarText,
TextBase,
Button,
} from "components";
import styled from "styled-components";
import { teal, white, lightGreenBackground, black } from "styles/colors";
import { useQuery } from "styles/breakpoints";
imp... |
<?php
namespace App\Controllers;
use App\Models\UserModel;
use CodeIgniter\Controller;
class AdminController extends Controller
{
public function index()
{
$data['error'] = session()->getFlashdata('error');
// Get the success message from the registration redirect, if any
$data['succe... |
# -*- coding: utf-8 -*-
# This file is part of Shuup PagSeguro.
#
# Copyright (c) 2016, Rockho Team. All rights reserved.
# Author: Christian Hess
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
fro... |
"use strict";
import * as antlr4ts from 'antlr4ts';
import { cyoaeLexer } from './cyoaeLexer';
import * as cyoaeParser from './cyoaeParser';
import { Variable_storage, Variable_storage_types } from './storage';
import { create_variable_table } from './variables_screen';
import { createHTML } from './html';
import { ge... |
import React from "react";
import { useState } from "react";
import { useDispatch } from "react-redux";
import { changeName } from "../store/slices/userName.slice";
import { useNavigate } from "react-router-dom";
import ash from "../assets/ashShadow.png";
const UserInput = () => {
const dispatch = useDispatch();
c... |
<template lang="pug">
b-container(fluid)#list.overflow-auto
b-row
b-col(cols="12" lg="6" class="my-3")
b-form-group(label="新增事項" invalid-feedback="請至少輸入兩個字" :state="state")
b-form-input(v-model="newtodo" trim :state="state" @keydown.enter="addTodo")
b-btn(variant="danger" @click="a... |
class Solution {
public int[] relativeSortArray(int[] arr1, int[] arr2) {
Map<Integer, Integer> relativePositions = new HashMap<>();
for (int i = 0; i < arr2.length; i++) {
relativePositions.put(arr2[i], i);
}
// Count the occurrences of elements in arr1
int[] ... |
Git — это система управления версиями (система контроля версий) с распределенной архитектурой, которая позволяет
сразу нескольким разработчикам сохранять и отслеживать изменения в файлах проекта.
Репозиторий Git — это виртуальное хранилище проекта. В нём можно хранить версии кода для дальнейшего доступа к нему.
Git х... |
import Foundation
import SwiftUI
struct Category {
let city: String
let items: [String]
}
class ContentViewController: UIViewController {
private let tableView: UITableView = {
let table = UITableView()
table.register(UITableViewCell.self, forCellReuseIdentifier: "cell")
retur... |
# Django-API
# Book API
The Book API is a Django-based RESTful API for managing books. With this API, you can perform essential CRUD (Create, Read, Update, Delete) operations on books. It provides a straightforward way to store and manage information about your book collection.
## Table of Contents
- [Features](#fea... |
<template>
<section class="cart">
<div class="cart__container">
<div class="cart__container__title">購物籃</div>
<div
class="cart__container__wrapper"
v-for="product in carts"
:key="product.id"
>
<div class="cart__container__wrapper__product-photo">
<img
... |
<?php
namespace App\Models;
use App\Models\Categorie;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Article extends Model
{
use HasFactory;
protected $fillable = ['libelle', 'quantiteStock', 'categori... |
//
// LocationTableViewCellViewModel.swift
// Rick & Morty
//
// Created by Николай Никитин on 06.09.2023.
//
import Foundation
struct LocationTableViewCellViewModel: Hashable, Equatable {
private let location: Location
init(with location: Location) {
self.location = location
}
public var name: Stri... |
import {Component, OnInit, ViewChild, ViewEncapsulation} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {MatDialog} from '@angular/material/dialog';
import {DeleteConfirmationComponent} from '../../module-share/delete-confirmation/delete-confirmation.component';
import {Notificatio... |
plot_ls <- list()
for(rn in c("lm","lr")){
agg_df <- agg_df_ls[[rn]]
# # use mean and se
# plot_df <- NULL
# for(en in c("_mean","_se")){
# tmpdf <- pivot_longer(agg_df[,c("id", paste0(c("aic_diff", "bic_diff", "nic_diff"),en))],
# cols = ends_with(en),
# ... |
@page
@model Dissertation.Pages.Authentication.AuthenticationModel
@{
ViewData["Title"] = "Log in";
Layout = "_Layout";
}
<div class="main-container">
<div class="right-container">
<section>
<form id="account" asp-page="./Authentication" asp-page-handler="Login" method="post">
... |
from typing import Optional, Dict, Any
import numpy as np
import torch
from torch.nn import CrossEntropyLoss
from transformers.models.whisper import WhisperProcessor, WhisperForConditionalGeneration
from transformers.models.whisper import WhisperProcessor
from transformers.modeling_outputs import Seq2SeqLMOutput
from... |
import { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import './favoritos.css';
import { toast } from 'react-toastify'
function Favoritos(){
const [filmes, setFilmes] = useState([]);
useEffect(()=>{
const minhaLista = localStorage.getItem('@devflix');
setFilmes(J... |
(function () {
// form
const form = document.getElementById('noteForm');
// main fields
const name = document.getElementById('name');
const poster = document.getElementById('poster');
const genre = document.getElementById('genre');
const producer = document.getElementById('producer');
co... |
import React, { useEffect, useState } from "react";
import gsap from "gsap";
export default function () {
const [images, setImages] = useState(null)
useEffect(() => {
getImages()
}, [])
const getImages = async () => {
try {
const response = await fetch('/api/images')
... |
#ifndef _include_guard_nightmareci_utf8_c_
#define _include_guard_nightmareci_utf8_c_
#include <stdint.h>
/**
* Decode a Unicode codepoint from a UTF-8-encoded string.
*
* \param codepoint a pointer receiving the decoded codepoint or NULL if the
* decoded data isn't desired
* \param str the star... |
import { BrowserModule } from '@angular/platform-browser';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
... |
<?php
namespace herams\console\migrations;
use yii\db\Migration;
/**
* Handles the creation of table `{{%access_request}}`.
*/
class M230804162221CreateAccessRequestTable extends Migration
{
public function safeUp()
{
$this->createTable(
'{{%access_request}}',
[
... |
package io.musicorum.mobile.views.settings
import android.content.Intent
import android.os.Bundle
import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Arrangement
import an... |
<template>
<div>
<table>
<thead>
<tr>
<td>考点</td>
<td>编号</td>
<td>教程页面</td>
<td>历年真题</td>
</tr>
</thead>
<tbody >
<tr v-for=" (item, index) in data.items" >
<td><a :href="item.path">{{ item.title }}</a></td>
<td... |
import React, { useContext } from "react";
import { Link, NavLink } from "react-router-dom";
import { Button, Divider, Grid, Header, Icon, Segment } from "semantic-ui-react";
import { deleteToDo, getToDo, postToDo } from "../api/api";
import { ToDoContext } from "./ToDoProvider";
export default function ToDoList() {
... |
package com.atguigu.app.dws;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.atguigu.bean.CartAddUuBean;
import com.atguigu.utils.ClickHouseUtil;
import com.atguigu.utils.DateFormatUtil;
import com.atguigu.utils.MyKafkaUtils;
import org.apache.flink.api.common.eventtime.Serializabl... |
"Represents an Untappd Beer Search Result"
type UntappdProductSearchResult {
beers: UntappdSearchResultBeers,
breweries: UntappdSearchResultBreweries,
brewery_id: Int,
found: Int,
limit: Int,
offset: Int,
message: String,
parsed_term: String,
search_type: String,
search_version: Float,
term: Strin... |
import { app, BrowserWindow } from "electron";
import log from "electron-log";
import { autoUpdater } from "electron-updater";
import { startDiscordRPC } from "./discord";
import loadFlashPlugin from "./flash-loader";
import startMenu from "./menu";
import { getUrlFromCommandLine, PROTOCOL, replaceProtocolToDomain } fr... |
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = __importDefault(require("express"));
const calc_1 = require("./calc");
const app = (0,... |
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Lossy.ScriptableObjects.Config
{
[CreateAssetMenu(fileName = "CreditsConfig", menuName = "Configs/CreditsConfigScriptableObject",
order = 1)]
public class CreditsConfigScriptableObject : ScriptableObject
{
[Seriali... |
<?php
namespace jeannick\phpmvc\db;
use jeannick\phpmvc\Application;
use jeannick\phpmvc\Model;
abstract class DbModel extends Model
{
abstract public function tableName(): string;
abstract public function attributes(): array;
abstract public function primaryKey(): string;
public function save()... |
import { EventEmitter, Injectable } from '@angular/core';
import { Subject } from 'rxjs';
import { Ingredients } from '../shared/ingredient.model';
@Injectable({
providedIn: 'root',
})
export class ShoppingListService {
ingredientsChanged = new Subject<Ingredients[]>();
private ingredients: Ingredients[] = [
... |
"""
Vector geometry conversion
A great deal of geospatial data is available not in gridded form, but in
vectorized form: as points, lines, and polygons. In the Python data ecosystem,
these geometries and their associated data are generally represented by a
geopandas GeoDataFrame.
Xugrid provides a number of utiliti... |
#!/usr/bin/python
# Copyright 2015 Google Inc. 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 a... |
# Toolbar
**Toolbars display information and actions related to the context.**
<DemoBlock demo="default" />
## Anatomy
A toolbar has three sections. An optional contextual icon button and a title on the left, contextual actions on the right.
<img width="100%" src="assets/anatomy.png" />
## Examples
### Dialog to... |
import React from "react";
import { Link, useNavigate } from "react-router-dom";
import styles from "./CategoryItem.module.scss";
function CategoryItem({ category }) {
const { imageUrl, title, route } = category;
const navigate = useNavigate();
function onNavigateHandler() {
navigate(route);
}
return (... |
import {
Modal,
ModalOverlay,
ModalContent,
ModalBody,
Button,
Flex,
Text,
useDisclosure,
} from "@chakra-ui/react";
import { FaTimes } from "react-icons/fa";
interface Props {
buttonText: string;
title: string;
children: React.ReactNode;
}
const ModalWrapper: React.FC<Props> = ({ buttonText, ti... |
<?php
namespace app\models;
use Yii;
use yii\helpers\ArrayHelper;
/**
* This is the model class for table "usuarios".
*
* @property int $id
* @property string $nombre
* @property string $apellido1
* @property string $apellido2
* @property string $email
* @property string $password
* @property string $provin... |
'use client'
import React from "react";
import {Dropdown, DropdownTrigger, DropdownMenu, DropdownItem, Button} from "@nextui-org/react";
import { Fruit } from "@prisma/client";
export default function FruitsDropDown( {fruits}:{fruits: Fruit[]} ) {
const [selectedKeys, setSelectedKeys] = React.useState(new Set(["Sele... |
import { animate, state, style, transition, trigger ,keyframes } from '@angular/animations';
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-about-me',
templateUrl: './about-me.component.html',
styleUrls: ['./about-me.component.css'],
animations: [
trigger('AboutMeAanimatio... |
import React from 'react';
import { Task } from '../../data/Models/Task';
import styles from '../../styles/common/Task.module.scss';
import Slider from './Slider';
import TaskMini from './TaskMini';
interface Props {
task: Task
}
const Task: React.FC<Props> = ({ task }) => {
return (
<div className={styles['t... |
//
// StepperBasic.swift
// SwiftUIBasic_review
//
// Created by Joy on 2023/03/24.
//
import SwiftUI
struct StepperBasic: View {
@State var stepperValue: Int = 0
@State var widthChange: CGFloat = 0
var body: some View {
VStack{
//기본 Stepper
Stepper("기본... |
import pandas as pd
import numpy as np
from sklearn.preprocessing import MinMaxScaler
import matplotlib.pyplot as plt
import seaborn as sns
features = pd.read_csv("./features.csv")
chosen_features = ['Std Saturation', 'Hue Std', 'Contrast', 'Min Saturation', 'CIVE', 'CIVE Ratio', 'ExG-ExR Ratio']
all_features = [
... |
---
title: 订阅并请求访问 [!DNL On Demand] 高级库存交易
description: 了解如何订阅和请求访问,[!DNL On Demand] 交易。
feature: DSP On Demand Inventory
source-git-commit: 3059a5b211a8a219b02930f7f5763d5ec1467b8e
workflow-type: tm+mt
source-wordcount: '393'
ht-degree: 0%
---
# 订阅并请求访问 [!DNL On Demand] 高级库存交易
*对于具有帐户类型的用户不可用 [!UICONTROL Ad Network... |
import { shell } from "electron";
import { difference, cloneDeep, partition, keyBy, omit } from "lodash";
import { z } from "zod";
import { IpcPlugin, AppContext } from "..";
import { UUID_REGEX } from "../../../shared/domain";
import { NoteSort, createNote, Note } from "../../../shared/domain/note";
import { Attachmen... |
package com.capstone.liveAloneCommunity.controller.email;
import com.capstone.liveAloneCommunity.dto.email.EmailAuthRequestDto;
import com.capstone.liveAloneCommunity.dto.email.EmailAuthValidateRequestDto;
import com.capstone.liveAloneCommunity.exception.email.EmailNotSentException;
import com.capstone.liveAloneCommun... |
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { HomeComponent } from './components/pages/home/home.component';
import { FindComponent } from './components/pages/find/find.component';
import { ListComponent } from './components/pages/list/list.component';
import... |
import { BookSchema } from "../types";
import { BookCategoryField, BookSortField } from "../consts";
import { DeepPartial } from "@reduxjs/toolkit";
import { bookModelActions, bookModelReducer } from "./bookSlice";
import { fetchBooks } from "../services/fetch-books";
import { GoogleBooksApiAnswer } from "@/shared/api/... |
import { Redis, type RedisOptions } from 'ioredis'
import { ms } from 'expresso-core'
interface SetOptions {
expiryMode?: string | any[]
timeout?: string | number
}
export class RedisProvider {
private readonly _options: RedisOptions
constructor(options: RedisOptions) {
this._options = options
}
pub... |
<!doctype html>
<html lang="en" xmlns:th="http://www/thymeleaf.org"
th:replace="base::layout(~{::section})">
<head>
<meta charset="UTF-8" />
<title>Document</title>
</head>
<body>
<section>
<div class="container mt-3 mb-3">
<div class="row">
<div class="col-md-8 offset-md-2">
<div class="my-card">
... |
import Vue from 'vue'
import Vuex from 'vuex'
// @ts-ignore
import {getCellphone,getUserdetail,getUserplaylist,getShareresource,getResourceLike} from '@/api/index.js'
Vue.use(Vuex)
export default new Vuex.Store({
state: {
//音乐时间
musicTime:'',
//歌词
lyricGroup:{},
//歌曲ID
musicId:0,
//歌曲列表... |
<?php
define(
'TAX_RATES',
array(
'Single' => array(
'Rates' => array(10, 12, 22, 24, 32, 35, 37),
'Ranges' => array(0, 10275, 41775, 89075, 170050, 215950, 539900),
'MinTax' => array(0, 1027.5, 4807.5, 15213.5, 34647.5, 49335.5, 162718)
),
'Married_Jointly' => array(
'Rates' =>... |
<?php
namespace App\Form;
use App\Entity\User;
use Doctrine\DBAL\Types\JsonType;
use Doctrine\DBAL\Types\ArrayType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormTypeInterface;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony... |
<?php
include '../connectDB.php';
$message = "";
// Xử lý thêm màu
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['add_colors'])) {
$colors = $_POST['colors'];
$stmt_add = $conn->prepare("INSERT INTO colors (color_code, color_hex, color_group, color_group_main) VALUES (?, ?, ?, ?)");
$stmt_chec... |
import React, { useState } from "react";
import { VariantTypes } from "../sharedTypes";
import { Typography } from "../Typo";
interface TabsType extends React.ComponentPropsWithRef<"div"> {
tabsValue: SingleTab[];
className?: string;
variant: VariantTypes;
}
interface SingleTab {
title: string;
id: string;
... |
from typing import Optional, Literal
from uuid import uuid4
from fastapi import FastAPI, HTTPException
from fastapi.encoders import jsonable_encoder
from pydantic import BaseModel
import random
import os
import json
# *I want to create an API for an e-commerce book store where I can see all the books in my catalog.
... |
class Solution {
public:
int maxNonOverlapping(vector<int>& nums, int target) {
int n = nums.size();
int ans=0, sum=0;
unordered_map<int,int> mp;
for(int i=0 ; i<n ; i++){
// Keep adding nums[i] to sum
sum += nums[i];
// If sum == targe... |
import { useContext, useState } from 'react';
import './login.scss';
import {Link, useNavigate, useNavigation} from 'react-router-dom';
import { AuthContext } from '../../contexts/authContext';
function Login() {
const navigation = useNavigation();
const navigate = useNavigate();
const [inputs, setInputs] = useS... |
module List where
import Prelude
hiding (replicate, map, filter)
import Nat
replicate :: Nat -> a -> [a]
replicate O _ = []
replicate (S n) x = x : (replicate n x)
map :: (a -> b) -> [a] -> [b]
map f [] = []
map f (x:xs) = (f x) : (map f xs)
filter :: (a -> Bool) -> [a] ->... |
//! [TITLE]
// Counting Duplicates
//! [DESCRIPTION]
// Write a function that will return the count of distinct case-insensitive alphabetic characters and numeric digits that occur more than once in the input string. The input string can be assumed to contain only alphabets (both uppercase and lowercase) and numeric d... |
package com.example.homework24.presentation.screen.home
import android.view.View
import androidx.core.os.bundleOf
import androidx.fragment.app.viewModels
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle
import androidx.navigation.fragment.findNavC... |
import React, {useEffect, useState} from "react";
import Banner from "components/Banner";
import Titulo from "components/Titulo";
function CadFilme (){
const [name, setName] = useState("");
const [gender, setGender] = useState ("");
const [favorito, setFavorito] = useState ("");
const [image_url, setI... |
<%-- EL을 사용하기 위해서는, page 디렉티브의 isELIgnored 속성을 false 로 설정해야한다. 하지만 명시하지 않을 경우 기본값이 false 이다. --%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp... |
import React, { useState, useEffect } from "react";
import { useParams, useHistory } from "react-router-dom";
import { Link } from "react-router-dom";
import { Button } from "react-bootstrap";
import Selector from "../partsSelector/partsSelector";
import "./planEdit.css";
import axios from "axios";
export default func... |
import * as React from 'react';
import IconButton from '@mui/material/Button';
import Menu from '@mui/material/Menu';
import MenuItem from '@mui/material/MenuItem';
import Link from 'next/link';
//Icons
import MenuIcon from '@mui/icons-material/Menu';
//hooks
import { useUser } from '@auth0/nextjs-auth0';
export def... |
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" co... |
//---------------------------------------------------------------------------
//! @file Client.cpp
//! @brief クライアントクラス
//---------------------------------------------------------------------------
#include "Client/BaseClient.h"
#include "Server/BaseServer.h"
#include <sstream>
namespace _network {
//---------------... |
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ficha de Solicitação de Passaporte - SME</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
... |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flutter code sample for DropdownButton.style
import 'package:flutter/material.dart';
class Dropdown_Button_Style extends StatelessWidget {
const Dr... |
import { Button } from "react-bootstrap";
import { useNavigate } from "react-router-dom";
import useProducts from "../../serviceHooks/useProducts";
import { useContext, useMemo, useState } from "react";
import ThemeContext from "../../Contexts/ThemeContext";
const categories = ["smartphones", "laptops"];
const Product... |
import {
privateProcedure,
publicProcedure,
router,
} from './trpc'
import { getKindeServerSession } from '@kinde-oss/kinde-auth-nextjs/server'
import { TRPCError } from '@trpc/server'
import { db } from '@/db'
import { z } from 'zod'
import { INFINITE_QUERY_LIMIT } from '@/config/infinite-query'
import { g... |
n, m = map(int, input().split())
nums = [] # 숫자가 담길 스택
def dfs():
if len(nums) == m: # 재귀함수로 반복 -> 함수 출력 조건을 먼저 걸어준다.
print(' '.join(map(str, nums)))
return
for i in range(1, n + 1): # 1부터 n까지의 자연수 중 선택
if i in nums: # 이미 선택한 숫자라면..
continue # 경우의 수에서 배제 -> 백트래킹
... |
function gerarNumerosEntre(min,max) {
if(min > max) {
[max,min] = [min,max]
}
return new Promise(resolve => {
setTimeout(function() {
const aleatorio = parseInt(Math.random() * (max - min +1)) + min
resolve(aleatorio)
},3000);
})
}
fun... |
import fs from "fs";
import * as path from "path";
function loadResource(resourcePath: string): string {
const fullResourcePath = path.join(__dirname, "..", "resources", ...resourcePath.split("/"));
return fs.readFileSync(fullResourcePath, { encoding: "utf-8" });
}
async function asyncSleep(millis: number): Prom... |
import React from 'react'
import { useState } from 'react'
import Progress from '../../components/Progress/Progress'
import './Upload.css'
import { message } from 'antd'
import { useRef } from 'react'
import { Link } from 'react-router-dom'
function Upload() {
const [fileList, setFilesList] = useState([])
const... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.