text stringlengths 184 4.48M |
|---|
"use client";
import { BsDot } from "react-icons/bs";
import dayjs from "dayjs";
import relativeTime from "dayjs/plugin/relativeTime";
import LikeButton from "./like-button";
import ReplyDialog from "./reply-dialog";
import { useRouter } from "next/navigation";
import { TweetProps } from "types/types";
dayjs.extend(re... |
import { type ProviderResource, type ResourceOptions } from "@pulumi/pulumi";
import * as kubernetes from "@pulumi/kubernetes";
import {
type BlockConfiguration,
type BlockConfig,
type ProvidedResource,
type StackContext,
} from "~/types";
import logo from "./logo.svg";
import { deletedWith, provider } from "... |
const { response } = require("express");
const Employee = require("../models/Employee");
const { error } = require("console");
//shows the list of employee
const index = (req, res, next) => {
if (req.query.page && req.query.limit) {
Employee.paginate({}, { page: req.query.page, limit: req.query.limit })
.t... |
---
permalink: online-help/reference-performance-all-aggregates-view.html
sidebar: sidebar
keywords:
summary: 'The Performance/Aggregates inventory page displays an overview of the performance events, data, and configuration information for each aggregate that is monitored by an instance of Unified Manager. This page ... |
/**
* Copyright (c) 2000-2005 Liferay, LLC. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use,... |
import React from 'react';
function FlowerBlock({ title, price, imageUrl, types, sizes }) {
// const [activeType, setActiveType] = React.useState(0);
const [activeSize, setActiveSize] = React.useState(0);
// const typeNames = ['тонкое', 'традиционное'];
return (
<div className="flower-block">
<img ... |
<?php
namespace APP\Core\Interfaces;
/**
* Interfaz que nos garantiza que siempre que la implementemos deberemos sí o sí implémentar el método asociado,
* garántizando el correcto funcionamiento de la aplicación para la recepción y procesado de la ruta por URI
*/
interface IRequest
{
/**
* Función que obt... |
#include "lists.h"
/**
* find_listint_loop - Finds the loop in a linked list.
* @head: A pointer to the head of the listint_t list.
*
* Return: The starts, or NULL if there is no loop.
*/
listint_t *find_listint_loop(listint_t *head)
{
listint_t *slow = head, *fast = head;
while (slow != NULL && fast != NULL ... |
import React, { useState } from "react";
import { BrowserRouter as Router, Route } from "react-router-dom";
import Landing from "./pages/Landing";
import SignIn from "./pages/SignIn";
import SignUp from "./pages/SignUp";
import Patients from "./pages/Patients";
import EHR from "./pages/EHR";
import Contacts from "./pag... |
import { getRedundantJobs } from "./lib/getRedundantJobs"
import { Logger } from "./lib/logger"
import { Scheduler } from "./scheduler"
import { Host, HostChange, Provider, Target } from "./types"
type OperationParams = {
logger: Logger
scheduler: Scheduler
providers: Provider[]
targets: Target[]
addTargetRe... |
import {NearestFilter, Texture, TextureLoader} from "three";
import {IsWebUrl, LogError} from "../common.util";
import {GetFileUrl} from "../firebase.util";
import {CommonErrorCode, Module} from "../../enums/common.enum";
import {TextureTone} from "../../types/texture.type";
import { Result } from "../../types/common.t... |
package codeforce.div2.r726;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collection;
i... |
package com.learning.thread.Synchornization;
class BookTheaterSeatNoSync {
int total_seats = 10;
void bookSeat(int seats) {
if (total_seats >= seats) {
System.out.println(Thread.currentThread().getName() + ", " + seats + " seat/s booked successfully");
total_seats = total_seats... |
//
// DataType.swift
// SWHub
//
// Created by liaoya on 2022/7/21.
//
import Foundation
import HiIOS
enum TabBarKey {
case trending
case event
case stars
case personal
}
enum DisplayMode: Int, Codable {
case none = 0
case list
var stringValue: String {
switch self {
... |
import React from 'react'
import styled from 'styled-components'
import { useCartContext } from '../context/cart_context'
import { useUserContext } from '../context/user_context'
import { formatPrice } from '../utils/helpers'
import { Link } from 'react-router-dom'
/**comfy-sloth-ecommerce app version 32 - CartTotals
... |
<ion-navbar *navbar class="tab-nav">
<ion-title>New Challenge</ion-title>
</ion-navbar>
<ion-content class="createchallenge">
<!-- Body -->
<div class="container top-padding">
<form [ngFormModel]="challengeform" (ngSubmit)="onSubmit(challengeform.value)">
<!-- GENERAL CHALLENGE INFO -->
<div cl... |
<!DOCTYPE html>
<html>
<head>
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
<link type="text/css" rel="stylesheet" href="css/materialize.min.css" media="screen,projection"/>
<link ... |
<?php
namespace App\DB\Core;
use app\Db\Core\ParentField;
use App\Exceptions\ErrorException;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Config;
use illuminate\Database\Eloquent\Model;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\Storage;
use Illuminate\Database\Eloqu... |
<#
.SYNOPSIS
.DESCRIPTION
.LINK
.NOTES
// Module : [FightingEntropy()][2023.8.0] \\
\\ Date : 2023-08-08 14:30:04 //
FileName : Get-MDTModule.ps1
Solution : [FightingEntro... |
@php
use App\Models\User;
$notifikasiCount = count(
User::with('notifikasi')
->where('id', auth()->user()->id)
->first()
->notifikasi->where('mark', 'false'),
);
// $notifikasiCount = 5
@endphp
<nav class="navbar navbar-expand-lg navbar-absolute fixed-top nav... |
import numpy as np
class OptionPricing:
def __init__(self, S0, E, T, rf, sigma, iterations):
self.S0 = S0
self.E = E
self.T = T
self.rf = rf
self.sigma = sigma
self.iterations = iterations
def call_option_simulation(self):
# 2 columns: the first column ... |
//
// CategoryViewController.swift
// RealmDB
//
// Created by deniss.lobacs on 15/04/2022.
//
import UIKit
//import RealmSwift
class CategoryViewController: UIViewController {
private var tableView = UITableView()
private var viewModel: CategoryViewModel?
override func viewDidLoad() {
... |
import React from 'react'
import ReactDOM from 'react-dom'
import { useDispatch } from 'react-redux'
import { fetchDeletedProject } from '../../store/projectsSlice'
import Transition from '../project/SideBarTransition'
function DeleteProjectModal({ show, onClose, projectId }) {
const dispatch = useDispatch()
cons... |
@extends('layout/cms_base')
@section('title', $course->name)
@section('page-title', $course->name)
@if(session('success'))
@section('alert-success-content')
{{ session('success')['message'] }}
@endsection
@endif
@if(session('error'))
@section('alert-error-content')
{{ session('error')['message'] }}
@endsection
@end... |
import { useContext } from 'react';
import { useNavigate } from 'react-router-dom';
import {ShopContext} from '../components/ShopContext';
import { Products } from '../components/Products';
import { CartItem } from '../components/CartItem';
import style from "./style.css";
// Kundvagn med alla produkter som lagts till... |
package com.github.kackan1.springboot.controller;
import com.github.kackan1.springboot.model.Task;
import com.github.kackan1.springboot.model.TaskRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.data.domain.Pag... |
package api
import (
"errors"
"net/http"
db "simplebank/db/sqlc"
"simplebank/token"
"strings"
"github.com/gin-gonic/gin"
"github.com/jackc/pgx/v5"
)
type createAccountRequest struct {
Currency string `json:"currency" binding:"required"`
}
func (server *Server) createAccount(ctx *gin.Context) {
var req crea... |
import Shimmer from "./Shimmer";
import { useParams } from "react-router-dom";
import RestaurantCategory from "./RestaurantCategory";
import { useState } from "react";
import useResMenu from "../utils/useResMenu";
import RestaurantCategory from "./RestaurantCategory";
import { useState } from "react";
const Restaurant... |
/*******************************************************************************
* Copyright (c) MOBAC developers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the L... |
/* eslint-disable react/jsx-no-useless-fragment */
import React from 'react';
import { ComponentStory, ComponentMeta } from '@storybook/react';
import { titles } from '@/constants';
import Modal from './Modal';
import ModalHeader from '@/components/Modal/components/ModalHeader';
import ModalBody from '@/components/Moda... |
import { useState } from 'react';
import Box from '@mui/material/Box';
import Avatar from '@mui/material/Avatar';
import Divider from '@mui/material/Divider';
import Popover from '@mui/material/Popover';
import { alpha } from '@mui/material/styles';
import MenuItem from '@mui/material/MenuItem';
import Typography from... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <pthread.h>
#include <asm-generic/socket.h>
#include <fcntl.h>
#define PORT 8080
#define MAX_CLIENTS 5
pthread_mutex_t book_mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t user_mutex = PTHREAD_MUTEX_INITIAL... |
/**
* @copyright
*
* Project Athena for Data Clustering Metaheuristics focused on images.
*
* Copyright (C) 2011 Alexander De Sousa (alexanderjosedesousa@gmail.com),
* Federico Ponte (fedep3@gmail.com)
*
* This program is free software; you can redistribute it and/or modify it under
* t... |
<div
id="document"
class="modal fade"
tabindex="-1"
role="dialog"
data-backdrop="static"
aria-labelledby="document"
aria-hidden="true"
>
<div class="modal-dialog modal-xl modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title font-weight-b... |
package com.climbingzone5.service;
import com.climbingzone5.service.dto.CardDTO;
import java.util.List;
import java.util.Optional;
/**
* Service Interface for managing {@link com.climbingzone5.domain.Card}.
*/
public interface CardService {
/**
* Save a card.
*
* @param cardDTO the entity to sa... |
<?php
declare(strict_types=1);
namespace Mothership;
use Exception;
use Psr\Log\InvalidArgumentException;
use Mothership\Payload\Level;
use Mothership\Handlers\FatalHandler;
use Mothership\Handlers\ErrorHandler;
use Mothership\Handlers\ExceptionHandler;
use Stringable;
use Throwable;
class Mothership
{
/**
... |
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/foundation.dart';
import 'package:price_cruncher_new/services/auth_services_new.dart';
import '../models/usermodel.dart';
class UserDataProvider with ChangeNotifier {
UserModel? _user;
UserModel? get user => _user;
// Fetch user da... |
import React from "react";
import { useState } from "react";
import "./double-btn.scss";
import Hidden from "@material-ui/core/Hidden";
import { useSelector } from "react-redux";
const DoubleBtn = (props) => {
const {
mainText,
onText,
offText,
width,
onAction,
offAct... |
import React, { memo } from "react";
import { TextInputProps, View } from "react-native";
import { useFormikContext } from "formik";
import AppTextInput from "components/AppTextInput";
import ErrorMessage from "../ErrorMessage";
import { MaterialCommunityIconsType } from "types/data";
import globalStyles from "confi... |
---
import "../../styles/style.css";
import Footer from '../../components/Footer.astro'
import { getCollection } from 'astro:content';
import { ViewTransitions } from 'astro:transitions';
export async function getStaticPaths() {
const languageEntries = await getCollection("languages");
return languageEntries.map... |
//--------------------------------------------------------------------------------------------------------------------
// Name : switch.h
// Purpose : Switch Driver Class
// Description :
// This class intended for control of generic switch.
//
// Language : C++
// Platform : Portable
//... |
import {Input} from '../common/Input'
import { FormProvider, useForm } from 'react-hook-form'
import {
email_validation,
phone_validation,
aadhar_validation,
date_validation,
reg_date_validation,
reg_name_validation,
} from '../../utils/inputValidations'
import { useState } from 'react'
import { GrMail }... |
package com.kocci.healtikuy.core.di
import android.content.Context
import androidx.room.Room
import androidx.room.migration.Migration
import androidx.sqlite.db.SupportSQLiteDatabase
import com.kocci.healtikuy.core.data.local.db.AvoidFeatureDao
import com.kocci.healtikuy.core.data.local.db.HealtikuyDao
import com.kocci... |
import { Suspense } from "react";
export default function DataComponent<T>({
source,
loading,
component: renderer,
}: {
source: Promise<T>;
loading: JSX.Element;
component: (data: T) => JSX.Element;
}) {
return (
<Suspense fallback={loading}>
<ComponentRenderer provider={suspend(source)} render... |
#!/usr/bin/env python
import numpy
class Pattern:
def __init__(self, lines):
self.height = len(lines)
self.width = len(lines[0])
self.map = numpy.zeros((self.height, self.width), dtype=numpy.uint8)
for y in range(self.height):
for x in range(self.width):
... |
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>DataViz with D3.js</title>
<script src="../../js/d3/d3.v3.js"></script>
<style>
path {
stroke: #91268E;
stroke-width: .5;
fill: none;
}
.a... |
package com.example.demo.controller;
import com.example.demo.dto.auth_user_dto.AuthUserGetDto;
import com.example.demo.exception.ForbiddenAccessException;
import com.example.demo.service.AdminService;
import com.example.demo.service.AuthUserService;
import lombok.RequiredArgsConstructor;
import org.springframework.dat... |
import * as React from "react";
import { Container } from "@material-ui/core";
import HeaderNavigation from "../components/headerNav";
import Footer from "../components/footer";
import { makeStyles } from "@material-ui/core/styles";
const useStyles = makeStyles({
body: {
minHeight: "100%",
display: "grid",
... |
import React, { useEffect, useState } from 'react'
import { useParams } from 'react-router-dom';
import Loader from '../../components/Loader/Loader';
const MealDetails = () => {
const [data, setData] = useState(null);
const [error, setError] = useState(null);
const [loading, setLoading] = useState(true);
... |
const express = require('express');
const cors = require('cors');
const { databaseConnection } = require('../config/database');
class Server {
constructor() {
this.app = express();
this.port = process.env.PORT;
this.usersPath = '/api/user';
this.authPath = '/api/auth';
this.conectarDB();
... |
import { nanoid } from 'nanoid'
import {
ComponentId,
componentPropTypes,
ComponentType,
rootComponentId,
SavedComponentConfigs,
} from 'types'
import { ComponentTemplate, componentTemplates } from './componentTemplates'
const hydrateComponent = (
componentTemplate: ComponentTemplate,
parentComponentId:... |
<?php
namespace App\Http\Controllers;
use App\Models\Order;
use App\Models\Products;
use Illuminate\Http\Request;
class CheckoutHistoryController extends Controller
{
public function index()
{
$user = session('customer');
if (!$user) {
return redirect('login')->with('success', 'Vu... |
--no create database ?
--CREATE DATABASE gran_vivero
DROP SCHEMA IF EXISTS public CASCADE;
CREATE SCHEMA public;
CREATE TYPE asoleo_planta AS ENUM ('sol', 'sombra', 'resolana');
CREATE TYPE metodo_pago AS ENUM ('efectivo', 'debito', 'credito', 'transferencia', 'otro');
CREATE TABLE Planta (
NombrePlanta varchar(256... |
Chapter 14 Hierarchical Clustering
Given :math:`n` points in a :math:`d`-dimensional space, the goal of
hierarchical clustering is to create a sequence of nested partitions, which can
be conveniently visualized via a tree or hierarchy of clusters, also called the
cluster *dendrogram*.
There are two main algorithm... |
import {PermissionsAndroid, Platform} from 'react-native'
import {CameraRoll} from '@react-native-camera-roll/camera-roll'
async function hasAndroidPermission() {
const getCheckPermissionPromise = () => {
if (Number(Platform.Version) >= 33) {
return Promise.all([
PermissionsAndroid.check(Permission... |
/*
* Copyright 2023-2023 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... |
const express = require("express");
const path = require("path");
const app = express();
const port = 8000;
const bodyparser = require("body-parser");
const mongoose = require('mongoose');
const db='mongodb+srv://mydanceacademy:1234567890@cluster0.h63yxze.mongodb.net/danceacademy?retryWrites=true&w=majority';
main()... |
import React, {useMemo} from 'react';
import AppShell from "./AppShell";
import {Routes} from "../components/route";
import {FetchService, Store, WindowSizeContext} from "../components/utils";
import {BaseState} from "./BaseState";
import {Profile} from "./profile";
import PocketBase from "pocketbase";
interface AppP... |
<template>
<Wrapper>
<div class="container-cart">
<h2>Your Cart</h2>
<!-- -->
<h3>Total Amount: ₿ {{ cartTotal }}</h3>
<ul>
<!-- a for each loop for our cart array in our index.js, which we pass into our CartCard as PROPS -->
<CartCard
v-for="product in cartProd... |
from flask_wtf import FlaskForm
from flask_login import current_user
from flask_wtf.file import FileField, FileAllowed
from wtforms import StringField, PasswordField, SubmitField, BooleanField, TextAreaField
from wtforms.validators import DataRequired, Length, Email, EqualTo, ValidationError
from flaskapp.models import... |
//
// EGCaptureController.m
// ImageProcessing
//
// Created by Chris Marcellino on 8/26/10.
// Copyright 2010 Chris Marcellino. All rights reserved.
//
#import "EGCaptureController.h"
#import <AVFoundation/AVFoundation.h>
#import <QuartzCore/QuartzCore.h>
#import "ShareKit.h"
#import "opencv2/opencv.hpp"
#import ... |
import csv
import os
import heapq
import datetime
import numpy as np
import skopt.utils
import torch
import torch.nn as nn
from torch.nn import Module
import torch.optim as optim
import torch.nn.functional as F
from torch.utils.data import DataLoader, Dataset, TensorDataset
import pickle
from skopt import gp_minimize... |
/**
* ******************
* BASIC TYPE RENAMES
* ******************
*/
/**
* This is only used for main levels, not sublevels, and is used for the following:
* - Level name offset
* - Level entrance offset
*/
export type MainLevelDataOffset = number;
/**
* This applies to both main and sublevels, and is used f... |
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../../core/constant/color.dart';
import '../../../../core/constant/linkapi.dart';
import '../../../../data/model/cartitemmodel.dart';
class ItemsCard extends StatelessWidget {
final CartItemModel itemsModel;
const ItemsCard({Key?... |
<template>
<collapse class="p-5 w-full border-b" v-model="isCollapseOpen">
<template #title>
<h3 id="v-step-2" class="font-semibold text-lg">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
class="h-5 w-5 inline -ml-1 mr-2... |
import { Component, OnInit } from '@angular/core';
import { FormGroup, FormControl, Validators, ValidationErrors } from '@angular/forms';
@Component({
selector: 'app-project',
templateUrl: './project.component.html',
styleUrls: ['./project.component.css']
})
export class ProjectComponent implements OnInit {
pr... |
// https://codeforces.com/gym/100962 - Frank Sinatra
// Tag: Mo on tree
#include<bits/stdc++.h>
typedef long long ll;
const ll mod = 1e9 + 7;
#define ld long double
using namespace std;
#ifdef DEBUG
#include "debug.cpp"
#else
#define dbg(...)
#define destructure(a) #a
#endif
template <typename T>
struct FenwickTree... |
package upgrade_test
import (
"context"
"fmt"
"regexp"
"time"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/utils/strings/slices"
"github.com/openshift-kni/eco-goinfra/pkg/clusteroperator"
"github.com/openshift-kni/eco-goinfra/... |
package com.changhong.smarthome.phone.foundation.activity;
import java.util.ArrayList;
import java.util.List;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView... |
import React from "react";
const ToDoItem = ({ text, setTodos, todos, todoItem }) => {
const deleteHandler = () => {
setTodos(todos.filter((el) => el.id !== todoItem.id));
};
const completedHandler = () => {
setTodos(
todos.map((el) => {
if (el.id === todoItem.id) {
return {
... |
// Tencent is pleased to support the open source community by making
// 蓝鲸智云 - 监控平台 (BlueKing - Monitor) available.
// Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
// Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
// You ma... |
from restapi.user.entities.interfaces.user_email_interface import UserEmailInterface
from itsdangerous import URLSafeTimedSerializer
from django.core.mail import send_mail, get_connection
from django.conf import settings
import logging
from os import getenv, path, makedirs, getenv
logger = logging.getLogger(__name__)
... |
import pandas as pd
from dataset_utils import create_graph_from_sequence, create_graph_with_embeddings
from tqdm import tqdm
import pickle
class DNADataset:
def __init__(self, file_path, k_mer=4, stride=1, data_count=None, truncate=None, task='order_name'):
# task can be 'order_name', 'genus_name', 'fam... |
(ns weeknotes-notes.system
(:require
[babashka.fs :as fs]
[integrant.core :as ig]
[org.httpkit.server :as httpkit]
[weeknotes-notes.core :as core]
[weeknotes-notes.assembly :as assembly]
[weeknotes-notes.store :as store]))
;; Our system components are:
:weeknotes-notes/store
;; a way to store EDN.... |
//
// BedtimeWindow.swift
// OuraWidgetExtension
//
// Created by Aliaksandr Drankou on 02.01.2023.
//
import Foundation
struct IdealBedtimeResponse: Codable {
let ideal_bedtimes: [IdealBedtime]
}
struct IdealBedtime: Codable {
let date: String
let bedtime_window: BedtimeWindowValue
let status: Be... |
"use server";
import * as z from "zod";
import { ResourceWorkOrderSchema } from "@/schemas/index";
import { BASE_URL } from "@/config/const";
import { ResourceWorkOdderData, ResponseData, WorkOrderData } from "@/types";
import { Axios } from "@/action/axios";
interface data {
status: boolean;
message: string;
da... |
---
title: Добавление, настройка, перемещение или удаление полей в форме | Документация Майкрософт
ms.custom: ''
ms.date: 08/26/2019
ms.reviewer: ''
ms.service: powerapps
ms.suite: ''
ms.tgt_pltfrm: ''
ms.topic: get-started-article
applies_to:
- Dynamics 365 (online)
- Dynamics 365 Version 9.x
- PowerApps
author: Anees... |
package com.jiujia.operator.service;
import java.util.List;
import com.jiujia.operator.domain.ModelRelated;
/**
* 模板关系e_model_relatedService接口
*
* @author ruoyi
* @date 2022-10-12
*/
public interface IModelRelatedService
{
/**
* 查询模板关系e_model_related
*
* @param id 模板关系e_model_related主键
... |
class sepaBASE {
constructor(name, iban, bic) {
if ( sepaBASE.validateName(name) ) {
this._initName = name;
} else {
throw 'invalid name';
}
if ( sepaBASE.validateIBAN(iban) ) {
this._initIBAN = iban;
} else {
throw 'in... |
import express from 'express'
import bcrypt from "bcryptjs"
import prisma from "../utils/prisma.js"
import { filter } from "../utils/common.js"
import { Prisma } from "@prisma/client"
import { validateUser } from "../validators/users.js"
const router = express.Router()
router.get('/', async(req, res) => {
const a... |
import React from "react";
import Product from "../Data/Productlist.json";
import { motion } from "framer-motion";
const ProductCard = ({ limit1, limit2 }) => {
return (
<div className=" grid grid-cols-4 grid-flow-row gap-5 max-lg:grid-cols-3 max-vmd:grid-cols-2 ">
{Product.slice(limit1, limit2).map((Prod... |
import { createSlice } from '@reduxjs/toolkit';
import sum from 'lodash/sum';
import uniqBy from 'lodash/uniqBy';
import Cookies from 'universal-cookie';
import { dispatch } from '../store';
import { get_product_list_service } from '../../../services/ecom_product.service';
import { setAuth } from 'services/identity.ser... |
/* eslint-disable @typescript-eslint/no-explicit-any */
import { Memoize } from 'typescript-memoize';
import type { Metadata } from '../metadata';
import { DateField } from '../metadata-fields/field-types/date';
import { StringField } from '../metadata-fields/field-types/string';
/**
* A model that describes an item ... |
import { useQuery } from "@tanstack/react-query";
import useAxiosIns from "../../hooks/useAxiosIns";
import { Classwork, IResponseData } from "../../types";
import useAuthStore from "../../stores/auth";
import { Tabs, Tab, Spinner } from "@nextui-org/react";
import DoneTab from "./DoneTab";
import AssignTab from "./Ass... |
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'calculateDate'
})
export class CalculateDatePipe implements PipeTransform {
transform(value: Date): string {
const dateParam = new Date(value);
const today = new Date();
const emptyDate = new Date('0001-01-01').setHours(0,0,0);
... |
import config
from flask import (request, render_template, session, Blueprint, jsonify, g)
from models import User
from util import *
# The authentication API controls login, logout, and accessing of the session
# state from the client.
authenticate_api = Blueprint('authenticate_api', __name__)
@authenticate_api.rou... |
# Bayesian Flow Networks
This repo is a simple replication of the discrete and discretised implementations of Bayesian flow networks (BFNs).
## CIFAR 10 Sampling
Data Expectation Distribution (Output distribution)
<img src="gifs/seed_113_data_expectation.gif" alt="CIFAR 10 data expectation over sampling" style="wid... |
import path from "path";
import { createLogger, transports, format } from "winston";
import "winston-daily-rotate-file";
const consoleLogFormat = format.combine(
format.label({ label: path.basename(require.main?.filename || "") }),
format.timestamp({ format: "MMM-DD-YYYY HH:mm:ss" }),
format.printf((i) => `${[i.... |
import express from "express";
import mongoose from "mongoose";
import router from "./router.js";
import fileUpload from "express-fileupload";
const mongo_URL =
"mongodb+srv://admin:admin@cluster0.arx43qq.mongodb.net/?retryWrites=true&w=majority";
const PORT = 3000;
const app = express();
app.use(express.json());... |
/*
* This program illustrate the java 8 features for training purpose
* Copyright (c) 2019. Ravi Bhushan (ravi-bhushan@hotmail.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Fo... |
import fs from 'fs-extra';
import path from 'path';
import config from '@/config';
const URL_TEMPLATE = `<url>
<loc>%loc%</loc>
<lastmod>%lastmod%</lastmod>
<changefreq>%changefreq%</changefreq>
<priority>%priority%</priority>
</url>
`;
const CHANGE_FREQ = {
hourly: 0.8,
daily: 0.6,
weekly: 0.4,
month... |
class Maiz {
var property posicion
var property estado = 0
const property estados = [ "corn_baby.png", "corn_adult.png" ]
var property imagen = estados.first()
const property precio = 150
method teSembraron(alguien) {
imagen = estados.first()
posicion = alguien.posicion().clone()
}
method teRegaron() {
... |
import {Component, Input, OnInit} from '@angular/core';
import {Answer, AnswerVote} from '../../../../../models/questions.models';
import {QuestionsFacade} from '../../../../../states/questions/questions.facade';
import {AuthFacade} from '../../../../../states/auth/auth.facade';
import {VotersListComponent} from '../..... |
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Venta extends Model
{
use HasFactory;
protected $table = 'ventas';
protected $fillable = [
'nro_venta',
'cliente_id',
'tipo_pago_id',
'user_id... |
## 快速上手
### 安装
#### 切换到所托内部镜像源,安装该组件
> 安装该组件库 `npm / pnpm` 都行; 推荐 pnpm
```shell
pnpm add @soterea-f2e/so-ui
```
#### 推荐使用`nrm`管理镜像源
> 安装 nrm
```shell
npm i -g nrm
```
> nrm 查看镜像源(检测 nrm 是否安装成功)
```shell
nrm ls
```
> nrm 新增一个自定义(如:soterea)的镜像源
```shell
nrm add soterea http://nexus.soterea.cn/repository/sotere... |
#include<iostream>
#include<map>
using namespace std;
class Node{
public:
int data;
Node* prev;
Node* next;
// constructor
Node(int d){
this->data = d;
this->prev = NULL;
this->next = NULL;
}
// destructor
~Node(){
int value = this->data;
//... |
import { Dialog, DialogRef } from '@angular/cdk/dialog';
import { ChangeDetectorRef, Component, Injector, Renderer2 } from '@angular/core';
import { FormBuilder, Validators } from '@angular/forms';
import { WalletService } from 'src/app/services/wallet.service';
import { MatSnackBar } from '@angular/material/snack-bar'... |
# Powershell profile for efficiency gains 💪
A PowerShell profile is a script that runs when PowerShell starts. You can use the profile as a startup script to customize your environment. You can add commands, aliases, functions, variables, modules, PowerShell drives and more. You can also add other session-specific el... |
# 生成问题简介
对于生成问题来说, 一般有两种生成策略: "各个击破" 和 "一步到位"。
"各个击破" 的含义是一个元素一个元素生成。对于文本生成来说, 就是一个 token 一个 token 生成, 每一个 token 是基于在此之前的所有 token 生成的。对于图像生成来说, 就是一个 pixel 一个 pixel 生成。这样的模型被称为 **自回归模型** (autoregressive model)。
"一步到位" 的含义是所有的元素一次性生成。对于文本生成来说, 就是一次性生成所有的 token。对于图像生成来说, 就是所有的 pixel 一起生成。这样的模型被称为 **非自回归模型** (non-autogr... |
// PlanService.cs
//
// Modified MIT License (MIT)
//
// Copyright (c) 2015 Completely Fair Games Ltd.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, includi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.