text stringlengths 184 4.48M |
|---|
const Banner = require('../models/bannerModel');
const asyncHandler = require('express-async-handler');
const loadAddBanner = asyncHandler(async (req, res) => {
try {
res.render('add-Banner', { Message: '' });
} catch (error) {
console.error(error);
}
});
const addBanner = asyncHandler(asy... |
import { useEffect, useState } from "react";
import { useNavigate } from "react-router-dom";
import axios from "axios";
import { Container,Button, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Paper, Grid, Typography ,} from '@mui/material';
import { useAuth } from '../../../context/AuthContext';
im... |
import React, { useEffect, useState, useMemo, useCallback } from "react";
import { Owner as OwnerModel } from "../../models/Owner";
import * as OwnerApi from "../../network/owner_api";
import { darken } from "@mui/material";
import MaterialReactTable, {
type MaterialReactTableProps,
type MRT_Cell,
type MRT_Colu... |
import { Test, TestingModule } from '@nestjs/testing'
import { PostController } from './post.controller'
import { PostService } from '../services/post.service'
describe('PostController', () => {
let controller: PostController
let service: PostService
beforeEach(async () => {
const serviceMock = {
... |
import { ClientSideRowModelModule } from '@ag-grid-community/client-side-row-model';
import {
ColDef,
Grid,
GridOptions,
IFiltersToolPanel,
ModuleRegistry,
} from '@ag-grid-community/core';
import '@ag-grid-community/core/dist/styles/ag-grid.css';
import '@ag-grid-community/core/dist/styles/ag-theme-alpine.cs... |
use rand::{thread_rng, Rng};
use std::fs::File;
use std::io::Read;
use std::path::{self, PathBuf};
use clap::Parser;
use colored::{Color, Colorize};
#[derive(Parser, Debug)]
#[command(author, about)]
struct Args {
file: PathBuf,
}
fn to_color(num: u8) -> (Color, Color) {
fn to_color_inner(num: u8) -> Color {... |
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:marvel_heroes/app/core/exceptions/marvel_exceptions.dart';
import 'package:marvel_heroes/app/modules/marvel_characters/models/character/characters_response_model.dart';
import '../models/comics/comic_model.dart';
part 'marvel_state.freezed.da... |
// url: https://leetcode.com/problems/reorder-list/
/**
* Definition for singly-linked list.
* function ListNode(val, next) {
* this.val = (val===undefined ? 0 : val)
* this.next = (next===undefined ? null : next)
* }
*/
/**
* @param {ListNode} head
* @return {void} Do not return anything, modify head ... |
package com.ms.bf.client.adapter;
import ch.qos.logback.classic.spi.ILoggingEvent;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.ms.bf.client.adapter.kafka.client.KafkaProducerAdapter;
import com.ms.bf.client.config.property.KafkaProperty;
import com.ms.bf.client.domain.Client;
import com.ms.bf... |
## a long-long story....
## Final project - How average senitments changed over time of ALL books
#
# DS of Unstructured Text Data held by Eduardo Ariño de la Rubia on CEU in 2018
# Tamas Burghard
#
#
# 01 making the list of books
#
# This script filter a bunch of books from the Gutenberg project (more than 10... |
import Vue from 'vue'
import VueRouter from 'vue-router'
import TripDetails from '../views/TripDetails'
Vue.use(VueRouter)
const routes = [
// {
// path: '/',
// name: 'home',
// component: HomeView
// },
{
path: '/about',
name: 'about',
// route level code-splitting
// this generat... |
%--- Description ---%
%
% Filename: generate_hermite_matrix.m
% Authors: Ben Adcock, Juan M. Cardenas, Nick Dexter
% Part of the paper "A Unified Framework for Learning with Nonlinear Model
% Classes from Arbitrary Linear Samples"
%
% Description: generates a measurement matrix using tensor Hermite
% polynomials from... |
import {
FormControl,
FormLabel,
TextField,
Button,
Typography,
} from '@mui/material';
import { CustomContainer } from './styles';
import { Link, useLocation, useNavigate } from 'react-router-dom';
import { useState, ChangeEvent } from 'react';
import toast from 'react-hot-toast';
import { login } from '../.... |
use crate::{helpers::vec_to_led_data, Color, Effect, LedData, LED_SIZE};
use std::{collections::VecDeque, f64::consts::PI};
#[derive(Clone)]
pub struct RainbowEffect {
iterator: usize,
}
impl Effect for RainbowEffect {
fn new() -> Self {
Self { iterator: 0 }
}
fn update(&mut self) -> anyhow::... |
<?php
namespace App\Controller;
use App\Repository\CommentRepository;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
class GuestbookController extends Abstra... |
<?php
declare(strict_types=1);
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2021 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
namespace Akeeba\Passwordless\Webauthn;
use Akeeba\Passwordless\Assert\Assertion;
use... |
<!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">
<link rel="stylesheet" href="styles.css">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300... |
package chapter2.item3.min;
public class Elvis {
public static Elvis instance;
public static Elvis getInstance(){
if(instance == null){
instance = new Elvis();
}
return instance;
}
/**
* 장점
* 구현 간결 싱글턴입을 api 들어냄
* 단점
* 싱글턴을 사용하는 클라이언트가 테스트 하기 어려움... |
# BVI-VFI: A Video Quality Database for Video Frame Interpolation
### Duolikun Danier, Fan Zhang, David Bull
### IEEE Transactions on Image Processing (TIP)
[Project](https://danier97.github.io/BVI-VFI-database) | [Database](https://forms.office.com/Pages/ResponsePage.aspx?id=MH_ksn3NTkql2rGM8aQVG1fDz7azbERMp_0LZtGJZ... |
package com.care.sekki.recipeboard;
import java.io.File;
import java.io.FileInputStream;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframewor... |
/*
* Copyright 2023 CloudWeGo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... |
from flask import Flask, request, jsonify
from pymongo import MongoClient
from datetime import datetime
from bson import ObjectId
import os
import re
from gevent.pywsgi import WSGIServer
app = Flask(__name__)
# Configura la conexión a MongoDB
mongo_uri = os.getenv("MONGO_URI")
client = MongoClient(mongo_uri)
db = cli... |
// ======== Module Imports ======== //
import {dom, domProduct} from '../dom.js';
import { singleProductUrl } from '../data.js';
import { initTheme,toggleTheme } from '../darkMode.js'
import { initStartingData } from '../fillStartingData.js'
import { toggleNavListeners } from '../toggleSidebar.js';
import {toggleCartLi... |
##### 消息队列的作用是啥
1. 服务解耦,生产者和消费者的解耦
2. 削峰填谷
3. 可以持久化,数据也可以保存下来
4. 一定程度起到了限流的作用
##### kafka名词解释
生产者:消息的产生方
消费者:消息的消费方
broker:kafka服务器,负责接受消息,持久化消息,提供消息给消费者
topic:主题
Partition:分区,一个topic下有m个分区,每个分区是一组有序的消息日志,分区编号从0开始
Replica:副本,备份机制,一个partition可以有多个副本,不同副本分布在不同的broker上,但是副本只可以有一个 领导者副本,其他都是追随者副本
TPS: 消费者吞吐量
Cons... |
<%= stylesheet_link_tag "dashboard", "data-turbo-track": "reload" %>
<body>
<header class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow">
<a class="navbar-brand col-md-3 col-lg-2 me-0 px-3" href="#"><span>Hi </span><%= current_user.first_name.capitalize %>!</a>
<button class="navbar-toggle... |
package CashMaster.calculator;
import static CashMaster.view.Colors.RESET;
import CashMaster.model.Record;
import CashMaster.util.FileUtil;
import CashMaster.view.Colors;
import java.util.List;
public class FinancialCalculator {
static List<Record> records = FileUtil.getRecords();
/**
* Calculates the total ... |
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\Customer;
use App\Http\Requests\AddCustomerRequest;
class CustomerController extends Controller
{
public function addCustomer(AddCustomerRequest $request)
{
$validated = $request->validated();
$customer = new Cu... |
import ImageIcon from '@mui/icons-material/Image';
import { useRef, useState } from 'react';
function AddBookForm({books, setBooks, setFormState}) {
const [image, setImage] = useState(null)
const lastId = books && books.length > 0 ? books[books.length - 1].id : 0;
const title = useRef(null),
auth... |
package com.practice.springboottesting.integration;
import com.practice.springboottesting.domain.Employee;
import com.practice.springboottesting.repository.EmployeeRepository;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
impo... |
---
created: 2020-02-12
last_modified: 2022-03-08
version: 1.1
tactics: Credential Access
url: https://attack.mitre.org/techniques/T1555/002
platforms: Linux, macOS
tags: [T1555_002, techniques, Credential_Access]
---
## Credentials from Password Stores- Securityd Memory
### Description
An adversary may obtain root ... |
# 以下部分均为可更改部分
import dataclasses
from answer_task1 import *
import smooth_utils
def compute_velocity(pos, dt):
'''
计算速度
'''
return (pos[1:] - pos[:-1]) / dt
@dataclasses
class motion_data:
motion: BVHMotion
# pos: np.ndarray
pos20: np.ndarray
pos40: np.ndarray
vel: np.ndarray
r... |
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { HttpClient } from '@angular/common/http';
import { SearchByNameResult, HistoryData } from '../home/home.interface';
import { environment } from 'src/environments/environment';
const routes = {
searchByName: (name: string) =>
... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Step11_Loop.html</title>
</head>
<body>
<button id="printBtn">출력</button>
<button id="printBtn2">출력2</button>
<div>div1</div>
<div>div2</div>
<div>div3</div>
<div>div4</div>
<div>div5</div>
<script src="js/jquery-3.2.1.js"></script>
<script>
var n... |
package com.example.mariaiaandroid.singleton.vm
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.example.mariaiaandroid.ui.state.FormBlockUiState
import com.google.ai.client.generativeai.GenerativeModel
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flo... |
import 'package:dartz/dartz.dart';
import 'package:http/http.dart' as http;
import 'package:kopinale/core/constants/variables.dart';
import 'package:kopinale/data/models/responses/city/city_response_model.dart';
import 'package:kopinale/data/models/responses/provience/provience_response_model.dart';
class RajaongkirRe... |
// Write the code that will log true or false for the following:
// Is 34 divided by 3 greater than 67 divided by 2?
console.log((34 / 3) > (67 / 2));
// Does 5 evaluate to the same as "5"?
console.log(5 == "5");
// Does 5 strictly equal "5"?
console.log(5 === "5");
// Does !3 strictly equal 3?
console.log(!3... |
import 'package:flutter/material.dart';
import 'package:zedzat/screens/profile.dart';
import 'package:zedzat/screens/rewards.dart';
import 'cart.dart';
import 'homescreen.dart';
import 'offers.dart';
class BottomBarScreen extends StatefulWidget {
const BottomBarScreen({super.key});
@override
State<BottomBarScr... |
const { expect } = require('chai');
const { ethers } = require('hardhat');
const { BigNumber } = require('ethers');
const ERC20 = require('../data/ERC20.json');
const { CONFIG, getBigNumber, DISCOUNT, getVoteData, getConfig } = require('../scripts/utils');
const GNOSIS_FLAG = false;
describe('StakerMap', function () ... |
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Lunch Management</title>
<link
rel="icon"
type="image/x-icon"
href="{% static 'images/favicon.png' %}"
/>
<link
... |
import {
AfterViewInit,
Component,
EventEmitter,
OnInit,
Output,
} from '@angular/core';
import { CommonModule } from '@angular/common';
import { MapToolbarComponent } from './toolbar/toolbar.component';
import { MapDropdownsComponent } from './dropdowns/dropdowns.component';
import { RouteDataService } fro... |
/* eslint-disable jsx-a11y/alt-text */
import React, { useContext, useEffect } from "react";
import AdminContext from "../../context/AdminContext";
import { useNavigate } from "react-router-dom";
import "./categories.scss";
const Categories = () => {
const { state, dispatch, createCategory,getCategory} = useContext(A... |
export function findRepeatedDnaSequences(s: string): string[] {
const n = s.length
if (n < 10) return []
const ans = new Set<string>()
const set = new Set<string>()
for (let i = 0; i + 10 <= n; ++i) {
const substr = s.slice(i, i + 10)
if (set.has(substr)) {
ans.add(substr)
} else {
... |
<template>
<div class="article-container">
<el-card>
<div slot="header">
<my-bread>{{articleId ? '修改' : '发布'}}文章</my-bread>
</div>
<el-form label-width="100px">
<el-form-item label="标题:">
<el-input v-model="articleForm.title" style="width:400px"></el-input>
</el... |
import streamlit as st
import pandas as pd
import plotly.graph_objects as go
# ======= LAYOUT =======
st.set_page_config(layout='wide')
#### Sidebar
st.sidebar.header("Operadoras de saúde")
## RANKING DAS 15 MELHORES OPERADORAS - POR BENEFICIÁRIO
operadoras = [368253, 359017, 5711, 326305, 6246, 339679, 343889, 7... |
import type { MsgProps } from './common-msg'
export type Platform = 'WEB' | 'APP' | 'ALL'
export type Error = Partial<MsgProps>
export type OK = Partial<MsgProps>
export const Fn = <T>(x: T): T => x;
export type Getters<Type> = {
[Property in keyof Type as `get${Capitalize<string & Property>}`]: () => Type[Prope... |
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:my_task_diary/libraries/applications_library.dart';
class DatesLibrary {
DatesLibrary._();
// *** DATE ***
// Converti une DateTime en une Date en String avec les heures, minutes, secondes à 0.
static String getDateString... |
//
// PostingViewController.swift
// Survy
//
// Created by Mac mini on 2023/05/06.
//
import UIKit
import Model
import SnapKit
import Toast
class PostingViewController: BaseViewController, Coordinating {
var currentTags: [Tag] = []
var currentTargets: [Target] = []
var coordinator: Coor... |
package com.kuropatin.zenbooking.validation;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementTy... |
import { Component, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { RoleDialogComponent } from './../popups/role-dialog/role-dialog.component';
@Component({
selector: 'app-role',
templateUrl: './role.component.html',
styleUrls: ['./role.component.css']
})
export cl... |
export interface Product {
id: string;
category: Category;
name: string;
price: string;
isFeatured: boolean;
domain: Domain;
color: Color;
images: Image[];
}
export interface Image {
id: string;
url: string;
}
export interface Billboard {
id: string;
label: string;
imageUrl: string;
}
expor... |
import { BrowserRouter, Routes, Route} from "react-router-dom";
import Home from "./paginas/home";
import Categorias from "./paginas/categorias";
import Detalle from "./paginas/detalle";
import Nav from "./components/nav/nav";
import Footer from "./components/footer/footer";
import NotFound from "./paginas/notfound"
fu... |
import React, { useEffect } from 'react';
import styled from 'styled-components';
import { useLanguage } from '../../contexts/LanguageContext';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faXmark } from '@fortawesome/free-solid-svg-icons';
const Container = styled.div`
justify-content: ... |
<template>
<div class="relative group cursor-pointer">
<div class="flex items-center justify-center">
<button
class="relative menu-hover my-2 py-2 font-medium text-secondaryColor lg:group-hover:text-thirdColor lg:text-xl lg:mx-4"
>
{{ $t(title) }}
</button>
<span
:c... |
import * as sinon from 'sinon';
import { options, testResponse } from '../constants';
import { expect } from 'chai';
import { get } from 'lodash';
import { NonfigRequest } from '../../src/request';
import { nonfig, Nonfig } from '../../index';
import { Configuration } from '../../src/configuration.entity';
describe('F... |
<template>
<main class="main-content">
<div class="sidebar">
<SidebarComponent />
</div>
<div class="game-cards">
<div v-for="game in games" :key="game.id" class="game-card">
<GameCard :game="game" />
</div>
</div>
</main>
</template>
<script>
import "@/styles/home.css";
i... |
import React from 'react';
import { useSpring, animated } from '@react-spring/web';
import './App.css';
const sections = [
{
id: 'about',
title: 'About Me',
image: 'DronePhotos\Hoan Bridge.jpg',
content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam venenatis quam at libero tristiq... |
import {
ActivityIndicator,
Text,
TouchableOpacity,
TouchableOpacityProps,
} from 'react-native';
import Components from '../Themes/Components';
import React from 'react';
import Colors from '../Themes/Colors';
type Props = {
isPending?: boolean | undefined;
text: string;
} & TouchableOpacityProps;
const ... |
<div class="content-container">
{{#if isPersonalPost}}
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal"
data-bs-whatever="@mdo">Edit Post</button>
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
... |
import { BaseComponent } from "./base/baseComponent.js"
import { DeployedTower } from "./towers/deployedTower.js"
/**
* This component stores all the information about the towers that are out on the map
* In future, might be best to remove the sprite creation functions out
*/
export class TowersComponent extends Ba... |
## import data from Gallagher et al 2021, supplementary in Wetland Soils
## from Tasmania, AUS
## export for marsh soil C
# contact Tania Maxwell, tlgm2@cam.ac.uk
# 22.07.22
library(tidyverse)
input_file01 <- "reports/03_data_format/data/core_level/Gallagher_2021_SI/Gallagher_2021_TableS2.csv"
input_data01 <- read.... |
// Import your Session model
const Session = require('../models/session');
// Route handler to get free sessions
const getFreeSessions = async (req, res) => {
try {
const sessions = await Session.find({ status: 'free' });
const formattedSessions = sessions.map(({ wardenId, dayOfWeek, time, slotDetails, st... |
package com.finalproject.travelagency.service;
import com.finalproject.travelagency.auth.AuthenticationService;
import com.finalproject.travelagency.exception.UserNotFoundException;
import com.finalproject.travelagency.model.User;
import com.finalproject.travelagency.repository.UserRepository;
import org.springframe... |
import { inject, Injectable } from '@angular/core';
import { filter, map } from 'rxjs/operators';
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
import { JsonLdService, SeoSocialShareData, SeoSocialShareService } from 'ngx-seo';
import { BehaviorSubject, Observable } from 'rxjs';
import { Seo... |
import MeetupDetail from "../../components/meetups/MeetupDetail";
import { MongoClient, ObjectId } from "mongodb";
import Head from "next/head";
function MeetupDetails(props) {
return (
<>
<Head>
<title>{props.meetupData.title}</title>
<meta name="description" content={props.meetupData.desc... |
#include <iostream>
#include <SDL.h>
#include <SDL_ttf.h>
#include "Ball.h"
#include "Paddle.h"
#include "PlayerScore.h"
#include "Utils.h"
#include <chrono>
bool running = true;
float deltaTime = 0.0f;
int player1Score = 0;
int player2Score = 0;
enum Buttons {
Paddle1Up,
Paddle1Down,
Paddle2Up,
Paddle2Down,
};
boo... |
// SPDX-Wicense-Identifiew: GPW-2.0
/*
* Impwementation of HKDF ("HMAC-based Extwact-and-Expand Key Dewivation
* Function"), aka WFC 5869. See awso the owiginaw papew (Kwawczyk 2010):
* "Cwyptogwaphic Extwaction and Key Dewivation: The HKDF Scheme".
*
* This is used to dewive keys fwom the fscwypt mastew keys.
*... |
from dataclasses import dataclass, field
from typing import Optional
from pulumi import Output
@dataclass
class DBParameter:
name: str
"""The name of the RDS parameter."""
value: str
"""The value of the RDS parameter."""
apply_method: Optional[str] = "immediate"
"""One of `immediate` for dy... |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_itoa.c :+: :+: :+: ... |
<h2><%=l(:label_task_manager)%></h2>
<%= form_tag(task_manager_path, :method => :get) do %>
<fieldset>
<div class="splitcontentleft, col-sm-3">
<label for='project_id'><%= l(:label_projects) %>:</label>
<%= select_tag 'project_id', content_tag('option') + options_from_collection_for_select(@projects, :... |
import { useEffect } from 'react'
import { deleteDoc, doc } from "firebase/firestore";
import { useNavigate } from 'react-router-dom';
import db from '../../firebase';
import { RiDeleteBin2Fill } from "react-icons/ri"
import "./Main.css"
import ChartComponent from '../components/ChartComponent';
function Main({docs, ... |
import "./slider.css";
import NavigateNextRoundedIcon from '@mui/icons-material/NavigateNextRounded';
import CalendarMonthRoundedIcon from '@mui/icons-material/CalendarMonthRounded';
import PersonOutlineIcon from '@mui/icons-material/PersonOutline';
import LabelOutlinedIcon from '@mui/icons-material/LabelOutlined';
imp... |
# ToDo Android App
Welcome to the ToDo Android App! This simple and intuitive task management application helps you keep track of your tasks and stay organized. This README file provides an overview of the app's main features and how to use them.
## Overview
Check the story here: [ToDo Story](https://app.screenspace.... |
import assert from 'node:assert'
import http from 'http'
import express from 'express'
import { promisifiedClose, promisifiedListen } from '../src/server-promises.js'
describe('server-promises.ts', function () {
const serversToCleanUp: http.Server[] = []
afterEach(async function () {
for (const server of serv... |
import java.util.Scanner;
public class TestaHora {
static final Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
Hora inicio;
Hora fim;
fim = new Hora();
inicio = new Hora();
inicio.h = 9;
inicio.m = 23;
inicio.s = 5;
System.out.print("Com... |
//
// Created by Vitor Hugo on 05/04/2022.
//
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include "occupation/occupation.h"
#define WRITE_END 1
#define READ_END 0
#define PIPE_SZ 4096
#ifndef COUGH_COUGH_IO_H
#define COUGH_COUGH_IO_H
/**
* reads from File Descriptor
* @param f... |
/*
* Copyright 2002-2019 the original author or authors.
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... |
package com.example.a4ads_11_04
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Button
import androidx.compose.material3.Text
... |
<%= form_for(@debate, url: form_url, multipart: true) do |f| %>
<%= render 'shared/errors', resource: @debate %>
<div class="row">
<div class="small-12 column">
<%= f.label :title, t("debates.form.debate_title") %>
<%= f.text_field :title, maxlength: Debate.title_max_length, placeholder: t("debates... |
from odoo import models, fields, api
from odoo.exceptions import ValidationError
class ApproveHubForm(models.Model):
_name = 'approvehub.form'
_description = 'Approval Form'
name = fields.Char(string='Reference', required=True)
model_list = fields.Many2one('ir.model', string='Model Name')
partner_... |
import React, { Component } from 'react';
import * as firebase from 'firebase';
class LoginForm extends Component {
constructor() {
super();
this.state = {
method: 'login',
header: 'Login',
email: '',
password: '',
user: ''
}
}... |
### TL;DR
quantipy gives your calculations:
- intuitive dimensional analysis
- effortless unit conversion
- automatic commensurability enforcement
see [here](https://github.com/itsmiir/qpy/blob/main/units.md) for a list of units and constants the package adds
---
### what is quantipy?
#### quantipy is a dimensional ... |
import { useState } from 'react'
import { useNavigate } from 'react-router-dom'
import ZodGenericValidation from 'app/externalLibraries/zod/ZodSchemaGeneric.ts'
import useErrors from 'app/hook/useErrors.ts'
export default function useHome() {
const [room, setRoom] = useState('')
const { getMessageZodErro, getE... |
### Question 2

- a. row 2111 col 17
- b.
- gender : categorical, nominal
- age : numerical, continuous
- height : numerical, continuous
- weight : numerical, continuous
- family_overweight : categorical, nominal
- high_caloric_food : categorical, nominal
- eat_vegetables : c... |
package dbadapter
import (
"context"
"encoding/json"
"fmt"
"runtime"
"sort"
"sync"
"testing"
"time"
"github.com/jackc/pgx/v5"
"github.com/stretchr/testify/require"
"weavelab.xyz/river/internal/dbsqlc"
"weavelab.xyz/river/internal/rivercommon"
"weavelab.xyz/river/internal/riverinternaltest"
"weavelab.xy... |
package com.example.springstudents_KorsakovYT.service.Impl;
import com.example.springstudents_KorsakovYT.model.Student;
import com.example.springstudents_KorsakovYT.repository.InMemoryStudentDAO;
import com.example.springstudents_KorsakovYT.service.StudentService;
import lombok.AllArgsConstructor;
import org.springfra... |
library(parallel)
library(doSNOW)
numCores<-floor(detectCores() * 0.75)
cl <- makeCluster(numCores)
registerDoSNOW(cl)
# progress bar ------------------------------------------------------------
library(progress)
iterations <- 100 # used for the foreach loop
pb <- progress_bar$new(
... |
from decimal import Decimal
from django.conf import settings
from django.contrib.gis.db import models
from django.utils.translation import gettext_lazy as _
from .mixins import TimestampedModelMixin, UserStampedModelMixin
VAT_PERCENT = Decimal(0.24)
class RefundStatus(models.TextChoices):
OPEN = "OPEN", _("Ope... |
import type {NextFunction, Request, Response} from 'express';
import express from 'express';
import FreetCollection from '../freet/collection';
import * as userValidator from '../user/middleware';
import * as freetValidator from '../freet/middleware';
import * as util from './util';
import FeedCollection from './collec... |
import { Component, Input, OnInit } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { MatSelectChange } from '@angular/material/select';
import { MatSnackBar } from '@angular/material/snack-bar';
import... |
<?php
/**
* Upgrader API: Bulk_Plugin_Upgrader_Skin class
*
* @since 4.6.0
*/
/**
* Bulk Theme Upgrader Skin for WordPress Theme Upgrades.
*
* @since 3.0.0
* @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.
* @see Bulk_Upgrader_Skin
*/
class Bulk_Theme_Upgrader_Skin exte... |
//
// CustomCell.swift
// UnsplashPhotoApp
//
// Created by Amir on 30.04.2022.
//
import UIKit
final class CustomCollectionCell: UICollectionViewCell {
static let identifier = "CustomCollectionViewCell"
private let padding = 2.0
private var imageURL: URL? {
didSet {
... |
package org.siri_hate.main_service.model.dto.mapper;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.factory.Mappers;
import org.siri_hate.main_service.model.dto.request.event.EventFullRequest;
import org.siri_hate.main_service.model.dto.response.event.EventFullResponse;
import or... |
//{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
class Node{
public:
int val;
Node *next;
Node(int num){
val=num;
next=NULL;
}
};
// } Driver Code Ends
//User function Template for C++
/*
class Node{
public:
int val;
Node *next... |
import { Icon } from "@chakra-ui/icons";
import {
Box,
Button,
Container,
Divider,
Flex,
Heading,
Stack,
Text,
} from "@chakra-ui/react";
import { withUrqlClient } from "next-urql";
import Link from "next/link";
import { useState } from "react";
import { FaUser } from "react-icons/fa";
import { Loaders,... |
package org.apache.bigtop.manager.server.controller;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.apache.bigtop.manager.server.model.dto.ConfigurationDTO;
... |
import { Helmet } from "react-helmet";
import Header from "../components/Header";
import Input from "../utils/Input";
import Checkbox from "../utils/Checkbox";
import { useState } from "react";
import { useForm } from "react-hook-form";
import { registerAPI } from "../api/auth";
import { useTheme } from "../context/The... |
#pragma once
class EUserBrokerOrderDraft;
class EUserBrokerOrder : public Entity // todo: rename to EBotUserBrokerOrder
{
public:
static const EType eType = EType::userBrokerOrder;
public:
enum class Type
{
buy = meguco_user_broker_order_buy,
sell = meguco_user_broker_order_sell,
};
enum class Sta... |
import { Button, buttonVariants } from "@/components/ui/button"
import { Label } from "@/components/ui/label"
import { cn } from "@/lib/utils"
import { ImagePlus, X } from 'lucide-react'
import Image from 'next/image'
import { useEffect, useState } from 'react'
export interface SelectedPhoto {
file: File,
url... |
import { base_url_store } from "@/shared/lib/requestUrl";
import { createAsyncThunk } from "@reduxjs/toolkit";
import axios from "axios";
const purchaseURL = `${base_url_store}/purchase`;
export const getStorePurchase = createAsyncThunk("purchase/get", async () => {
try {
const response = await axios.get(purchas... |
<template>
<BaseContainer
:module="$t('menu.modules.customers')"
:title="$t('customers.title')"
>
<div class="card">
<BaseTableHeader
:refresh-action-field="{ page: 1, field: { next: true } }"
:title="$t('customers.customer.listTitle')"
add-action-router-name="customer.form... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.