text stringlengths 184 4.48M |
|---|
using Application.DAL.Helper;
using Core.Interfaces;
using Core.Services;
using Data.Contexts;
using Data.Repos;
using Data.Repos.DiscountRepo;
using Data.Repos.OrderRepo;
using Data.Repos.ProductRepo;
using Data.SeedData;
using Data.UnitOfWork;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.Asp... |
package HeimaLesson6.Oop.FilmSample;
import java.util.Scanner;
/*
设计一个电影系统:
1.创建一个电影对象实体类;
2.创建一个电影操作对象类;
3.准备全部电影信息
* */
public class FilmSample {
public static void main(String[] args) {
Film[] films = new Film[4];
Film m1 = new Film(1,"水门桥",38.9,9.8,"徐克","吴京","12万人想看");
Film m2 = new Fi... |
import React, { useEffect, useState } from 'react';
import CustomerTable from './CustomerTable';
import AppsContainer from '../../../@crema/core/AppsContainer';
import { useIntl } from 'react-intl';
import { useDispatch, useSelector } from 'react-redux';
import { getCustomers } from '../../../redux/actions';
import App... |
import * as Yup from 'yup';
export interface IProduct {
id: string,
name: string,
price: number,
original_price: number,
description: string,
images:{ base_url: string }[],
brand: {
id: number,
name: string,
slug: string
},
specifications: ISpecification[]
}
e... |
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Primitives;
using System;
using System.Threading.Tasks;
using TrojWebApp.Models;
using TrojWebApp.Services... |
package ch.kleis.lcaac.core.lang.value
import ch.kleis.lcaac.core.lang.expression.EQuantityScale
import ch.kleis.lcaac.core.lang.expression.EStringLiteral
sealed interface DataValue<Q> : Value<Q>
data class StringValue<Q>(val s: String) : DataValue<Q> {
override fun toString(): String {
return s
}
... |
import React, { useState, useEffect } from 'react';
import GraphiQL from 'graphiql';
import 'graphiql/graphiql.css';
import CustomToolbar from './CustomToolbar';
import GraphiQLExplorer from 'graphiql-explorer';
import { graphQLFetcher } from '../utils/fetcher';
import { getIntrospectionQuery, buildClientSchema } from ... |
import React, { useEffect } from "react";
import { useSelector } from "react-redux";
import { Link, useNavigate } from "react-router-dom";
import MetaData from "../Layout/MetaData";
import Loader from "../Layout/Loader/Loader";
import "./css/Profile.css";
const Profile = () => {
const navigate = useNavigate();
cons... |
<!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>Flex</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="menu-container">
... |
package com.example.to_docompose.ui.screens.list
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import a... |
<div class="list-group-item list-group-item-action mt-2 mb-2 rounded-3">
<div class="row d-flex w-100 justify-content-between mt-2 mb-2">
<div class="col-md">
<%= recipe_tile_image(current_user, recipe) %>
</div>
<div class="col text-left">
<h5><%= recipe.title %></h5>
<%= recipe_badg... |
package com.kotlinenjoyers.trackiteasy.ui.common
import android.content.res.Configuration
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.co... |
#include "person.h"
#ifndef Zombie_H
#define Zombie_H
using std:: string;
class Zombie : public Person{
protected:
int x;// Ava - testing
int y;// Ava - testing
public:
//Base Constructor
Zombie() : Person() {}
//Augmented Constructor
Zombie(int spd, int xpos, int infec... |
namespace HuffmanCoding.UnitTests;
public class HuffmanFrequencyTableBuilderTests
{
[Fact]
public void WithMaxNGramLength_ShouldSetMaxNGramLength()
{
// Arrange
var builder = new HuffmanFrequencyTableBuilder();
// Act
var result = builder.WithMaxNGramLength(3);
//... |
const SEVEN = 7;
const MAX = "9876543201";
function featured(featuredNum) {
if(featuredNum >= MAX) {
return console.log("There is no possible number that fulfills those requirements.");
}
while(true) {
featuredNum = getDivisibleSeven(featuredNum);
if(!containsDuplicates(featuredNum)) {
break;
... |
<?php
/**
* @file
* Install, update and uninstall functions for the hello module.
*/
use Drupal\Core\Database\Database;
/**
* Implements hook_schema().
*/
function hello_schema() {
$schema['hello_node_history'] = array(
'description' => 'Stores node update history.',
'fields' => array(
'hid' => ... |
# Feature: Manage posts
# In order to [goal]
# [stakeholder]
# wants [behaviour]
#
# Scenario: Register new post
# Given I am on the new post page
# When I fill in "Title" with "title 1"
# And I press "Create"
# Then I should see "title 1"
#
# # Rails generates Delete links that use Javasc... |
\input{base.tex}
\begin{document}
\title{Visual illusions and interactions in biologically inspired neural networks. Analyzing perception of tilt}
\author{Martin Andreev Asenov}
% to choose your course
% please un-comment just one of the following
\course{Artificial Intelligence and Computer Science}
%\course{Artifi... |
import { recipes } from '../../data/recipes'
import { BotContext } from '../../types'
import {
InlineKeyboardButton,
ExtraEditMessage,
ParseMode,
} from 'telegraf/typings/telegram-types'
import {
aggregateIngredients,
getAllIngredientsFor,
shiftArrayBy,
} from './dinnerUtils'
const SAVED_OPTIONS_KEY = 'sav... |
<template>
<div>
<div :class="businessObjId ? 'top-block notop' : 'top-block'">
<el-row>
<el-col :span="16">
<PmToolbar>
<PmToolbarItem
v-permission="FuncCode.afc_f_role_add"
plain
icon="el-icon-plus"
@click="openAdd"
... |
import React from 'react';
import { Outlet } from 'react-router-dom';
import { Box, Grid, Paper, Toolbar } from "@mui/material";
import { Header } from "./Header/Header";
import { SideBar } from "./SideBar/SideBar";
import { provider, useInstance } from "react-ioc";
import { observer } from "mobx-react-lite";
import Na... |
import axios from '../../src/index'
// axios({
// url: '/extend/post',
// method: 'post',
// data: {
// msg: 'hi'
// }
// })
//
// axios.request({
// url: '/extend/post',
// method: 'post',
// data: {
// msg: 'hello'
// }
// })
//
// axios.get('/extend/get')
//
// axios.options('/extend/options... |
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('slices', function (Blueprint $table) {
... |
import { useState, useEffect } from "react";
import { getAvatarUrl } from "../functions/getAvatarUrl";
import { WalletAdapterNetwork } from "@solana/wallet-adapter-base";
import { useConnection, useWallet } from "@solana/wallet-adapter-react";
import { clusterApiUrl, Connection, Keypair, LAMPORTS_PER_SOL, PublicKey, Sy... |
---
'$title': العمل مع البيانات عن بُعد
$order: 3
description: ماذا لو كانت بياناتك القابلة للربط كبيرة جدًا أو مركَّبة بحيث يتعذر استردادها عند تحميل الصفحة؟ أو ماذا لو كان لكل وحدة حفظ مخزون سعر يستغرق ...
toc: 'true'
---
ماذا لو كانت بياناتك القابلة للربط كبيرة جدًا أو مركَّبة بحيث يتعذر استردادها عند تحميل الصفحة؟... |
Support Vector Machines
SVM is a classification method.
1. Support Vector Classifier.
2. Support Vector Machine.
Data has No Overlap - Separable Data
-----------------------------------------
Maximal Margin Classifier: is a optimization problem in the heart.
Non-separable Data and Noisy Data
----------------... |
/*
* Copyright 2018-2022 Hazelcast, Inc
*
* 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... |
'use client';
import client from '@/apis/core';
import UserInfo from '@/app/mypage/_components/UserInfo';
import { Button } from '@/components/ui/button';
import { Separator } from '@/components/ui/separator';
import { routes } from '@/constants/routeURL';
import { useRequestPermission } from '@/hooks/useRequestPermis... |
package fp.chapter03.exercises
import org.junit.jupiter.api.Test
import kotlin.test.assertEquals
class P0315ReplicateWithTailRec {
private tailrec fun replicate(n: Int, element: Int, acc: List<Int> = emptyList()): List<Int> = when {
n <= 0 -> acc
else -> replicate(n - 1, element, listOf(element) +... |
package com.example.fitflow.viewmodels.rutina
import android.widget.Toast
import androidx.compose.runtime.State
import androidx.compose.runtime.mutableStateOf
import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.example.fitflow.dominio.model... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>More CSS Practice</title>
</head>
<!-- Here I shall be exploring styling my CSS differently:
Instead of using Tags which will affect both the parent and the c... |
/*
* Copyright (c) 2022 Huawei Device 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 ... |
#include "main.h"
/**
* _pow_recursion - return power of numbers
* @x: x power
* @y: of y
* Return: value
*/
int _pow_recursion(int x, int y)
{
if (y < 0)
return (-1);
else if (y == 0)
return (1);
else if (y == 1)
return (x);
else
return (x * _pow_recursion(x, y - 1));
} |
import React, { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import axios from 'axios';
import '../styles/AddSong.css';
import '../images/EmptyStage.jpg';
const AddSong = () => {
const navigate = useNavigate();
const [song, setSong] = useState({ title: '', musician: '', notes: '', s... |
---
title: 深度学习模型优化技术实操:模型剪枝、量化、知识蒸馏与轻量化网络设计
published: 2024-04-30
description: 探索深度学习中的模型优化技术,包括模型剪枝、量化、知识蒸馏和轻量化网络设计,旨在提升模型效率并减少计算资源需求。
tags: [模型优化, 模型剪枝, 量化, 知识蒸馏, 轻量化网络]
category: 技术
draft: false
---
## 模型剪枝
模型剪枝是深度学习领域中用于优化神经网络模型的一种技术。它的核心思想是通过移除模型中一些不重要或冗余的参数(比如权重较小或对输出影响较小的神经元),从而减少模型的大小和计算需求,提高模型的运行速度,同时尽量保持模型... |
let specialItems = document.getElementById("special-items");
let basket = JSON.parse(localStorage.getItem("data")) || [];
<!--This generates the cart items-->
let generateItems = () => {
return (specialItems.innerHTML = shopSpecialItemsData
.map((specItem) => {
let { id, name, size, desc, price, img } = ... |
/*
avaScript'te çeşitli operatörler bulunur:
Aritmetik Operatörler: + (toplama), - (çıkarma), * (çarpma), / (bölme), % (mod alma).
Atama Operatörleri: = (atama), +=, -=, *=, /= (kısa atama).
Karşılaştırma Operatörleri: == (eşit mi), != (eşit değil mi), === (aynı tipte ve değerde mi), !==, <, >, <=, >=.
Mantıksal Opera... |
import { relations, sql } from "drizzle-orm";
import { timestamp, varchar } from "drizzle-orm/mysql-core";
import { mySqlTable } from "./_table";
import { addresses } from "./addresses";
import { orders } from "./orders";
import { products } from "./products";
export const users = mySqlTable("users", {
id: varchar(... |
begin_unit|revision:1.0.0;language:Java;cregit-version:0.0.1
begin_comment
comment|/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses ... |
[](https://github.com/AhmedBenCharrada/gojob/actions/workflows/build.yml)
[](https://codecov.io/gh/AhmedBenCharrada/gojob)
---
#... |
class Detail_Posting_Info {
final int announcement_id;
final String announcement_title;
final String created_time;
final int writer_id;
final int group_id;
final String content;
Detail_Posting_Info({
required this.announcement_id,
required this.announcement_title,
required this.created_time,... |
import React, { useState, useEffect } from "react";
import Header from "../Components/Header";
import Card from "../Components/Card";
import Pagination from "../Components/Pagination";
import { fetchGamesData } from "../Api/FetchApi";
const Home = () => {
const [games, setGames] = useState([]);
const [currentPage,... |
import PropTypes from 'prop-types'
import React from 'react'
function Button({children, version, type, isDisabled}) {
return (
<button type={type} disabled={isDisabled}
className={`btn btn-${version}`} >
{children}
</button>
)
}
Button.defaultProps = {
version: 'primary',
type: 'button',
... |
from flask import Flask, render_template, request
from PIL import Image
import PIL
import numpy as np
app = Flask(__name__)
def find_most_common_colors(image_path):
# Open the image file
image = Image.open(image_path)
def find_most_common_colors(image_path, num_colors=5):
image = Image.open(image_path)
... |
import { building } from '$app/environment';
export default class Cache {
private id: string
private cache: Record<string, [any, number]> = {}
public constructor(id: string) {
this.id = id;
if (!building && globalThis.localStorage) {
const data = localStorage.getItem(this.storageName);
this.cache = data ?... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from icecream import ic
class GraphAttentionLayer(nn.Module):
"""
Simple GAT layer, similar to https://arxiv.org/abs/1710.10903
"""
def __init__(self, in_features, out_features, dropout, alpha, concat=True):
... |
import { MdKeyboardArrowDown, MdKeyboardArrowUp } from "react-icons/md";
import NavBar from "./component/NavBar";
import { Routes , Route} from 'react-router-dom'
import CountryCard from "./component/CountryCard";
import axios from "axios";
import { IoSearch } from "react-icons/io5";
import { useEffect, useState } from... |
import { useState } from 'react';
import Timer from './components/Timer';
import Settings from './components/Settings/Settings';
import SettingsContext from './context/SettingsContext';
import './App.css';
function App() {
const [showSettings, setShowSettings] = useState(false);
const [workMinutes, setWorkMinut... |
/*
* Copyright 2015 the original author or authors.
* @https://github.com/scouter-project/scouter
*
* 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/licen... |
import { DynamicModule, Module } from '@nestjs/common';
import { DatabaseFileRepository } from '../../../data/repositories/file.repository';
import { DatabaseMusicRepository } from '../../../data/repositories/music.repository';
import { RepositoriesModule } from '../../../data/repositories/repositories.module';
import ... |
import React from 'react';
import { mount } from 'enzyme';
import { Provider } from 'react-redux';
import { Header } from '../../../../src/components/v1/DMS/DocumentView';
import renderer from 'react-test-renderer';
import store from '../../../../src/utils/store';
import {
authMock,
buildingProfileMock,
documentD... |
<!DOCTYPE HTML>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<!-- FontAwesome -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/fontawesome.min.css"
rel="stylesheet" type="text/css"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.... |
from fastapi import FastAPI, File, UploadFile
from DataIntegration import LLM
import openai
import os
# To run app, Use:
# uvicorn app:app --reload
# api_key = ""
# os.environ["OPENAI_API_KEY"] = api_key
# openai.api_key = os.environ["OPENAI_API_KEY"]
app = FastAPI()
model = LLM()
@app.get("/")
def read_root():
... |
module Printable
def print_info
puts "Information about the object:"
instance_variables.each do |var|
puts "#{var}: #{instance_variable_get(var)}"
end
end
end
class Person
include Printable
attr_accessor :name, :age, :gender
def initialize(name, age, gender)
@name = name
@age = age... |
# dotbackup

[](https://pypi.org/project/dotbackup)
[](https://pypi.org/project/dotbackup)
[">
Muda saudação
</button>
<p><a :href="site">Google</a></p>
<p v-html="link"></p>
</div>
<!-- Comentário -->
<script>
new Vue({
... |
#!/usr/bin/python3
"""This module contains operation function relating to book reserves"""
import json
from ....authentication.verify_token import oauth2_scheme
from ....authentication.verify_token import verify_token
from ....cursor.cursor import Cursor
from ....cursor.redis_cursor import redis_cursor
from ....openapi... |
const Book = require("../../../models/social/book");
const bookHandler = require("./handler");
const { validationResult } = require("express-validator");
exports.createBook = async (req, res, next) => {
try {
const errors = validationResult(req);
if (!errors.isEmpty()) {
const error = ... |
'use client';
import { createClientComponentClient } from '@supabase/auth-helpers-nextjs';
import { FormEventHandler } from 'react';
type Props = {
uid: string;
};
export default function AddProductForm({ uid }: Props) {
console.log(uid);
const supabase = createClientComponentClient();
const addProduct: FormEv... |
import { DailyDetailModel } from '../../models/DailyDetailModel';
import { ICON_URL } from '../../services/url';
import './DailyDetailStyle.css';
interface DailyDetailProps {
timeDetail: DailyDetailModel;
tempUnit: string;
date: string;
time: string;
}
const DailyDetail = ({ timeDetail, date, time, tempUnit }... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import os
from sklearn.ensemble import IsolationForest
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import classification_report, confusion_matrix, roc_auc_score, precision_recall_curve
from sklearn.mod... |
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Bluep... |
<template>
<div class="select-font">
<el-collapse accordion>
<el-collapse-item name="1">
<template slot="title">
<div class="flex center plr10 space pointer"></div>
<span>Font</span>
</template>
<div class="flex center space plr10">
<span>Font</span>
... |
/*
Evan Smith
CIS 554 - M401 Object Oriented Programming in C++
Syracuse University
General Library
2 / 9 / 21
This file implements a series of functions to facilitate safe prompting of users and parsing of their responses.
*/
#include <iostream>
#include "UserPrompter.h"
using std::cout;
using std::cin;
//prompt the... |
#include "newickcpp98.h"
#include <boost/numeric/conversion/cast.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include "fuzzy_equal_to.h"
#include "newick.h"
#include <set>
#include <boost/test/unit_test.hpp>
using namespace ribi;
BOOST_AUTO_TEST_CASE(ribi_newickcpp98_all)
{
... |
import chalk from "chalk";
import fs from "fs";
import { getWaifuNameFromFileName, calcSpread } from "../logic/logic.shaii";
import { IWaifu, IWaifuRarity, IWaifuRarityName } from "../types";
import logger from "./Logger.shaii";
function loadWaifusFromRarity(rarity: IWaifuRarityName): IWaifu[] {
const IWaifus = [];
... |
import React from 'react';
import {connect} from 'react-redux';
import constants from '../../../../constants/constants';
import {
goToExpandedDialog,
changeChatFavorite,
changeChatBlock,
changeShowAddChatToCatalogMenu
} from "../../../../actions/actionCreator";
import moment from 'moment';
import Dialog... |
<template>
<div class="app-container">
<el-form ref="duty" :model="duty" :rules="rules" label-width="80px">
<el-form-item label="日期" prop="startTime">
<el-date-picker
v-model="duty.startTime"
type="date"
placeholder="请选择日期"
style="width: 430px"
></el-d... |
import { useEffect, useState } from "react";
import { useAddress, useContract, useDisconnect } from "@thirdweb-dev/react";
import type { NextPage } from "next";
import { EDITION_ADDRESS } from "../constants/addresses";
import styles from "../styles/Home.module.css";
import { magicLink } from "@thirdweb-dev/react";
im... |
import random
import cv2
import mediapipe as mp
import HandTrackingModule as htm
import time
wCam, hCam = 640,380
cap = cv2.VideoCapture(0)
cap.set(3,wCam)
cap.set(4,hCam)
detector = htm.handDetector(detectionCon=1)
tipIds = [4,8,12,16,20]
fingerCount = 0
fingers = []
def getUserChoice(userRightHanded):
print("Us... |
package com.example.efashionwearos.retrofit
import android.os.Build
import okhttp3.Interceptor
import okhttp3.OkHttpClient
import okhttp3.Response
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import java.util.*
import java.util.concurrent.... |
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
export type Service =
| "keramisk-coating"
| "chrome-delete"
| "ppf"
| "helfoliering"
| "solfilm"
| "polering";
export interface ServiceState {
current?: Service | null | undefined;
}
const initialState: ServiceState = {
c... |
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!--
Copyright (c) 1993 - 2004 Tim Riker
This package is free software; you can redistribute it and/or modify
it under the terms of the license found in t... |
import React, {
createContext,
FC,
PropsWithChildren,
useContext,
useEffect,
useReducer,
} from 'react';
import { useAuth0 } from '@auth0/auth0-react';
import { Action } from '../@types';
interface UserState {
userId?: string;
displayName?: string;
email?: string;
}
const initialState = {};
interf... |
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Contact Form</title>
<link rel="stylesheet" type="text/css" href="styles.css">
<style>
.capitalize:first-letter {
text-transform: capitalize;
font-family: times;
color: #6A5ACD;
font-size: 30px;
}
.navbar {
overflow: hi... |
import request from 'supertest';
import nock from 'nock';
import { defaultOptions, nockMode, authToken } from 'test/nockHelper';
import { getServer } from 'test/testServer';
describe('v2Action', () => {
const defaultUrl = '/v2/essentials/action';
let app: request.SuperTest<request.Test>;
const investorId = 'bec3... |
package com.java.learnspringframework.jakartaEE;
import java.util.Arrays;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import jakarta.inject.Inject;
import jak... |
import React, { useState } from "react";
import { useSelector } from "react-redux";
import { NavLink, useNavigate, useParams } from "react-router-dom";
import { cartList } from "../../Redux/Reducer/cartSlice";
import { productList } from "../../Redux/Reducer/productSlice";
import AllProduct from "../Body/AllProduct";
i... |
import React, { useReducer, useCallback } from 'react';
import { Snackbar, Slide, useTheme } from '@material-ui/core';
import { Alert } from '@material-ui/lab';
import SnackMessageContext from '../contexts/SnackMessage';
const DEFAULT_STATE = {
isOpen: false,
severity: 'info',
content: '',
};
function r... |
use anyhow::Result;
use chrono::{DateTime, Utc};
use dyn_clone::{clone_trait_object, DynClone};
use std::{self, collections::HashMap, net::SocketAddr};
use uuid::Uuid;
use crate::model::Hit;
use super::{
location_detect::Country,
user_agent_detect::{Device, UserAgent, OS},
InitOnce,
};
#[derive(Clone, De... |
interface WeatherDisplayProps {
cityName: string;
temperature: number;
icon: string;
mainWheater: string;
}
function WeatherDisplay(Props: WeatherDisplayProps) {
return (
<div
className="w-[800px] mt-10 rounded-[30px] flex flex-col items-center gap-2 py-16 bg-[url('../Assets/wheater-images/Cloudy-n2.jpg')] b... |
import 'package:floor/floor.dart';
import 'package:proodonto/app/shared/enum_types.dart';
@Entity(tableName: "anamnesis")
class Anamnesis {
@PrimaryKey(autoGenerate: true)
int? id;
int? recordNumber;
String? patientCPF;
String? complain;
String? diseaseHistory;
String? diseases;
String? currentTreatmen... |
#include <stdlib.h>
#include "dog.h"
/**
* init_dog - a function to initialize a variable of type struct dog
* @d: a variable of type struct dog
* @name: name
* @age: age
* @owner: owner argument
*
* Description: initialize struct dog with the provided values
*/
void init_dog(struct dog *d, char *name, float ... |
import app from 'flarum/admin/app';
import Page from 'flarum/common/components/Page';
import Button from 'flarum/common/components/Button';
export default class ClientsPage extends Page {
translationPrefix = 'foskym-oauth-center.admin.clients.';
clients = [];
oninit(vnode) {
super.oninit(vnode);
this.fie... |
class Solution {
public:
int minCostClimbingStairs(vector<int>& cost) {
vector<int> dp = vector<int>(cost.size()+1);//+1 becuase we need a base case cost where we are at the top
//this dp table corresponds to the reverse cost, i.e. the dp[0] is the cost where we are at the top
dp[0] = 0;//b... |
import { useState } from "react";
import { StyleSheet, Text, View, Button, TextInput } from "react-native";
export default function App() {
const [enteredGoalText, setEnderedGoalText] = useState("");
const [courseGoals, setCourseGoals] = useState([]);
//this function will fetch the user input
function go... |
const { Product } = require('../../models');
const { limitOffsetPageNumber } = require('../../utils/pagination');
const ViewProduct = async ({ id, status, createdby, name, category, sort, select, page, size }) => {
try {
const queryObject = {};
// ======= Filters Queries =======
if (id) {... |
import { createPortal } from 'react-dom'
import { Icon } from '@iconify/react'
import { zodResolver } from '@hookform/resolvers/zod'
import { FormProvider, useForm } from 'react-hook-form'
import { z } from 'zod'
import { Input } from '../../components/Form/Input'
import { ErrorMessage } from '../../components/Form/Err... |
import * as fs from 'fs'
import {asPair} from '../utils'
import {ChangerDescriptor, VersionChanger} from '.'
export class RegexPattern implements VersionChanger {
private readonly match: RegExp
private readonly path: string
static createFromDesc({info: pattern, path}: ChangerDescriptor): RegexPattern {
if (... |
FactoryBot.define do
factory :user do
nickname { Faker::JapaneseMedia::DragonBall.character }
email { Faker::Internet.free_email }
password { '1a' + Faker::Internet.password(min_length: 6, mix_case: true) }
password_confirmation { password }
family_name ... |
Table of Contents:
[1.0] - Developer's section
[1.1] - Notes
[1.2] - File types
[1.3] - Lattice structures
[1.4] - Boundaries
[2.0] - Documentation
[2.1] - def buildNumpy
[2.2] - class Lammps
[2.2.1] - def buildLammps
[2.3] - class Xyz
[2.3.1] - def buildXyz
[2.4] - class Block
[2.4.1] - def numUcell
[2... |
/// Add color for default, focus, hover, and active states.
///
/// @group 03-links
///
/// @param {Color} $color - The default color.
/// @param {Color} $color-hover - The hover color.
/// @param {Color} $color-active [$color-hover] - The active color.
/// @param {Color} $color-vi... |
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
class Solution {
public int[] topKFrequent(int[] nums, int k) {
// Create frequency map of elements
HashMap<Integer, Integer> hm = new HashMap<>();
for (int i = 0; i < nums.length; i++) {
hm.put(nums[... |
type ListApiStatus = "ok" | "fail";
interface IListResult {
listData?: any[];
total?: number;
isLast?: boolean;
// status: ListApiStatus;
}
interface IListOperationResult {
// status: ListApiStatus;
data?: any;
}
interface IGetListParams {
pageSize: number;
pageNum: number;
type: GetListType;
[key: ... |
<template>
<v-form ref="form" v-model="userValid" class="text-center">
<v-text-field v-model="user.facebookId" :counter="0" :rules="userRules.facebookId" :label="userLabel.facebookId"></v-text-field>
<v-text-field v-model="user.googleId" :counter="0" :rules="userRules.googleId" :label="userLabel.googleId"></... |
using Application.Contracts;
using Application.DTO.PostDTO.DTO;
using Application.Exceptions;
using Application.Features.PostFeature.Requests.Queries;
using Application.Response;
using AutoMapper;
using MediatR;
namespace Application.Features.PostFeature.Handlers.Queries;
public class GetPostsByTagHandler : IRequestH... |
/* ----------------------------------------------------------------------- *
*
* Copyright 2000-2008 H. Peter Anvin - All Rights Reserved
* Copyright 2009 Intel Corporation; author: H. Peter Anvin
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Gene... |
const multer = require("multer");
const sharp = require("sharp");
const cloudinary = require("cloudinary").v2;
const AppError = require("../utils/appError");
const catchAsync = require("../utils/catchAsync");
//* Multer Configuration *******************************************
const multerStorage = multer.memoryStor... |
<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'Laravel') }}</tit... |
import { DataTypes } from 'sequelize';
export default function (sequelize) {
const regularSchedule = sequelize.define(
'regularSchedule',
{
id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
primaryKey: true,
},
day: {
type: DataTypes.TEXT,
a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.