text
stringlengths
184
4.48M
const mongoose = require('mongoose'); const uniqueValidator = require('mongoose-unique-validator'); // esquemas de mogoose let Schema = mongoose.Schema; let rolesValidos = { values: ['ADMIN_ROLE', 'USER_ROLE', 'INVITED_ROLE'], message: '{VALUE} no es un rol valido' }; let personSchema = new Schema({ passwo...
import React, { useMemo } from 'react' import { useStaticQuery, graphql } from 'gatsby' import { Sheet } from '@mui/joy' import { Container } from './container' import { useScrolling } from '../hooks' import { Link } from './link' import { Menu } from './menu' const Header = ({ siteTitle, menuOptions }) => { const d...
package plugin import ( "net/rpc" "github.com/hashicorp/go-plugin" ) // Greeter is the interface that we're exposing as a plugin. type Greeter interface { Greet() string } type GreeterPlugin struct{ PluginFunc Greeter } func (p *GreeterPlugin) Server(*plugin.MuxBroker) (interface{}, error) { return &GreeterRP...
import { IPostRepository } from '@/domain'; import { isDevelopment } from '@/extension'; import { PostRepository, PostResponse } from '@/infrastructure'; export class FetchPostSlugsUseCase { private readonly postRepository: IPostRepository; constructor() { this.postRepository = new PostRepository(); } pr...
# Operational Challenges for SCIM Servers ## Table of Contents - [What is SCIM?](#what-is-scim) - [The Key Operational Challenges](#the-key-operational-challenges) * [No Load Limits](#no-load-limits) * [All Requests Must be Synchronously Handled](#all-requests-must-be-synchronously-handled) - [Downstream Conseq...
import React, { useState } from 'react'; import Link from '../Link/Link'; import { MenuIcon, XIcon } from '@heroicons/react/solid' const Navbar = () => { const [open, setOpen] = useState(false) const routs = [ { id: 1, name: 'home', link: '/ home' }, { id: 2, name: 'shop', link: '/shop' }, ...
import "stream-chat-react/dist/css/index.css"; import React, { useEffect, useState } from "react"; import { StreamChat } from "stream-chat"; import { Chat, Channel, ChannelList, MessageInput, MessageList, Window } from "stream-chat-react"; import MessagingChannelPreview from "./MessagingChannelPreview"; imp...
import { IsString, Matches } from 'class-validator'; export class PasswordDto { @IsString() @Matches( /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/, { message: 'Password need to be have minimum 8 characters, at least one uppercase letter, one lowercase letter, one num...
import "utils/env"; import { accountRouter } from "account/router"; import { authRouter } from "auth/router"; import cookieParser from "cookie-parser"; import cors from "cors"; import { courseRouter } from "course/router"; import { examRouter } from "exam/router"; import express, { Express } from "express"; import { r...
import React, {Component} from 'react'; import {Link} from 'react-router-dom'; import PropTypes from 'prop-types'; import {connect} from 'react-redux'; import {addUser} from '../../Actions/UserActions'; import classnames from 'classnames'; class Register extends Component { constructor() { super(); ...
## Approach To traverse through a path we can do a rabbit/turtle pointers. Essentially a pointer that travels twice as fast a slower pointer. Since the fast pointer is twice faster, by the time the pointer reaches the end the slower pointer should be halfway across the path so return the slower pointer. ## Code ``...
""" Template file for simple.py module. """ import sys import curses from store import * class Strategy: """Implementation of the simple strategy.""" _time: int _log: Logger _store: Store def __init__(self, width: int, log_path: str): self._log = Logger(log_path, "SimpleStrategy", w...
--- title: Creating a tiering policy excerpt: How to create a tiering policy product: [ cloud ] keywords: [ tiered storage, tiering ] tags: [ storage, data management ] --- # Creating a tiering policy To automate the archival of data not actively accessed, create a tiering policy that automatically moves data to the ...
/** * @file Debug.h * @author rohit S * @brief header File for Debug Class implementation, Singleton design implementation * @version 0.1 * @date 2023-12-11 * * @copyright Copyright (c) 2023 Volansys Technologies * */ #ifndef DEBUG_H_ #define DEBUG_H_ #include "Movie.h" #include "Movies.h" /** * @brief Deb...
import { acceptHMRUpdate, defineStore } from 'pinia'; import ls from '@/utils/local-storage'; import { STORAGE_TOKEN_KEY } from './app'; import type { LoginParams, Role, UserInfo } from '@/api/user/login'; import { postLogout, getCurrentUser, postAccountLogin } from '@/api/user/login'; import type { RouteRecordRaw } fr...
import 'dart:async'; import 'dart:io'; import 'package:firebase_analytics/firebase_analytics.dart'; import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:lane_dane/app_controller.d...
import * as fs from 'fs'; import * as path from 'path'; import OSS from 'ali-oss'; import ExifReader from 'exifreader'; import * as dotenv from 'dotenv'; import { v4 as uuidv4 } from 'uuid'; dotenv.config(); // 阿里云 OSS 相关配置 const ossClient = new OSS({ accessKeyId: process.env.OSS_ACCESS_KEY_ID || '', accessKeySec...
import { useState, useRef } from "react"; import { Link } from "react-router-dom"; import emailjs from "@emailjs/browser"; import toast from "react-hot-toast"; // import config from "../../config"; const Contact = () => { const [formData, setFormData] = useState({ name: "", lastName: "", email: "", ...
// Copyright 2023 PingCAP, 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 agreed to i...
# Information Retrieval Projects This repository contains a collection of projects related to Information Retrieval (IR), implemented using Python. Each project focuses on different aspects of IR, ranging from building basic search systems to incorporating advanced techniques like spelling correction, document ranking...
package top import ( "context" "fmt" "strconv" "strings" "github.com/nicklaw5/helix/v2" "github.com/samber/lo" "github.com/satont/twir/apps/parser/internal/types" model "github.com/satont/twir/libs/gomodels" "github.com/satont/twir/libs/twitch" ) var EmotesUsers = &types.Variable{ Name: "top.emotes....
import { fork } from "node:child_process"; import { realpathSync } from "node:fs"; import { writeFile } from "node:fs/promises"; import path from "node:path"; import { useState, useEffect, useRef } from "react"; import onExit from "signal-exit"; import { registerWorker } from "../dev-registry"; import useInspector from...
package ru.aurorahost.stayraterapp.di import androidx.paging.ExperimentalPagingApi import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory import dagger.Module import dagger.Provides import dagger.hilt.InstallIn import dagger.hilt.components.SingletonComponent import kotlinx.serialization.E...
show tables; create table board2 ( idx int not null auto_increment, /* 게시글의 고유번호 */ nickName varchar(20) not null, /* 게시글을 올린사람의 닉네임 */ title varchar(100) not null, /* 게시글의 글 제목 */ email varchar(100), /* 글쓴이의 메일주소 */ homePage varchar(100), /* 글쓴이의 홈페이지(블로그) 주소 */ content text not null, /...
import React from "react"; import { Flex, Image, Box, Heading, Text } from "@chakra-ui/react"; function Footer() { return ( <Flex as={"footer"} flexDirection={{ base: "column", lg: "row" }} justifyContent={"space-evenly"} background={ "linear-gradient(90.07deg, rgba(30, 42, 93, 0....
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Form\Extension\Core\Type; use Symfony\Component\Form\...
<!doctype html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <!-- Bootstrap CSS --> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min...
<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Checkout.aspx.cs" Inherits="Reedham_Bookstore.WebForm5" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="master2" runat="server"> ...
package com.example.SpringSecurityJWT.service; import com.example.SpringSecurityJWT.dto.RequestDTO; import com.example.SpringSecurityJWT.model.Person; import com.example.SpringSecurityJWT.repository.UserRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.auth...
// // PlacesViewController.swift // FoursquareClone // // Created by Marcus Vinicius Galdino Medeiros on 04/01/20. // Copyright © 2020 Marcus Vinicius Galdino Medeiros. All rights reserved. // import UIKit import Parse class PlacesViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { ...
import React, { useState, useEffect } from "react"; import { ethers } from "ethers"; import { useStateContext } from "../context"; import { money } from "../assets"; import { CustomButton, FormField, Loader } from "../components"; import { checkIfImage } from "../utils"; import { useLocation, useNavigate } from "react...
"use client"; import Buttons from "@/Components/Buttons"; import Formule from "@/Components/Formule"; import ArrowLeftIcon from "@/Components/Icons/ArrowLeftIcon"; import ArrowRightIcon from "@/Components/Icons/ArrowRightIcon"; import PlusMinusIcon from "@/Components/Icons/PlusMinusIcon"; import EqualsIcon from "@/Com...
import type { NextApiRequest, NextApiResponse } from "next"; import loadStytch from "@/lib/loadStytch"; import { SESSION_DURATION_MINUTES, setIntermediateSession, setSession, } from "@/lib/sessionService"; const stytchClient = loadStytch(); export async function handler(req: NextApiRequest, res: NextApiResponse...
#include <sys/time.h> #include <sys/stat.h> #include <sys/types.h> #include <dirent.h> #include <signal.h> #include <filesystem> #include "util.h" #include "log.h" #include "fiber.h" namespace DW{ Logger::ptr g_logger = DW_LOG_NAME("system"); uint32_t GetThreadId(){ return (pid_t)syscall(__NR_gettid)...
import { ObjectId } from 'mongodb'; import { getCollection } from '../common'; import type * as Types from './config.types'; export const find = async <C extends object>(id: string) => { const collection = await getCollection<Types.ConfigData<C, ObjectId>>({ db: 'data-forge', collection: 'config', }); ...
import { useState, useEffect } from "react"; import { Route, Routes, Navigate } from "react-router-dom"; import ChatroomPage from "./pages/ChatroomPage"; import DashboardPage from "./pages/DashboardPage"; import IndexPage from "./pages/IndexPage"; import LoginPage from "./pages/LoginPage"; import RegisterPage from "./p...
/* * Copyright 2008-2009 Xebia and 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless req...
--- title: '[全般] ([データソースのプロパティ] ダイアログボックス) (レポートビルダー) |Microsoft Docs' ms.custom: '' ms.date: 06/13/2017 ms.prod: sql-server-2014 ms.reviewer: '' ms.technology: reporting-services-native ms.topic: conceptual f1_keywords: - "10018" ms.assetid: b956f43a-8426-4679-acc1-00f405d5ff5b author: maggiesMSFT ms.author: maggies ...
-- inserción de datos: -- ¿cómo se agregaría un nuevo documento a la base de datos, asegurando que se vincule correctamente con la colección correspondiente? insert into collection (id_collection, id_room, name_collection, description_collection) values ('', '', 'colección de historia de cuba', 'libros y documentos sob...
import { createRouter, createWebHistory } from "vue-router"; const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), routes: [ { path: "/", name: "home", component: () => import("@/views/HomeView.vue"), }, { path: "/courses", name: "courses", ...
# Python - Everything is Object This project delves into Python's object model, exploring the intricacies of objects, references, and mutability. It aims to deepen the understanding of how Python handles different types of objects and the implications of these mechanisms on Python programming. ## Background Context ...
import { produce } from "immer"; import { createAction, handleActions } from "redux-actions"; import { todoArray, todoObject } from "types"; const ADD_TODO = "todos/ADD_TODO" as const; const REMOVE_TODO = "todos/REMOVE_TODO" as const; const TOGGLE_TODO = "todos/TOGGLE_TODO" as const; export const addTodo = createActi...
/*************************************************************************** * NelderimGuard.cs * ------------------- * Nelderim rel. Piencu 1.0 * http:\\nelderim.org * ***********************************************************************...
// async call reference: https://stackoverflow.com/questions/49982058/how-to-call-an-async-function import React from "react"; import { generate_entries_of_item_supplier_table, generate_entries_of_item_table_from_images, generate_entries_of_order_table, generate_entries_of_supplier_table, } from "./test_image_p...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Personal Portfolio Website</title> <link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5....
module abstract-topology { yang-version 1; namespace "urn:model:abstract:topology"; prefix "tp"; import ietf-interfaces { prefix "if"; revision-date 2012-11-15; } organization "OPEN DAYLIGHT"; contact "http://www.opendaylight.org/"; description "This module con...
import { useEffect, useState } from "react"; import { useDispatch, useSelector } from "react-redux"; import { onlyActive, onlyComplete, showAll, deleteTodo, } from "../features/todos/todosSlice"; const Menu = ({ todoLength }) => { const dispatch = useDispatch(); const { isLoading, isUpdate, isError, messag...
export const availableFilterTypes = [ 'childAttr', 'childArrayAttr', 'existence', 'string', 'array', 'minDate', 'maxDate', 'dateRange', 'dateTimeRange', 'minNum', 'minNumber', 'maxNumber', 'maxNum', 'strict', 'laxTrue', 'laxFalse', 'emptiness', 'la...
package main import ( "context" "errors" "fmt" "net/http" "os" "os/signal" "syscall" "CnC/service/api" "CnC/service/database" "github.com/ardanlabs/conf" "github.com/sirupsen/logrus" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" ) func main() { if err := run(); err !=...
<?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\Models\City; use App\Models\Doctor; use App\Models\Speciality; use App\Providers\RouteServiceProvider; use App\User; use Illuminate\Foundation\Auth\RegistersUsers; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facade...
<!DOCTYPE html> <html lang="ko" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout/base}"> <head> <meta charset="UTF-8"> <title>ItemView</title> <link rel="stylesheet" href="/css/review.css"> <style> .item-review-mor...
# File src/library/base/R/namespace.R # Part of the R package, http://www.R-project.org # # 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 License, or # (at your opt...
// // ArtistInfoVIew.swift // Spotify Challenge // // Created by Daniel Azuaje on 9/12/22. // import UIKit class ArtistInfoView: UIView { lazy var artistNameLabel: UILabel = { let label = UILabel() label.font = .appBold(size: 24) label.textColor = .white label.numberOfLines = 1 ...
/** * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 */ package com.liferay.journal.web.internal.display.context; import com.liferay.dynamic.data.mapping.configuration.DDMWebConfiguration; import com.lifer...
#include "interpreter_debugPrinter.h" // The border to display on the top screen. const char topScreenBorderText[] = { "--------------------------------" "| |" "| |" "| |" "| |" "| ...
import java.awt.*; public class Board { // grid line width public static final int GRID_WIDTH = 8; // grid line half width public static final int GRID_WIDTH_HALF = GRID_WIDTH / 2; //2D array of ROWS-by-COLS Cell instances public Cell [][] cells; /** Constructor to create the game board */ public Board() {...
package com.groupfour.foodbox.service.user; import com.groupfour.foodbox.domain.UserDTO; import com.groupfour.foodbox.mapper.user.UserLoginMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.security.crypto.password....
import axios from "axios"; import { useState } from "react"; import { Link } from "react-router-dom"; import { useDispatch } from "react-redux"; import { useNavigate } from "react-router-dom"; import Navbar from "../../components/navbar/Navbar"; import Topbar from "../../components/topbar/Topbar"; import Footer ...
/* --- Directions Create a stack data structure. The stack should be a class with methods 'push', 'pop', and 'peek'. Adding an element to the stack should store it until it is removed. --- Examples const s = new Stack(); s.push(1); s.push(2); s.pop(); // returns 2 s.pop(); // r...
class QueueWithStacks { constructor() { this.in = []; this.out = []; } enqueue(val) { this.in.push(val); } dequeue() { if (this.out.length === 0) { while(this.in.length > 0) { this.out.push(this.in.pop()); } } ...
package streamapi.Collectors; import streamapi.Phone2; import java.util.Comparator; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; import java.util.stream.Stream; public class MaxByMinBy { public static void main(String[] args) { Stream<Phone2> phoneStream = Stream.o...
(function() { var FILTER = _CMProxy.parameter.FILTER; var SOURCE_CLASS_NAME = _CMProxy.parameter.SOURCE_CLASS_NAME; Ext.define("CMDBuild.delegate.administration.common.dataview.CMFilterDataViewFormFieldsManager", { extend: "CMDBuild.delegate.administration.common.basepanel.CMBaseFormFiledsManager", mixins: { ...
import React from 'react' import { Routes, Route } from 'react-router-dom' import { Home } from './components/Home' // import { About } from './components/About' import { Navbar } from './components/Navbar' import { NoMatch } from './components/NoMatch' import { Users } from './components/Users' import { UserDetails }...
import type {ReactNode} from 'react'; import {useEffect, useState} from "react"; import {Roboto} from "next/font/google"; import Header from "@/layout/Header/Header"; import Footer from "@/layout/Footer/Footer"; import styles from './Main.module.scss' import Image from "next/image"; import {icons} from "../../public/...
/************************************************************************************* * Copyright (C) 2013-2015, Cypress Semiconductor Corporation. All rights reserved. * * This software, including source code, documentation and r...
package com.nnacres.assessment.service.impl; import com.SphereEngine.Api.Exception.ClientException; import com.SphereEngine.Api.Exception.ConnectionException; import com.nnacres.assessment.dto.CodeResponseDTO; import com.nnacres.assessment.dto.QuestionResponseDTO; import com.nnacres.assessment.entity.Option; import co...
package parser_test import ( "fmt" "testing" "github.com/henningrck/monkey-interpreter/ast" "github.com/henningrck/monkey-interpreter/lexer" "github.com/henningrck/monkey-interpreter/parser" "github.com/stretchr/testify/assert" ) func TestLetStatements(t *testing.T) { tests := []struct { input ...
package cc.ddrpa.playground.vikare; import cc.ddrpa.playground.vikare.event.UserTaskCompletedEventListener; import org.flowable.engine.RuntimeService; import org.flowable.engine.TaskService; import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.fac...
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* arg_rang.c :+: :+: :+: ...
import * as XLSX from "xlsx"; import excel from "../../../../assets/excel.svg"; import { useRecoilValue, useRecoilState } from "recoil"; import { excelState1, excelState2, excelState3, excelStateI1, excelStateI2, excelStateI3, excelDisabled, } from "../../../../states/Excel"; import { useParams } from "re...
/** * Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. * * Example 1: * * Input: 121 * Output: true * Example 2: * * Input: -121 * Output: false * Explanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore...
=head1 NAME Badger::FAQ - Frequently asked questions about Badger =head1 SYNOPSIS $you->ask; $we->answer =head1 GENERAL QUESTIONS =head2 What is Badger? It's a collection of Perl modules designed to take away some of the tedium involved in writing Perl modules, libraries and applications. Badger starte...
/** * Copyright (c) 2015 Bosch Software Innovations GmbH and others * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 * which is available at https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 */ package org.eclipse.ha...
import React, {useEffect, useState} from 'react'; import {Link} from 'react-router-dom'; import {styles} from '../styles'; import {navLinks} from '../constants'; import {logo, menu, close} from '../assets'; const Navbar = () => { const [active, setActive] = useState(''); const [toggle, setToggle] = useState(false)...
<template> <v-app> <v-main> <ContentBlock :users="users" :filters="filters" @changeFilters="changeFilters"/> </v-main> <v-footer app v-bind="localAttrs"> <Footer/> </v-footer> </v-app> </template> <script> import { mapGetters } from "vuex"; import ContentBlock from './components/Conte...
import BaseService from "../../common/BaseService"; import CountryModel from "./CountryModel.model"; import { AddCountry } from "./dto/AddCountry.dto"; import { EditCountry } from "./dto/EditCountry.dto"; import * as mysql2 from "mysql2/promise"; export interface CountryAdapterOptions {} export default class CountryS...
import React, { useState, useContext } from "react"; import { UserContext } from "../../store"; // Networking and event handling import { Socket } from "socket.io-client"; import { DefaultEventsMap } from "socket.io/dist/typed-events"; import { Events } from "../../eventHandlers/Events"; // Routing import { useNaviga...
// // GameScene.swift // PacMan // // Created by Andrii Moisol on 05.09.2021. // import SpriteKit import GameplayKit class GameScene: SKScene { private var pacman: PacMan! private var gameField: SKShapeNode! private var scoreLabel: SKLabelNode! private var score: Int private var ghosts: [...
--- title: "A closer look: Setting private members in the editor" author: manio popular: false image: /images/blog/2023-09-21-closer-look-private-members/script-with-secrets.png tags: ['.NET', 'Education'] --- Let's take a closer look at why currently you can't set private members of scripts and components in the Stri...
export interface Billboard { id: string; label: string; imageUrl: string; }; export interface Category { id: string; name: string; billboard: Billboard; }; export interface Product { id: string; category: Category; name: string; price: string; isFeatured: boolean; size: Size; color: Color; ...
// An FPS counter in the console using tasks #include "../example_base.hpp" // For the task functionality: #include <coresystem/task.hpp> // For from::unique_ptr with delay deletion: #include <memory/from_unique_ptr.hpp> // For wait_for_system: #include <dantelion2/system.hpp> // Our new task must derive from CS::CS...
/********************************************************************** * Copyright (C) 2024 Red Hat, 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/lic...
import ReactTimeAgo from "react-time-ago"; import Avatar from "./Avatar"; import Link from "next/link"; import PostButtons from "./PostButtons"; export default function PostContent({ text, author, createdAt, _id, likesCount,likedByMe, commentsCount, big = false }) { //console.log('this is the author:...
public void testSelectProjectWithPaging() throws Exception { // Test inserting and retrieving a couple pages worth of data int pages = 3; int pageSize = 10; int insertCount = (pages * pageSize); // Unique project characteristics for testing against String projectTitle = "ProjectListAPITest Test ...
// Primitive Data Types // -Strings const name = 'Akhil Jayan'; console.log(typeof name); // -Numbers [includes everything int float ] const age = 20; console.log(typeof age); // -Boolean const hasKids = true; console.log(typeof hasKids); // -null const car = null; console.log(typeof car); // this will give us o...
import { useQuery } from '@tanstack/react-query' import axios from 'axios' import React, { useContext } from 'react' import { ListGroup } from 'react-bootstrap' import { Helmet } from 'react-helmet-async' import { userContext } from '../App' import JobOffer from '../components/JobOffer' import Loader from '../component...
// // NSArray+CWAdditions.m // SC68 Player // // Created by Fredrik Olsson on 2008-11-13. // Copyright 2008 __MyCompanyName__. All rights reserved. // #import "NSArray+CWAutoboxing.h" @implementation NSArray (CWAutoboxing) -(char)charValueAtIndex:(NSUInteger)index; { NSNumber* number = [self objectAtIndex:inde...
#ifdef GL_ES precision mediump float; #endif uniform vec2 u_resolution; uniform vec2 u_mouse; uniform float u_time; /* uv: uv map fun: function output 1 to represent there this is in the range of the function, else output 0 */ float plot_func(vec2 uv, float func) { // blur amount is relative to the resolution ...
#!/usr/bin/python3 """Module containing ``Square`` class inheriting from ``Rectangle`` class """ base_g = __import__('9-rectangle') class Square(base_g.Rectangle): """Class definition""" def __init__(self, size): """Initialize the square attributes""" super().integer_validator("size", size) ...
/* https://leetcode.com/problems/actors-and-directors-who-cooperated-at-least-three-times/ Write a SQL query for a report that provides the pairs (actor_id, director_id) where the actor have cooperated with the director at least 3 times. Example: ActorDirector table: +-------------+-------------+-------------+ | acto...
package com.dogeby.reliccalculator.core.network.retrofit import com.dogeby.reliccalculator.core.model.mihomo.Profile import com.dogeby.reliccalculator.core.network.BuildConfig import com.dogeby.reliccalculator.core.network.ProfileNetworkDataSource import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConv...
import React, { useState } from "react"; import { Line } from "react-chartjs-2"; // import { de } from "date-fns/locale"; // import { format, parseISO } from "date-fns"; import "chartjs-adapter-date-fns"; import Datepicker, { type DateValueType } from "react-tailwindcss-datepicker"; import { Chart as ChartJS, Lin...
from django.contrib.auth.forms import UserCreationForm from .constants import ACCOUNT_TYPE,GENDER_TYPE from django import forms from django.contrib.auth.models import User from .models import UserAddress,UserBankAccount class UserRegistrationForm(UserCreationForm): birth_date=forms.DateField(widget=forms.DateInput...
import {useStore} from "vuex"; import {useRoute, useRouter} from "vue-router"; import {computed} from "vue"; import {getSearchParamsFromStore} from "../api/helpers"; import {SET_LAYOUT, SET_PAGINATE_PARAMS, SET_SORTING_PARAMS} from "../store/types"; export const useSubmitSearch = () => { const store = useStore()...
# flake8: noqa # yapf: disable import argparse import datetime import json import math import os import os.path as osp import re from collections import defaultdict from datetime import datetime from glob import glob from itertools import product import mmengine import numpy as np #import plotly.express as px import p...
import mongoose ,{Schema} from "mongoose"; import bcrypt from "bcrypt"; const userSchema = new Schema( { username :{ type : String, required : true, unique : true, lowercase : true, index : true, trim : true }, email :{ type : String, required : true, ...
<?xml version="1.0" encoding="utf-8"?> <layout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"> <data> <variable name="SignupViewModel" type="com.kshitizbali.pres...
<%-- Document : editLesson Created on : May 31, 2023, 5:07:15 PM Author : Yui --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <!DOCTYPE html> <c:set var="courseId" value="${empty param.courseId ? -1 : param.courseId}"></c:se...
import pickle import os import nltk from nltk.corpus import stopwords from nltk.stem.lancaster import LancasterStemmer from nltk import everygrams from string import punctuation as punctuation_list from nltk.tokenize import word_tokenize class PredictionService: def __init__(self): self.load_model() ...
package com.test.singleton; /** * lazy loading * 懒汉式 * 虽然达到了按需初始化的目的,但却带来了线程不安全的问题 * 多个线程访问getInstance(),会导致创建的实例不是同一个 */ public class SingleTest02 { private static SingleTest02 INSTANCE; private SingleTest02(){} public static SingleTest02 getInstance(){ if(INSTANCE == null){ try...