text stringlengths 184 4.48M |
|---|
using System;
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Windows.Forms;
using IniParser;
using IniParser.Model;
using Nefarius.ViGEm.Client;
using Nefarius.ViGEm.Client.Targets;
using Nefarius.ViGEm.Client.Targets.Xbox360;
using Nefarius.ViGEm.Client.Exception... |
#include "Timestamp.h"
#include <time.h>
Timestamp::Timestamp():microSecondsSinceEpoch_(0){}
// 构造函数初始化列表的语法
Timestamp::Timestamp(int64_t microSecondsSinceEpoch):microSecondsSinceEpoch_(microSecondsSinceEpoch){}
Timestamp Timestamp::now(){
time_t ti=time(NULL);
// 获取当前时间
return Timestamp(ti);
}
std::string... |
package com.madao.auth.config;
import com.madao.auth.handler.CustomTokenEnhancer;
import com.madao.auth.handler.CustomWebResponseExceptionTranslator;
import com.madao.auth.provider.CaptchaAuthenticationProvider;
import com.madao.auth.provider.GithubAuthenticationProvider;
import com.madao.auth.provider.SmsCodeAuthenti... |
{% extends "base.html" %}
{% load staticfiles %}
{% block extrastyle %}
<link href="{% static 'statistics/css/custom.css' %}" rel="stylesheet" />
<link href="{% static 'datepicker/bootstrap-datepicker.min.css' %}" rel="stylesheet" />
{% endblock %}
{% block content %}
<div class="row">
{% block main %}
... |
import './globals.css'
import {getServerSession} from "next-auth";
import SideBar from "@/components/SideBar";
import React from "react";
import Login from "@/components/Login";
import {authOptions} from "@/lib/auth";
import {NextProvider} from "@/components/SessionProvider";
import ClientProvider from "@/components/Cl... |
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\User;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Auth;
class LoginController extends Controller
{
public function login(){
return view('login/login');
}
public function register(){
... |
import { ICell } from "../types/board";
interface ITurnInfo {
from: ICell;
to: ICell;
}
class GameHelper {
private lastThreePlayerTurns: ITurnInfo[] = [];
private lastThreeAITurns: ITurnInfo[] = [];
calculatePossibleMoves = (
row: number,
col: number,
board: number[][]
): ICell[] => {
con... |
<?php
use App\Models\User;
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('payments', function (B... |
import { freeThreadCount, getServersCanRun, growThreadMaths, HomeRamReservation, remoteExec, rootServers, ThreadCounts, weakenThreadMaths } from './main-loop-support'
import { NS, Player, Server } from './bitburner'
import {getProcesses, getServers, getServersWithPath} from './utils/get-servers'
const hackThreadMaths ... |
import { HttpEventType, HttpResponse } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { ProjectService } from '../project/project.service';
import Swal from 'sweetalert2';
import { AuthService } fro... |
//ДЗ 23
const alert = document.querySelector('.alert');
//1. Знайти на сторінці кнопку з класом btn-primary. Призначте знайденому елементу подію onclick. Написати функцію обробки події onclick, що додає CSS-клас alert-primary до елемента з id = alert та змінює значення властивості textContent цього елемента на "A simp... |
import Foundation
import Utility
import Networking
class AddFolderInteractor {
// MARK: Properties
private weak var viewController: AddFolderViewController?
private let apiService = NetworkManager.shared.apiService
private let formatterService = UtilityManager.shared.formatterService
... |
import React from "react";
import FormErrors from "./FormErrors";
function QuestionForm(props) {
const { errors = [], onSubmit = () => {} } = props;
const handleSubmit = event => {
event.preventDefault();
const formData = new FormData(event.currentTarget);
onSubmit({
title: formData.get("title"... |
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:doclink/patient/common/top_bar_area.dart';
import 'package:doclink/patient/generated/l10n.dart';
import 'package:doclink/patient/model/custom/categories.dart';
import 'package:doclink/patient/screen/medical_prescription_screen/medica... |
package rocketseat.com.passin.services;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import rocketseat.com.passin.domain.attendee.Attendee;
import rocketseat.com.passin.domain.events.exceptions.EventFullException;
import rocketseat.com.passin.domain.events.exceptions.EventNotFo... |
import { IPatientRepository } from "../../../patient/repositories/IPatientRepository";
import { inject, injectable } from "tsyringe";
import { ITokensRepository } from "../../repositories/ITokensRepository";
import { IDateProvider } from "../../../../shared/infra/container/providers/DateProvider/IDateProvider";
import ... |
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:shop/components/auth_form.dart';
class AuthPage extends StatelessWidget {
const AuthPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
double height = MediaQuery.of(context).size.height;
double h... |
describe('App initialization', () => {
context('Verify that the app does appropriate routing' , () => {
it('Routes to the login screen if the token does not exist in the local storage', () => {
cy.clearAllLocalStorage();
cy.visit('/')
cy.url().should('include', '/login')
})
it('Routes... |
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { User } from './entity/user.entity';
import { UserController } from './user.controller';
import { UserService } from './user.service';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { PassportModule }... |
import { apiUrl } from '../../../../lib/api-url'
import { Yacht } from '../../../../types/yacht.type'
import YachtScoreCard from '../../yacht-score-card'
import Link from 'next/link'
import { Suspense } from 'react'
import DetailPlaceHolder from '../../../../components/detail-place-holder'
export async function genera... |
import { Path, UseFormRegister } from "react-hook-form";
import { IFormValues } from "../../../interfaces/IFormValues";
interface Props {
label: string;
register: UseFormRegister<IFormValues>;
name: Path<IFormValues>;
type: "text" | "number";
error: any;
}
export const InputText = ({ label, register, name, ... |
// state
export const state = () => ({
// series
series: [],
// posts
posts: [],
// page
page: 1,
// post
postseri: {},
// post
post: {}
})
export const getters = {
getPosts(state) {
return state.posts
}
}
// mutations
export const mutations = {
// mutation "setPostsData"
setSe... |
/*
* Test the gradients of a model.
*
* - m: Model.
* - N: Number of samples.
* - backward: Test joint distributions in backward mode? (Otherwise forward
* mode.)
*/
function test_grad(m:TestModel, N:Integer, backward:Boolean) {
let failed <- vector(0.0, N); // failure rate in each test
let Δ <- 1.0e3; ... |
# 6. Puerocentrismo, statualizzazione, privatizzazione
<!--
vim: spell:spelllang=it
-->
## 6.1. Novecento come secolo del bambino, e dello Stato-padre di famiglia (135)
Le democrazie liberali e le esperienze totalitarie mantengono la struttura dei codici ottocenteschi.
I cambiamenti principali sono:
* La **maggiore... |
% function R = Xmatrixr3(wx,wy,wz)
%
% Toolbox Xvis: 3D rotation matrix.
%
% It returns the 3D rotation matrix given by a rotation arround z, y and x
% axes where the rotation angles are wz, wy, and wx respectively. The
% angles are given in radians.
%
% R = Xmatrixr3(wx,wy,wz) is equal to Rx*Ry*Rz where
%
% ... |
// Copyright 2022 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use {
crate::resolved_driver::ResolvedDriver,
bind::compiler::Symbol,
bind::ddk_bind_constants::{BIND_AUTOBIND, BIND_PROTOCOL},
bind::inter... |
<!DOCTYPE html>
<html lang="en" xmlns:th="https://thymeleaf.org"
xmlns:layout="http://www.nz.ultraq.nz/thymeleaf/layout"
layout:decorate="~{layout}">
<head>
<title>Hotel List</title>
<style>
.star {
color: gold;
font-size: 24px;
}
body {
... |
//logger.h
/*******************************************************************************
* Includes
******************************************************************************/
#include <iostream>
#include <fstream>
/*******************************************************************************
* Class Defi... |
package summary;
public class Summary {
//面试笔记
//-------------------------------------------------------------------基础
// Integer a = new Integer(2);
// Integer b = new Integer(2);
// System.out.println(a==b);// false
// 只要是new 都是两个对象 都是false
// 如果没有new 在缓存范围里的true 在范围外是false
//包装类的缓存:-1... |
import 'dart:ffi';
import 'dart:math';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:latlong2/latlong.dart' as latLng;
import 'package:get/get.dart';
import 'package:geo... |
<script lang="ts" setup>
import { computed } from 'vue'
import { useFilterStore } from '../../store/Filter'
import { getItemIcon } from '../../utils/ImageLoader'
import { getItemNameById } from '../../utils/getItemNameById'
import { getWowheadItemLinkById } from '../../utils/getWowheadItemLinkById'
import { TIER_CONFIG... |
import React, { useState } from 'react'
import axios from "axios"
import "./searchFilm.css"
const SearchFilm = () => {
const [filmsId, setFilmsId] = useState("");
const [idChosen, setIdChosen] = useState(false);
const [film, setID] = useState({
id: "",
title: "",
original_title: "",
url: "",
descr... |
<?php
/**
* Shopware Premium Plugins
* Copyright (c) shopware AG
*
* According to our dual licensing model, this plugin can be used under
* a proprietary license as set forth in our Terms and Conditions,
* section 2.1.2.2 (Conditions of Usage).
*
* The text of our proprietary license additionally can be found a... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>auth</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f5f5f5;
margin: 0;
display: ... |
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.util.*;
/**
* MuseumRoom is the room where all the action takes place. It is utter chaos in this newly opened museum
* and thus highly suspectible to robbery despite the museums dreams to become one of the biggst.
*
* @aut... |
/**
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
/* globals ClassicEditor, console, window, document, ListStyle */
import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_uti... |
'use strict'
import React from 'react'
import { connect } from 'react-redux'
import { Navbar as MDBNavbar, NavbarBrand, NavbarNav, NavbarToggler, Collapse, NavItem, NavLink } from 'mdbreact'
import userManager from '../Authentication/userManager'
import { ssoBaseURL } from '../../config/ssoBaseURL'
import { locale } f... |
package email
import (
"testing"
)
const email = `From: sender@example.com
To: recipient1@example.com, recipient2@example.com
Subject: Subject
Body`
func TestEmailMatch(t *testing.T) {
email, err := Parse([]byte(email))
if err != nil {
t.Fatalf("cannot create email: %v", err)
}
tests := []struct {
name ... |
using System;
using System.Collections.Generic;
using OOP.Model.Enums;
namespace OOP.Model.Orders
{
/// <summary>
/// Класс заказа.
/// </summary>
public class Order : IEquatable<Order>
{
/// <summary>
/// Свойство id заказа.
/// </summary>
public int Id { get; set;... |
package org.wonderly.swing.tabs;
import javax.swing.plaf.basic.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
//import org.wonderly.awt.*;
import java.util.logging.*;
import java.util.*;
/**
* <pre>
Copyright (c) 1997-2006, Gregg Wonderly
All rights reserved.
Redistribution and use in source a... |
import React from 'react';
const UpdateForm = ({
issueId,
priorityId,
priorities,
handleUpdate,
setIssueId,
setPriorityId,
}) => (
<div className="max-w-lg mx-auto mt-8 font-RedHatMedium max-[768px]:w-[95%] max-[768px]:mx-auto">
<form className="">
<div className="mb-6">... |
#
# @lc app=leetcode id=341 lang=python3
#
# [341] Flatten Nested List Iterator
#
from typing import *
class NestedInteger:
def isInteger(self) -> bool:
"""
@return True if this NestedInteger holds a single integer, rather than a nested list.
"""
pass
def getInteger(self) -> int:
... |
<template>
<el-dialog
:title="'选择人员'"
width="600px"
top="10vh"
:modal="false"
:visible.sync="dialogVisible"
@close="handleClose"
>
<div class="title">选择人员</div>
<el-form :model="form" :rules="rules" ref="form" class="form" :inline="true">
<el-form-item prop="keyWord">
<... |
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>LAPORAN</title>
<!-- CSS -->
<link rel="stylesheet" href="{{ asset('css/util.css') }}">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@... |
package it.corona.eboot.model;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import lombok.*;
import javax.persistence.*;
import java.tim... |
type ArrayOfObjects = Array<{
id: number;
[key: string]: any;
}>;
/**
* Creates an index map for an array of objects based on a specified key.
*
* @function
* @param {ArrayOfObjects[]} array - The array of objects to create the index map from.
* @param {string} idKey - The key in the objects to use for ind... |
import { useFilteredItemsByText } from "~/toolkit/hooks/useFilteredItemsByText";
import {
PagingContext,
usePagedItems,
usePagingStats,
} from "~/toolkit/hooks/usePaging";
import { SortDirType, useSorting } from "~/toolkit/hooks/useSorting";
interface UseTableProps {
filterKeys?: string[];
sortKey: string;
... |
<!--BEGIN SIGN-IN FORM-->
<form
novalidate
class="osp-chat-form osp-chat-form--sign-in"
[formGroup]="user"
(ngSubmit)="onSubmit(user)">
<input
type="text"
class="osp-chat-form__input"
placeholder="Username"
formControlName="name">
<span class="osp-chat-form... |
<!DOCTYPE node PUBLIC
"-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
<!--
org.gnome.evolution.dataserver.AddressBookCursor:
@short_description: Address book cursor o... |
/** @module @lexical/link */
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import type {
DOMConversionMap,
DOMConversionOutput,
EditorConfig,
GridSelection,
Lexi... |
import 'package:flutter/material.dart';
import 'package:fluttershop/data/models/responses/address_response_model.dart';
import '../../../core/components/spaces.dart';
import '../../../core/core.dart';
import '../models/address_model.dart';
class AddressTile extends StatelessWidget {
final bool isSelected;
final A... |
import React from 'react';
import { useTransition } from 'react-spring';
import { IToastMessage } from '../../contexts/ToastProvider';
import { Container } from './styles';
import Toast from './Toast';
interface IToastContainerProps {
messages: IToastMessage[];
}
const ToastContainer: React.FC<IToastContainerProps> ... |
import React, { useState } from "react";
import Signup from "./components/register";
import Login from "./components/login";
import OTP from "./components/otp";
import { loginApi, otpVerificationApi, signupApi } from "../../api/auth";
import { useNavigate } from "react-router-dom";
const AuthStates = {
SIGNUP: "sign... |
import React, { useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";
import { Link } from "react-router-dom";
import Chart from "chart.js/auto";
import { Doughnut, Line } from "react-chartjs-2";
import "./dashboard.css";
import { allUser } from "../../reduxToolkit/actions/userAction";
impor... |
from flask import Flask, render_template,request,redirect
from flask_sqlalchemy import SQLAlchemy
from datetime import datetime as dt
#<-----------------------------------To do List App------------------------------------->
# CRUD:
# Create
# Read
# Update
# Delete
app = Flask(__name__)
# configure the SQLite dat... |
import React, { useState, useRef, useContext } from "react";
import { Nav, Overlay } from "react-bootstrap";
import { AiOutlineUser } from "react-icons/ai";
import { SlArrowDown } from "react-icons/sl";
import { useNavigate } from "react-router-dom";
import useStyle from "./Style";
import Cookies from "js-cookie";
impo... |
import { useEffect, useState } from "react"
import axiosClient from "../axios-client"
import { Link } from "react-router-dom"
import { useStateContext } from "../contexts/ContextProvider"
export default function Users() {
const [users, setUsers] = useState([])
const [loading, setLoading] = useState(false)
const... |
// ignore_for_file: public_member_api_docs, sort_constructors_first
import 'dart:convert';
class RouteModel {
final String startPoint;
final String endPoint;
final DateTime date;
RouteModel({
required this.startPoint,
required this.endPoint,
required this.date,
});
RouteModel copyWith({
St... |
<template>
<div class="goodsinfo-container">
<transition
v-on:before-enter="beforeEnter"
v-on:enter="enter"
v-on:after-enter="afterEnter">
<div class="ball" v-show="ballFrag" ref="ball"></div>
</transition>
<!--卡片式布局-->
<div class="mui-card first">
<div class="mui-card... |
<?php
namespace ImageOptimization\Modules\Optimization\Components;
use ImageOptimization\Classes\Async_Operation\{
Async_Operation,
Async_Operation_Hook,
Async_Operation_Queue,
};
use ImageOptimization\Classes\Image\{
Image_Meta,
Image_Optimization_Error_Type,
Image_Status
};
use ImageOptimization\Classes\Logge... |
import { memo, useCallback } from 'react';
import { classNames } from 'shared/libs/class-names';
import { Button } from 'shared/ui/button';
import CopyIcon from 'shared/assets/icons/copy.svg';
import cls from './article-code-block.module.scss';
import { ArticleBlockCode } from '../../../model/types/article';
import ... |
const express = require('express');
const app = express();
const mysql = require("mysql");
const cors = require("cors");
const bcrypt = require("bcrypt");
const saltRounds = 10;
const {calcularHorasTrabalhadasEsteMes, pegarSalarioBase, pegarHorasExtras, calcularDescontos} = require("./funcoes");
const db = mysql.cre... |
namespace Kontur.Cache.Bench
{
using Kontur.Cache.Bench.Builders;
using NDesk.Options;
using System;
using System.Diagnostics;
using System.Linq;
using System.Threading;
public class CacheBenchOptions
{
public CacheBenchOptions()
{
CacheSize = 100;
... |
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { MenuItem } from 'primeng/api';
import { LayoutService } from "./service/app.layout.service";
import { Subscription } from 'rxjs';
import { StorageService } from '../_services/storage.service';
import { AuthService } from '../_services/au... |
import React, {useState, useEffect} from "react";
import "./styles.css";
import axios from "axios";
import PokeCard from "./components/PokeCard/PokeCard";
const App = () => {
const [pokeList, setPokelist] = useState([])
const [pokeName, setPokeName] = useState("")
const getPokemon = () => {
axios
... |
# Go 功能框架
> 原文:<https://medium.com/google-cloud/go-functions-framework-120ace237fe2?source=collection_archive---------0----------------------->

谷歌云功能+ Go(上田拓也的 Logo—[src](https://github.com/golang-samples/gopher-vector))
在本帖中,您将了解开源 Go Functions 框架,该框架使您能够在您的计算机上开发 Gola... |
[circle-ds](README.md) / Exports
# circle-ds
## Table of contents
### Classes
- [CircularArrayList](classes/CircularArrayList.md)
- [CircularDeque](classes/CircularDeque.md)
- [CircularDoublyLinkedList](classes/CircularDoublyLinkedList.md)
- [CircularLinkedDeque](classes/CircularLinkedDeque.md)
- [CircularLinkedLis... |
//#define NonArray
//#define StringArray
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Exercise04 {
class Program {
static void Main(string[] args) {
Stopwatch sw = new Stopwatch();
... |
#' Install Packages from GitHub
#'
#' @param packages character vector of the names of the packages.
#' You can specify \code{ref} argument (see below) using \code{package_name[@ref|#pull]}.
#' If both are specified, the values in repo take precedence.
#' @param ask logical. Indicates ask to confirm befor... |
import React from "react";
import { Card, CardFooter, CardHeader } from "@/components/ui/card";
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import Link from "next/link";
import { useParams } from "next/navigation";
import { dateView } from "@/lib/dayjs";
export default function BoardI... |
<!-- Copyright © 2018-2019 Inria. All rights reserved. -->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Dynamic SVG</title>
</head>
<body>
<p>
This page is an example of HTML/JS interacting with the lstopo SVG output.
</p>
<p>
Load a SVG that was exported with lstopo's <b>nat... |
<!DOCTYPE html>
<html>
<head>
<title>punkdrop</title>
</head>
<body>
<h1>Welcome to punkdrop</h1>
<h2>Web file sharing made easy</h2>
<p>Your generated key: <strong id="userKey"></strong></p>
<div>
<input type="file" id="file" />
<button onclick="sendFile()">Send File</button>
... |
package com.ruoyi.system.controller;
import java.util.ArrayList;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.utils.ShiroUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.... |
use chrono::{DateTime, Utc};
use clap::{Args, Parser};
use notify_rust::Notification;
use nvml_wrapper::enum_wrappers::device::TemperatureSensor;
use nvml_wrapper::enums::device::UsedGpuMemory;
use nvml_wrapper::struct_wrappers::device::ProcessInfo;
use nvml_wrapper::Nvml;
use std::{
fs::{File, OpenOptions},
io... |
<?php
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
class TikiFilter
{
/**
* Provides a filter instan... |
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { HttpService } from '../../../services/http.service';
import { Router } from '@angular/router';
@Component({
selector: 'app-category-create',
template: `<div class="container-fluid">
<div class="... |
from os import truncate
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.popup import Popup
from kivy.graphics.texture import Texture
from kivy.clock import Clock
from kivy.core.window import Window
from kivy.config import Config
from kivy.properties import ListProperty
from os.path impor... |
import jwt from "jsonwebtoken";
import { envs } from ".";
export const JWT_SEED=envs.JWT_SEED
export class JwtAdapter {
static async generateToken(
payload: Object,
duration: string = "2h"
): Promise<string | null> {
return new Promise((resolve) => {
//todo generacion del seed
//Siempre se r... |
"use client";
import { useState } from "react";
import { useRouter } from "next/navigation";
import * as z from "zod";
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { useToast } from "@/components/ui/use-toast";
import { signIn } from "next-auth/react";
import ... |
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
// Components
import { HomeComponent } from './home/home.component';
import { ContactUsComponent } from './contact-us/contact-us.component';
import { ProductComponent } from './product/product.component';
import { Product... |
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Resources\User\UserResource;
use App\Repositories\Contracts\IUserRepository;
use App\Services\Auth\AuthService;
use App\Http\Controllers\Controller;
use App\Http\Requests\Auth\RegisterRequest;
use App\Http\Requests\Auth\LoginRequest;
use App\Http\Resources\Error... |
package owners
import "context"
// Repository defines owner storage interface.
type Repository interface {
// Save adds a new owner to the owner store.
Save(ctx context.Context, owner Owner) (Owner, error)
// Updates a given owner entity
Update(ctx context.Context, owner Owner) error
// Retrieve retrieves an o... |
//文件压缩-Huffman实现
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define MAXSIZE 32
struct tnode { //Huffman树结构
char c;
int weight; //树节点权重,叶节点为字符和它的出现次数
struct tnode *left,*right;
} ;
int Ccount[128]={0}; //存放每个字符的出现次数,如Ccount[i]表示ASCII值为i的字符出现次数
struct tnode *Root=NULL; //Huffman树的根节点
char HC... |
<template>
<header :class="['w-full', 'text-sm', headerHeightClass]">
<div class="fixed left-0 top-0 h-16 w-full bg-white">
<div
class="mx-auto flex h-full flex-nowrap border-b border-solid border-brand-gray-1 px-8"
>
<router-link
:to="{ name: 'Home' }"
class="flex ... |
package main
import (
"fmt"
"log"
"net"
"context"
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
posts "grpc-example/server/posts"
)
var (
serverURL = "localhost:10000"
portServer = 10000
)
type Server struct {
posts.UnimplementedPostServiceServer
}
func (s *Server) GetPosts(ctx context.C... |
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:pdf/const/app_color.dart';
import 'package:pdf/view/DocumentScreen/document_screen.dart';
import 'package:pdf/view/Favorites/favorites.dart';
import 'package:pdf/view/RecentSreen/recent_screen.dart';
cl... |
/*
* Copyright (C) 2010 SL-King d.o.o
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of version 2.1 of the GNU Lesser
* General Public License as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT... |
// Copyright 2024 out of sCope team - Michał Ogiński
#pragma once
#include "CoreMinimal.h"
#include "UI/ObsidianWidgetController.h"
#include "GameplayTagContainer.h"
#include "ObsidianTypes/UserIterface/ObsidianUIEffectClassification.h"
#include "ObsidianTypes/UserIterface/ObsidianUIData.h"
#include "MainOverlayWidge... |
import { action, persist, thunk } from 'easy-peasy';
import getPlaylist from '../api';
const playlistModel = persist(
{
data: {},
error: '',
isLoading: false,
addPlaylist: action((state, payload) => {
state.data[payload.playlistId] = payload;
}),
deletePlaylist: action((state, payload) => {
delete s... |
import {Component, OnDestroy, OnInit} from '@angular/core';
import {Router} from '@angular/router';
import {Store} from '@ngrx/store';
import {Observable, Subscription} from 'rxjs';
import {LoderStatus} from 'src/app/store/actions/loading.actions';
import {getBusLineSuccess} from 'src/app/store/selectors/bus-line.selec... |
<template>
<q-card class="my-card" :style="style">
<q-card-section :horizontal="!$q.platform.is.mobile">
<q-img v-if="Image" :src="ImgSrc" basic v-on:click.stop="openSelf()">
<!-- Si tiene imagen --->
<template v-if="$q.platform.is.mobile">
<!-- Y es movil -->
<q-btn
... |
import "./ExpenseForm.css";
import { useState } from "react";
const ExpenseForm = (props) => {
// const [enteredTitle, setEnteredTitle] = useState("");
// const [enterPrice, setEnteredPrice] = useState("");
// const [enterDate, setEnteredDate] = useState("");
const [userInput, setUserInput] = useState({... |
import React, { useState } from 'react';
import {
View,
StyleSheet,
Text,
Button,
Image,
TouchableOpacity,
ScrollView,
} from 'react-native';
import Input from '../../components/Input';
import { Video, ResizeMode } from 'expo-av';
import * as ImagePicker from 'expo-image-picker';
import { colors } from '.... |
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Add User</title>
<link rel="stylesheet" href="../../assets/css/bootstra... |
require 'rails_helper'
describe Sideqik::V1::CodePools do
include UserMacros
include ApiMacros
context "as authorized user" do
login_user
describe "POST /accounts/n/pools" do
it "should create code pool for account" do
post_success "/accounts/#{account.id}/pools", name: 'These Codez'
... |
import "dart:convert";
import 'package:apka_s_api/data/ApiKey.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:http/http.dart' as http;
import 'package:shared_preferences/shared_preferences.dart';
import ... |
package ru.stqa.mantis.manager;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import java.util.Objects;
import java.util.Properties;
public class ApplicationManager {
private WebDriver ... |
#ifndef RANGESENSOR_H
#define RANGESENSOR_H
#include <vector>
#include <gmapping/sensor/sensor_base/sensor.h>
#include <gmapping/utils/point.h>
#include <gmapping/sensor/sensor_range/sensor_range_export.h>
namespace GMapping{
// 是激光传感器的封装, 它描述了扫描光束的的各种物理特性,继承自类Sensor。
class SENSOR_RANGE_EXPORT RangeSensor: public Sen... |
#include <stdio.h>
#include <stdlib.h>
struct node
{
int data;
struct node *next;
};
struct node *create_node()
{
struct node *temp;
temp = (struct node *)malloc(sizeof(struct node));
printf("Enter the data\n");
scanf("%d", &temp->data);
temp->next = NULL;
return temp;
}
struct node *i... |
import { Injectable } from '@nestjs/common';
import { Todo } from './todo.model';
@Injectable()
export class TodoService {
private todos: Todo[] = [
new Todo({
id: 1,
title: 'Todo 1',
description: 'Description 1',
completed: true,
}),
new Todo({
id: 2,
title: 'Todo 2',... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.