text stringlengths 184 4.48M |
|---|
# frozen_string_literal: true
require 'request_store'
require 'active_support'
require 'active_support/core_ext/date'
require 'active_support/core_ext/time'
require 'active_support/core_ext/date_time'
require 'active_support/core_ext/object'
require 'forwardable'
require 'ostruct'
module Bp3
module RequestState
... |
#pragma once
template<typename T>
class TreeNode
{
public:
TreeNode() {};
TreeNode(T value);
~TreeNode() {};
/// <summary>
/// Returns whether or not this node has a left child
/// </summary>
bool hasLeft();
/// <summary>
/// Returns whether or not this node has a right child
/// </summary>
bool hasRight()... |
"""Use case for getting threads."""
from __future__ import annotations
from typing import TYPE_CHECKING
from .dto import ThreadDTO
if TYPE_CHECKING:
from chat.domain.thread import AbstractThreadRepository
class ListThreads:
"""Use case for getting threads."""
def __init__(self, repository: AbstractTh... |
require_relative 'spec_helper'
require 'date'
RSpec.describe Rental do
let(:book) { Book.new('El viejo y el mar', 'Ernest Hemingway') }
let(:person) { Person.new(30) }
describe '#initialize' do
it 'creates a new Rental instance' do
rental = Rental.new('2023/9/6', book, person)
expect(rental).to ... |
import { Injectable } from '@angular/core';
import {HttpClient, HttpErrorResponse, HttpHeaders} from "@angular/common/http";
import {Observable, throwError } from 'rxjs';
import { catchError } from 'rxjs/operators';
import {Etudiant} from "../models/Etudiant";
import {Module} from "../Entities/Module";
import {Inscrip... |
<div class="container-fluid head col-md-12" #Home (scroll)="scrollMe($event)">
<p style="color:white; width:150px;float: left;" ><i class="fa fa-phone fa-flip-horizontal" aria-hidden="true"></i> 7767858952</p>
<p style="color:white;width:250px;float: left; " ><i class="fa fa-envelope" aria-hidden="true"></i... |
import React, { useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { addProduct } from "../redux/productSlice";
import "./product.css";
import { HeartOutlined } from "@ant-design/icons";
import { useNavigate } from "react-router-dom";
import { addtocart } from "../redux/c... |
import { CommonModule } from '@angular/common';
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { MatToolbarModule } from '@angular/material/toolbar';
import { RouterModule } fr... |
from enum import Enum
from typing import Optional
from pydantic import EmailStr, BaseModel, Field
from datetime import datetime
class Role(str, Enum):
SALESPERSON = "salesperson"
ADMIN = "admin"
class NewUserSchema(BaseModel):
email: EmailStr
username: str = Field(min_length=4)
password: str = F... |
# [621. Task Scheduler](https://leetcode.com/problems/task-scheduler/description/?envType=daily-question&envId=2024-03-19)
You are given an array of CPU tasks, each represented by letters A to Z, and a cooling time, `n`. Each cycle or interval allows the completion of one task. Tasks can be completed in any order, but... |
import bcrypt from 'bcrypt';
import { Schema, model } from 'mongoose';
import config from '../../config';
import { TUser, TUserModel } from './user.interface';
const userSchema = new Schema<TUser, TUserModel>(
{
username: {
type: String,
required: [true, 'Username is required'],
unique: true,
... |
package com.example.memories;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.view.LayoutInflater;
import androidx.recyclerview.widget.RecyclerView;
import com.bumpt... |
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JPanel.java to edit this template
*/
package view.panels;
import dao.TransactionDao;
import java.io.IOException;
import java.time.format.DateTimeFormatter... |
import {Component, Input, OnInit} from '@angular/core';
import {FormBuilder, FormGroup} from "@angular/forms";
import {NgbActiveModal, NgbDateStruct} from "@ng-bootstrap/ng-bootstrap";
import {catchError, Observable, throwError} from "rxjs";
import {AccountDto, ResponseDto} from "../../../common";
import {AccountTransa... |
'use client';
import Link from 'next/link';
import { useRouter } from 'next/navigation';
import React, { useState } from 'react';
import Button from '@/components/ui/Button';
import { handleRequest } from '@/utils/auth-helpers/client';
import { signInWithPassword } from '@/utils/auth-helpers/server';
// Define prop ... |
//
// BirthdayView.swift
// Disco
//
// Created by Ethan McRae on 7/27/23.
//
import SwiftUI
struct BirthdayView: View {
@Environment(\.presentationMode) var presentationMode
@State private var name = ""
@State private var date = Date()
var onComplete: (String, Date) -> Void = { _,_ in }
var... |
import { NgModule, InjectionToken } from "@angular/core";
import { RouterModule, Routes, ActivatedRouteSnapshot } from "@angular/router";
import { TestSiteComponent } from "../app/test-site/test-site.component";
import { AboutComponent } from "../app/about/about.component";
import { LearnMoreComponent } from "../app/le... |
<template>
<div class="main">
<div class="desc">
{{ hitokoto }}
</div>
<a-form id="formLogin" class="user-layout-login" ref="formLogin" :form="form" @submit="handleSubmit">
<a-tabs :activeKey="customActiveKey" :tabBarStyle="{ textAlign: 'center', borderBottom: 'unset'... |
import {Component, OnInit} from '@angular/core';
import {FormBuilder, FormGroup, Validators} from "@angular/forms";
import {Router} from "@angular/router";
import * as queryString from 'query-string';
import {environment} from "../../../../../environments/environment";
import {AuthService} from '../../services/auth.s... |
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {RouterModule, Routes} from "@angular/router";
import {StudentCreateComponent} from "./student-create/student-create.component";
import {StudentListComponent} from "./student-list/student-list.component";
import {StudentDet... |
************************Looping Techniques in Python*************************
1) ---Using enumerate()-------
for key, value in enumerate(['The', 'Big', 'Bang', 'Theory']):
print(key, value)
---------<Output>----------
0 The
1 Big
2 Bang
3 Theory
2) -----Using zip()-----
questions = ['name', 'colour', 'shape']... |
/*
* Copyright 2022 Evgenii Plugatar
*
* 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 agree... |
import React from 'react'
import { useDispatch } from 'react-redux'
import { useState } from 'react';
import { loginAction,signupAction } from '../../actions/userActions';
import { useEffect } from 'react';
import { useSelector } from 'react-redux';
import { useNavigate } from 'react-router-dom';
import { VERIFY_EMAIL ... |
# cache-manager
I guess coming from a Laravel background I enjoyed/am used to using their syntax for interacting with cache and wanted to continue that in the browser/Node.
Current drivers out of the box are (simply because these are the ones I use):
- Plain object (browser/server)
- Map (browser/server)
- Local sto... |
@webUI @insulated @disablePreviews @email
Feature: add users
As a subadmin
I want to add users
So that unauthorised access is impossible
Background:
Given these users have been created with default attributes and without skeleton files:
| username |
| Alice |
And group "grp1" has been cr... |
import { Test } from '@nestjs/testing';
import { INestApplication, ValidationPipe } from '@nestjs/common';
import * as request from 'supertest';
import { Repository } from 'typeorm';
import { getRepositoryToken, TypeOrmModule } from '@nestjs/typeorm';
import { randomUUID } from 'crypto';
import { CardTagController } fr... |
package toy.board.service.comment;
import static org.assertj.core.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.*;
import jakarta.persistence.EntityManager;
import java.util.Optional;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Tes... |
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
class NoisyLinear(nn.Module):
def __init__(self, in_features, out_features, sigma_init=0.017):
super(NoisyLinear, self).__init__()
self.in_features = in_features
self.out_features = out_features
... |
import React from 'react'
import { LoadingButton } from '@mui/lab';
import { Alert, Box, Button, Stack, TextField } from '@mui/material';
import { useFormik } from 'formik';
import { useState } from 'react';
import { useDispatch } from 'react-redux';
import { toast } from 'react-toastify';
import * as Yup from 'yup';
i... |
import axios from "axios";
import { useEffect, useState } from "react";
import { useParams } from "react-router-dom";
import { BasePath } from "../utils/BasePathApi";
import { peliculaDetalle } from "./PeliculasModelD";
import "./PeliculaDetalle.css";
import { generoModelConId } from "./generos/GeneroModel";
import But... |
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Player extends Model
{
use HasFactory, SoftDeletes;
protected $guarded = [];
/**
* Accessor method to get the full name att... |
import React from 'react';
import { Route } from 'react-router-dom';
import { useDispatch, useSelector } from 'react-redux';
import { LinkContainer } from 'react-router-bootstrap';
import { Navbar, Nav, Container, NavDropdown } from 'react-bootstrap';
import { logout } from '../actions/userActions';
import SearchBox fr... |
// App.js or relevant component
import React, { useState } from 'react';
import CategorySelector from './Components/CategorySelector';
import ProductComponent from './Components/ProductComponent';
const App = () => {
const [selectedCategory, setSelectedCategory] = useState('');
const handleSelectCategory = (categ... |
<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class UserProfileResource extends JsonResource
{
/**
* Transform the resource we return to client. We can format the data any how without exposing how the backend structure looks like.
*
... |
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.2 <0.9.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
*/
interface IStorage {
// EVENTS
event Stored(uint256 indexed num);
/**
* @dev Store value in variable
* @param num value to store
*/
function store(uint256 num) ex... |
import React from 'react';
import { connect } from 'react-redux';
import Apprise from '../components/Apprise';
import { formUpdate } from '../actions/forms';
import { newApprisal } from '../actions/apprisals';
import { UserType } from '../../apiserver/models/constants';
class AppriseMenu extends React.Component { // e... |
<?php
/**
* implements wp-cli extension for bulk optimizing
*/
class EWWWIO_CLI extends WP_CLI_Command {
/**
* Bulk Optimize Images
*
* ## OPTIONS
*
* <library>
* : valid values are 'all' (default), 'media', 'nextgen', 'flagallery', and 'other'
* : media: Media Library only
* : nextgen: Nextcellent a... |
import type { FC } from 'react';
import { useState } from 'react';
import PlusIcon from '@untitled-ui/icons-react/build/esm/Plus';
import {
Avatar,
Box,
Button,
Chip,
IconButton,
Stack,
SvgIcon,
TextField,
Typography
} from '@mui/material';
import { MobileDatePicker } from '@mui/x-date-pickers';
expo... |
import React from 'react';
import { render, fireEvent } from '@testing-library/react-native';
import PrimaryButton from '../src/components/PrimaryButton';
import { View } from 'react-native';
describe('PrimaryButton', () => {
it('renders the button with the correct title', () => {
const { getByText } = render(
... |
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { inject, observer } from 'mobx-react'
import Translate from 'react-translate-component'
import translate from 'counterpart'
import styled from 'styled-components'
import AddedActors from './addedActors'
import { SectionTitle } from '..... |
# Compulsory Task 1
# Re-submitted for review after necessary corrections
# Create Email class
class Email:
# Initialise the instance variables for email class
def __init__(self, from_address, subject_line, email_contents):
self.from_address = from_address
self.subject_line = subject_line
... |
package core
import (
"bytes"
"crypto/sha256"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"math/big"
"strings"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
type Hash [32]byte
// Hex returns a hex string from the Hash type
func (hash Hash) Hex() string {
return... |
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import { VueJsonp } from 'vue-jsonp'
import store from '../store/store'
// 全局引入axios
import axios from 'axios'
// 引入全局样式
import '../public/css/inddex.css'
im... |
import { AxiosResponse } from "axios";
import {
createContext,
ReactNode,
useCallback,
useContext,
useState,
} from "react";
import { api } from "../services/api";
interface CartProviderProps {
children: ReactNode;
}
interface Product {
id: number;
name: string;
category: string;
price: number;
... |
---
title: How do you wrap text content in CSS?
description: We'll look at the CSS features that allow us to wrap overflowing text in containers.
slug: css-text-wrap
authors: peter_osah
tags: [css]
image: https://refine.ams3.cdn.digitaloceanspaces.com/blog/2024-03-05-css-wrap-text/social.png
hide_table_of_contents: fal... |
import { client, urlFor } from "@/lib/sanity";
import Image from "next/image";
import Link from "next/link";
async function getBlogs() {
const query = `
*[_type == 'blogs'] | order(_createdAt desc){
title,
body,
description,
"currentSlug": slug.current,
"imageUrl": main_image.asset._ref... |
import React, { useEffect, useState } from "react";
import {
ShippingTimeRates,
TestRateCalculation,
ShippingAdditionalSetting,
StoreFronts,
ShippingSuppliers,
ShippingMethodGeneral,
} from "../..";
import { Breadcrumb, Button, Result } from "antd";
import { useParams, useNavigate, Link } from "react-router... |
import { IsNotEmpty } from '@nestjs/class-validator';
import { ApiProperty } from '@nestjs/swagger';
export class LoginUserDto {
@ApiProperty()
@IsNotEmpty()
readonly email: string;
@ApiProperty()
@IsNotEmpty()
readonly password: string;
}
export class CreateUserDto {
@IsNotEmpty()
@ApiProperty()
e... |
<!DOCTYPE html>
<html lang="uk">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts... |
import { Observable } from './Observable';
import { Observer } from './Observer';
export class DataSource extends Observable {
constructor(private _value: number) {
super();
}
public get value(): number {
return this._value;
}
public set value(newValue: number) {
this._value = newValue;
thi... |
import React from 'react'
import { useForm } from 'react-hook-form'
import styles from './FullName.scss'
import { ITenant, ITenantHandlers } from '@typings/'
import { LabelInput } from '@styles/LabelInput/LabelInput'
import { Button } from '@styles/Button/Button'
import { Wrapper } from '@styles/Wrapper/Wrapper'
expor... |
package com.ssafy.kkoma.api.member.service;
import com.ssafy.kkoma.api.area.service.AreaService;
import com.ssafy.kkoma.api.member.dto.request.UpdateMemberPreferredPlaceRequest;
import com.ssafy.kkoma.api.member.dto.response.*;
import com.ssafy.kkoma.api.product.dto.ProductSummary;
import com.ssafy.kkoma.domain.area.e... |
import Image from "next/image";
import styles from "../../styles/Profile.module.css";
import { BiLogInCircle } from "react-icons/bi";
import { signOut } from "next-auth/react";
import Button from "../button/button";
import { toast } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
import { useRou... |
# Rog-O-Matic
## A Modern Beligerent Expert System
## by Robin Adams
### Introduction
#### Rogue
In 1980, the game Rogue appeared on the PLATO system, written by Michael C. Toy and Ken Arnold. It was one of the first computer RPGs and extremely influential - we still describe games as "roguelike" if, like Rogue, the... |
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true">
<el-form-item label="名称检索" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
style="width: 240px"
@keyup.enter.native="h... |
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.urls import reverse
from django.utils.text import slugify
class MenuItem(models.Model):
title = models.CharField(max_length=100, unique=True)
slug = models.SlugField(unique=True, blank=... |
<!-- "Copyright 2020 Infosys Ltd.
Use of this source code is governed by GPL v3 license that can be found in the LICENSE file or at https://opensource.org/licenses/GPL-3.0
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Gener... |
package com.mineplex.studio.example.survivalgames.modules.manager.ui;
import com.mineplex.studio.example.survivalgames.modules.manager.GameManagerModule;
import com.mineplex.studio.sdk.gui.MineplexGUI;
import com.mineplex.studio.sdk.modules.game.MineplexGame;
import lombok.NonNull;
import lombok.RequiredArgsConstructo... |
__ ______ ____ ________ __ __ ____
/ //_/ __ \/ __ \/ ____/ //_// / / __ \
/ ,< / / / / / / / __/ / ,< / / / / / /
/ /| / /_/ / /_/ / /___/ /| |/ /___/ /_/ /
/_/ |_\____/_____/_____/_/ |_/_____/\____/
__ ______
/ / / / __ \
/ / / / / / /
/ /_/ / /... |
<template>
<!-- 上方背景 -->
<div
class="w-full h-[400px] md:h-[460px] lg:h-[600px] 2xl:h-[700px] bg-no-repeat bg-cover absolute top-0 -z-10 bg-bottom shadow"
:style="`background-image: url(${venue.picture?.horizontal})`"></div>
<!-- 場地體驗 -->
<section class="container pb-20 lg:pb-32 pt-[400px] md:pt-[460px]... |
import csv
import re
from collections import Counter, namedtuple
import requests
MARVEL_CSV = "https://raw.githubusercontent.com/pybites/marvel_challenge/master/marvel-wikia-data.csv" # noqa E501
Character = namedtuple("Character", "pid name sid align sex appearances year")
# csv parsing code provided so this Bit... |
import DialogTitle from "@mui/material/DialogTitle";
import Dialog from "@mui/material/Dialog";
import { Button } from "@mui/material";
import { useEffect, useState } from "react";
import Axios from "axios";
import Table from "@mui/material/Table";
import TableBody from "@mui/material/TableBody";
import TableCell from ... |
package com.yagod.workshopmongodb.resources;
import com.yagod.workshopmongodb.domain.Post;
import com.yagod.workshopmongodb.domain.User;
import com.yagod.workshopmongodb.dto.UserDTO;
import com.yagod.workshopmongodb.resources.util.URL;
import com.yagod.workshopmongodb.services.PostService;
import com.yagod.workshopmon... |
<%@ page contentType="text/html" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="p" uri="/publisher-tags" %>
<nav class="ym-hlist">
<ul>
<li class="active">
<strong>Novo evento (LiveStats)</strong>
</li>
</ul>
</nav>
<s:form action="liveStats-save" cssClass="ym-form"... |
import { GlobalStyle } from '../../GlobalStyle';
import { Component } from 'react';
import { nanoid } from 'nanoid';
import { ContactsForm } from '../ContactsForm/ContactsForm';
import { ContactsList } from '../ContactsList/ContactsList';
import { Filter } from 'components/Filter/Filter';
import { Thumb } from './App.S... |
package server
import (
"bytes"
"context"
"encoding/json"
"net/http"
"net/http/httptest"
"testing"
"github.com/dsha256/packer/internal/mock"
"github.com/dsha256/packer/internal/packer"
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/require"
)
func TestSizesHandler_listSizes(t *testing.T) {
c... |
/*
* Copyright 2008 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... |
DROP DATABASE IF EXISTS EMPLEADOS_Join;
CREATE DATABASE EMPLEADOS_Join;
USE EMPLEADOS_Join;
CREATE TABLE PUESTO(
NUM_PUESTO INT,
NOMB VARCHAR(20),
SUELDO_HORA INT,
PRIMARY KEY (NUM_PUESTO)
);
CREATE TABLE DEPTO(
NUM_DEPTO INT,
NOMB VARCHAR(20),
UBIC VARCHAR(30),
PRIMARY KEY(NUM_DEPTO... |
<?php
/**
*
*/
function game_pieces_install() {
_game_pieces_running_game_add_default_fields();
_game_pieces_pattern_add_default_fields();
}
/**
* Implements hook_schema().
*
* Defines the database tables used by this module.
* Remember that the easiest way to create the code for hook_schema is with
* the ... |
package za.ac.cput.domain;
//Siphosethu Makhambeni
// 221272976
//22/03/2024
//Contact.java
public class Contact {
private String phoneNumber;
private String emailAddress;
private String address;
private Contact() {
}
private Contact(ContactBuilder builder) {
this.phoneNumber =... |
---
lesson_id: mathontrack-numbers-natrual-numbers
lesson_title: Natural Numbers
lesson_description: Learn what Natural Numbers are.
---
# Natural numbers ($ℕ$ or $N$)
- Natural numbers are simply “counting” numbers. They are the numbers that a farmer may use to count the number of cows they have for example.
- Natur... |
#encoding: utf8
import pytest
import pprint
import rejit.common
from rejit.nfa import NFA
from rejit.regex import Regex
from tests.helper import accept_test_helper
ppast = pprint.PrettyPrinter(indent=4)
def assert_regex_parse_error(pattern):
with pytest.raises(rejit.regex.RegexParseError):
re = Regex(pa... |
<script lang="ts">
// import { unit } from "$lib/unit";
import { convertTemp } from "$lib/utilities/convertTemp";
import { toSentenceCase } from "$lib/utilities/toSentenceCase";
import WeatherIcon from "$lib/ui/WeatherIcon.svelte";
export let mode: "hourly" | "daily";
export let temp: {
... |
import * as vlq from "vlq";
const merge = require('merge-source-map');
//
// Maps a position in the generated file to to a position in the source file.
//
export interface IMapping {
//
// The line in the generated file (1-based).
//
genLine: number;
//
// The column in the generated file (0-b... |
# Assignment 02
## Task Idea
Find the exit from an unknown labyrinth.
## Problem Description
We start a journey through an unknown labyrinth. The labyrinth has many paths arranged on one level of a game board. The
board is divided into square fields (locations) of the same size. Some paths are dead ends, and some i... |
import { Route } from '@angular/router';
import { WelcomeComponent } from './welcome/welcome.component';
export const APP_ROUTES: Route[] = [
{
path: '',
component: WelcomeComponent,
pathMatch: 'full',
},
{
path: 'about',
loadComponent: () =>
import('./about/about.component').then((c) =... |
<!DOCTYPE html>
<html lang="uk">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>WebStudio</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="pr... |
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!-- c:out ; c:foreach; c:if -->
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!-- form:form -->
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<!-- formatting things like dates... |
import logging
from logging.handlers import RotatingFileHandler
import os
basedir = os.path.abspath(os.path.dirname(__file__))
logs_dir = os.path.join(basedir, 'logs')
if not os.path.exists(logs_dir):
os.makedirs(logs_dir)
# 创建一个日志实例
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
# 创建一个处理器,写... |
package com.atguigu.gulimall.cart.vo;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* @author kLjSumi
* @Date 2021/1/10
*
* 购物车
*/
public class Cart {
private List<CartItem> items;
private Integer countNum; //商品数量
private Integer countType; //商品类型数量
private Big... |
package com.example.languagelegends.database
import androidx.room.TypeConverter
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import java.io.ByteArrayOutputStream
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import com.example.languagelegends.features.Language
/**
* Thi... |
from django.core.management import call_command
from django.core.management.base import CommandError
from gestion_client.models import User, Contrat, Client, Evenement
from unittest.mock import patch, Mock
from datetime import datetime, timedelta
import pytest
@pytest.fixture
def custom_input():
return lambda _: ... |
import React from 'react'
import { render } from 'react-dom'
import { createStore } from 'redux'
import { Provider, connect } from 'react-redux'
import userReducer from 'core/lib/reducers/user'
const LoginFormComponent = ({isLoggedIn, onLoginSubmit}) => {
let input
return <form onSubmit={e => {
e.preventDefaul... |
namespace Bookworm.Services.Data.Models.Books
{
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Bookworm.Data.Common.Repositories;
using Bookworm.Data.Models;
using Bookworm.Services.Data.Contracts;
using Bookworm.Services.Data.Contracts.Books;
... |
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
* http://gearbox.sf.net/
* Copyright (c) 2004-2010 Alex Brooks
*
* This distribution is licensed to you under the terms described in
* the LICENSE file included in this distribution.
*
*/
#include <iostream>
#include <cstring>... |
function me() {
return "Hola, soy 👨💻";
}
// Pueden ser usadas como argumentos de función
const greet = (fn) => console.log(fn());
greet(me);
// 2. Pueden ser devueltas
function makeGreeter() {
return me;
// ^ Estamos devolviendo una función!
}
// Podemos asignar el resultado a una variable y luego llama... |
require 'rails_helper'
describe 'Usuário edita um pedido' do
it 'e não é o dono' do
# Arrange
gabriel = User.create!(name: 'Gabriel', email: 'gabriel@gmail.com', password: 'password')
joao = User.create!(name: 'João', email: 'joao@gmail.com', password: 'password')
warehouse = Warehouse.create!(name: ... |
import {
ActivityType,
ButtonBuilder,
ButtonStyle,
Client,
REST,
Routes,
StringSelectMenuBuilder,
StringSelectMenuOptionBuilder,
} from 'discord.js';
import {schedule} from 'node-cron';
import {commandHash, commandList, presenceCmds, wikiCmd} from '../commands';
import {config} from '../config';
import ... |
// Copyright 2009 Google 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 ... |
<template>
<div>
<button @click="isShow = !isShow">显示/隐藏</button>
<!-- 如果transition指定了name属性,那么样式内的动画名字需要修改为:(name)-leave-active -->
<!-- 添加一个appear属性,可以使得进入页面时就具有动画效果 -->
<transition>
<h1 v-show="isShow">你好</h1>
</transition>
</div>
</template>
<script>
export default {
name: "Test",
data... |
#pragma once
#include "Parsing/IParserValue.h"
#include "Parsing/TokenPos.h"
#include "Utils/ClassUtils.h"
#include <string>
enum class SimpleParserValueType
{
// Meta tokens
INVALID,
END_OF_FILE,
NEW_LINE,
// Character sequences
CHARACTER,
MULTI_CHARACTER,
// Generic token types
... |
<?php
namespace Plugins\PageBuilder\Addons\Tenants\Common;
use App\Helpers\LanguageHelper;
use App\Helpers\SanitizeInput;
use Plugins\PageBuilder\Fields\Image;
use Plugins\PageBuilder\Fields\Repeater;
use Plugins\PageBuilder\Fields\Select;
use Plugins\PageBuilder\Fields\Text;
use Plugins\PageBuilder\Helpers\RepeaterF... |
<div class="private-form-wrapper">
<!-- <div class="sign-card"> -->
<h2 class="detail-form-title">Activity Update Form</h2>
<form class="item-create" [formGroup]="form" (ngSubmit)="onSubmit()">
<div class="form-row-one-item-start">
<div class="activityTitle">
<label for="... |
import { useState } from "react";
const Checkbox = ({ label, storageKey }) => {
const [checked, setChecked] = useState(
localStorage.getItem(storageKey) === "true"
);
const handleChange = () => {
// setChecked(!checked);
// localStorage.setItem(storageKey, !checked);
// localStorage.setItem("Spl... |
<doctype html>
<html>
<head>
<meta charset='utf-8'>
</head>
<body>
Markdown:
<br>
<textarea id='e_in' style='width: 100%; height: 50vh;'>
<!-- Output copied to clipboard! -->
# WGSL 2021-00-00 Minutes
### Example 1
* lorem
## H2
### [Example 2](example.com)
* ipsum
### Ex... |
<?php
class Centurion_Test_PHPUnit_ControllerTestCase extends Zend_Test_PHPUnit_ControllerTestCase
{
public function __construct($name = NULL, array $data = array(), $dataName = '')
{
if (null == $this->bootstrap) {
// Assign and instantiate in one step:
$this->bootstrap = new ... |
const express = require('express')
const router = express.Router()
const createError = require('http-errors')
const User = require('../models/user')
const { authSchema, loginSchema } = require('../helpers/validationSchema')
const {
signAccessToken,
signRefreshToken,
verifyRefreshToken,
verifyAccessToken
} = req... |
/*
Assignment operator assigns a value to its left operand based on the value of its right operand.
All of them are binary operators.
left operand (operator) right operand
= -> simple assignment
+= -> addition assignment
-= -> subtraction assignment
*= -> multiplication assignment
/= -> division assignment
%= -> mo... |
import React, {
DetailedHTMLProps,
forwardRef,
ButtonHTMLAttributes,
} from "react";
const Button = forwardRef<
HTMLButtonElement,
DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>
>(({ className, children, ...rest }, ref) => {
return (
<button
className={`bg-blue-600 ... |
package com.tangzq.common;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import java.io.IOException;
import java.io... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.