text stringlengths 184 4.48M |
|---|
from django import forms
from django.contrib.auth import get_user_model, authenticate
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm
User = get_user_model()
class CustomUserCreationForm(UserCreationForm):
class Meta:
model = User
fields = ('email', 'username', 'passwor... |
<?php
/**
* Starterscores functions and definitions.
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package Starterscores
*/
if ( ! function_exists( 'starterscores_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this ... |
package com.jp.preauth.config;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springfr... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
/**
* 面向对象有三大特性:封装/继承/多态
* 继承:1.减少重复代码; 2.多态的前提(鸭子类型)
*/
class Person {
... |
import React, {useState, useEffect} from 'react';
import { useNavigate } from "react-router-dom";
import Container from '../Container';
import Title from '../Title';
import FormInput from '../forms/FormInput';
import SubmitButton from '../forms/SubmitButton';
import CustomLink from '../CustomLink';
import {themeFormCla... |
import Head from 'next/head'
import Image from 'next/image'
import { useEffect, useState } from 'react'
import { client, getProfileFromAddress } from '../lib/lensApi/api'
import { useAppState, useConnectWallet } from '@web3-onboard/react'
import { ProfileFieldsFragment } from '../lib/lensApi/generated'
import { BigNumb... |
const ReactPDF = require("@react-pdf/renderer");
const React = require("react");
const styles = require("./pdfStyles");
const parseStoreInfo = require("./storeNameSplitter");
const PDF = ({ data }) => {
/* reverse the order of the data array */
data.reverse();
const pages = [];
/* loops over each object in d... |
/* eslint-disable @next/next/no-img-element */
import { useEffect, useRef, useState } from 'react';
import getRawBody from 'raw-body';
import { useRouter } from 'next/router';
import { useTranslation } from 'next-i18next';
import type { OIDCSSORecord, ProductConfig, SAMLSSORecord } from '@boxyhq/saml-jackson';
import t... |
package org.platanus.platachat.web.chat.rest;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.platanus.platachat.web.auth.argumentresolver.HasMember;
import org.platanus.platachat.web.auth.dto.SessionMemberDto;
import org.platanus.platachat.web.constants.RoomConstant;
import org.pla... |
package com.mystudy.am03_score;
class ScoreVO {
//필드(속성)
private String name;
private int kor;
private int eng;
private int math;
private int tot;
private double avg;
//생성자
public ScoreVO() {}
public ScoreVO(String name, int kor, int eng, int math) {
this.name = name;
this.kor = kor;
this.eng = eng;... |
import type { LinkProps } from '@stoplight/mosaic';
import React from 'react';
import { HashLink } from 'react-router-hash-link';
const externalRegex = new RegExp('^(?:[a-z]+:)?//', 'i');
export const ReactRouterMarkdownLink = ({
title,
to,
href: _href,
children,
}: Omit<LinkProps, 'target' | 'rel'> & { to?: ... |
(* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010
Free Software Foundation, Inc. *)
(* This file is part of GNU Modula-2.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as publi... |
---
description: >-
My lecture notes on Linux Essentials (LPI) and Some System Administration
(partitioning, RAID, LVM, DHCP, DNS, DDNS, Apache, etc.). The content is
mostly in English, but some parts may be in German.
cover: >-
https://images.unsplash.com/photo-1640552435388-a54879e72b28?crop=entropy&cs=srgb&f... |
package edu.depauw.algorithms.details;
import java.util.AbstractList;
import java.util.Collection;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.RandomAccess;
public abstract class ArrayListDetails<E> extends AbstractList<E> implements List<E>, RandomAccess {
/**
* {@inheri... |
import { useContext, useState } from "react";
import { Link, useNavigate } from "react-router-dom";
import myContext from "../../context/myContext";
import toast from "react-hot-toast";
import { signInWithEmailAndPassword } from "firebase/auth";
import { auth, fireDB } from "../../firebase/FirebaseConfig";
import { col... |
// データの初期表示
fetch("/address").then(response => {
console.log(response);
response.json().then((data) => {
show_data(data);
});
});
// データを表示させる関数
const show_data = (data) => {
console.log(data); // 取得されたレスポンスデータをデバッグ表示
// データを表示させる
const tableBody = document.querySelector("#address-list... |
#!/usr/bin/env python3
"""returns function multip"""
from typing import Union, Callable
def make_multiplier(multiplier: float) -> Callable[[float], float]:
"""
Returns a function that multiplies a float by the specified multiplier.
Args:
multiplier (float): The constant factor to multiply by.
... |
// Declares a class of Shape with the constructor taking in a color parameter
class Shape{
constructor(color) {
this.color = color;
};
};
// Uses extends to declare a Circle class from the Shape class in order to inherit color
class Circle extends Shape{
renderShape() {
return `<circle cx="... |
import Image from "next/image";
# Airpen AI ✨
<br />
<Image
src="/images/airpen-ai/airpen-ai.png"
alt="Hello"
width="1200"
height="400"
/>
Airpen AI is a sophisticated artificial intelligence tool that is integrated into the Airpen platform to enhance the user experience and improve content creation. It is ... |
---
content_type: page
parent_title: 'Module III: Using Energy to Make Macromolecules'
parent_uid: 0bdeb870-0057-3309-f833-15b337f07f4f
title: 'Session 21: Regulation of Metabolism'
uid: cb7b5577-39a4-3a08-9c64-90a6df6bee82
---
« [Previous]({{< baseurl >}}/pages/module-iii/session-20) | [Next]({{< baseurl >}}/pages/re... |
import { useDispatch, useSelector } from "react-redux";
import { selectBasketProducts } from "../../selectors";
import { DeleteProductInBasketAction } from "../../actions";
import styled from "styled-components";
import { Button, BtnAndInputCounter } from "../../components";
import { changeFormatPrice, calculateAmount ... |
package com.example.groceryappprojectcharles.model.local.dao
import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy.REPLACE
import androidx.room.Query
import com.example.groceryappprojectcharles.model.local.entity.Cart
@Dao
interface CartDao {
@In... |
import * as React from 'react'
import {useState} from 'react'
// @ts-ignore
import avatar from '../../../assets/img/fox.webp'
// @ts-ignore
import Sprite from '../../../assets/svg/sprite.svg'
import { NavLink } from 'react-router-dom'
import {ClientType, ContactType} from '../../../types/Types'
import { SERVER_URL } fr... |
var express = require("express")
var { createHandler } = require("graphql-http/lib/use/express")
var { buildSchema } = require("graphql")
var { ruruHTML } = require("ruru/server")
//https://graphql.org/graphql-js/running-an-express-graphql-server/
// Construct a schema, using GraphQL schema language
var schema = bui... |
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2009 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 ... |
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
OnInit,
} from '@angular/core';
import { Hero } from 'models';
import { HeroService } from 'shared-data-access';
@Component({
selector: 'app-heroes',
templateUrl: './heroes.component.html',
styleUrls: ['./heroes.component.scss'],
changeDet... |
import React from 'react'
import s from './App.module.css'
import Search from '../Search/Search'
import BooksList from '../BooksList/BooksList'
import { Routes, Route, Navigate } from 'react-router-dom'
import BookDetails from '../BookDetails/BookDetails'
const App: React.FC = () => {
return (
<div classNa... |
\documentclass[a4paper,11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
% Code highligting
% \usepackage{minted}
\usepackage[outputdir=output/tex]{minted} % iom min makefile
\newenvironment{longlisting}{\captionsetup{type=listing}}{}
% \renewcommand\listoflistingscaption{K... |
package com.example.projekat_backend.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Data
@Getter
@Setter
@NoArgsConstruc... |
import axios from "axios";
import store from "@/store";
import router from "@/router";
// import { UserService } from '@/core/UserCore/Service/UserServer'
axios.defaults.withCredentials = true;
axios.defaults.headers = {
'Content-Type':'application/x-www-form-urlencoded'
// "Content-Type": "application/json;char... |
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<title>Healthy Spiders - Wyświetl pająki</title>
<link rel="stylesheet" href="/css/style_user.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
</head>
<body>
<div cla... |
import { useEffect, useState } from "react"
const MediaQuery = (query) => {
const [matches, setMatches] = useState(false)
useEffect(() => {
const mediaQuery = window.matchMedia(query)
setMatches(mediaQuery.matches)
const handler = (e) => {
setMatches(e.matches)
... |
//
// DragMapFinder.m
// UCIMobile
//
// Created by Yoon Lee on 12/13/10.
// Copyright 2010 leeyc. All rights reserved.
//
#import "DragMapFinder.h"
@implementation DragMapFinder
@synthesize mapViews;
- (void) initWithInstance:(AdditionalSchedule *) instant
{
instance = instant;
}
- (void)viewDidLoad
{
UILa... |
'''
Created on Apr 12, 2023
Utility classes and containers for 7-segment display "sprites"
@author: Pat Deegan
@copyright: Copyright (C) 2023 Pat Deegan, https://psychogenic.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as publ... |
import {
AntDesign,
Entypo,
FontAwesome5,
Ionicons,
MaterialCommunityIcons,
MaterialIcons,
Octicons,
} from "@expo/vector-icons";
import { isDeviceLarge } from "./commonFunctions";
import { type CategoryType } from "./types/commonTypes";
const categoryIconSize = isDeviceLarge() ? 26 : 16;
const iconColo... |
import { Avatar, Col, Image, Row, Space, Tooltip } from 'antd'
import { useTranslation } from 'react-i18next'
import { locationStore } from 'src/Store/commom.store'
import { useSubscription } from 'src/libs/global-state-hook'
import { currencyFormatter, pickName, timeAgo } from 'src/utils/helperFuncs'
import defaultImg... |
from django.db import models
from django.utils.translation import gettext_lazy as _
from django.core.validators import MaxValueValidator
from school_portal_app.models import User, Term, Class, Subject
# Create your models here.
#Student Models
STATUS = [
('Ongoing', 'Ongoing'),
('Graduate', 'Graduate'),
... |
const JSONdb = require('simple-json-db')
function convertTime(input) {
if (input == 0) {
return '12 AM'
} else if (input < 12) {
return `${input} AM`
} else {
return `${input == 12 ? 12 : input - 12} PM`
}
}
module.exports = (interaction) => {
const db = new JSONdb(`db/servers/${interaction.guil... |
{% import "../mixins/flash-messages.swig" as FlashMessages %}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{% block title %}{{ title|default("QET America") }}{% endblock ... |
package CCProgrammingContest.y2023;
import java.util.*;
public class A_B_Problem {
public static void main(String[] args) {
T388011();
}
private static void T388038() {
Scanner cin = new Scanner(System.in);
while (cin.hasNext()) {
String in = cin.nextLine();
}
... |
import { useState, useEffect, useContext } from 'react';
import { Link, useNavigate, useParams } from 'react-router-dom';
import { getProducts } from '../service';
import { CartContext } from '../contexts/CartContext';
function Products() {
const [products, setProducts] = useState({ errorMessage: '', data: [] });
... |
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Mail;
use App\Models\Contacts;
use App\Mail\ContactsMail;
class ContactsController extends Controll... |
// my_home_page.dart
// ednet core
// ednet cms
import 'package:ednet_cms/ednet_cms.dart';
import 'package:ednet_core/ednet_core.dart';
import 'package:ednet_one/generated/user/library/lib/user_library.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../../../gene... |
<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
Crear Ordenador
</h2>
</x-slot>
<div class="py-6">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<form method="POST" action="{{ route('ordenadores.store') }... |
import React, {useCallback, useEffect, useMemo, useState} from 'react';
import {useGameContext} from "../context/gameContext";
import {ButtonWrapper, Circle, InputWrapper, SliceWrapper} from "../styles";
import {Button} from "../components/Button";
import StatusBanner from "../components/StatusBanner";
import Slice fro... |
#include "zf_utils.h"
#include <QTextCodec>
#include "zf_core_consts.h"
#include "zf_core.h"
#include "zf_translation.h"
#include <xlsxdocument.h>
#include <xlsxworksheet.h>
#include <xlsxcell.h>
namespace zf
{
Error Utils::itemModelToCSV(const QAbstractItemModel* model, const QString& file_name, const I_DatasetVisib... |
import nltk
import pandas as pd
import re
import numpy as np
from nltk.corpus import movie_reviews
from gensim.models import Word2Vec
# Function to download NLTK resources if not already downloaded
def ensure_nltk_resources():
try:
# Check if the resource is already downloaded
movie_reviews.fileids... |
import React, { lazy } from 'react';
import { Router, Route, Switch } from 'react-router-dom';
import { ResetCSS } from '@my/ui';
import BigNumber from 'bignumber.js';
import GlobalStyle from './style/Global';
import SuspenseWithChunkError from './components/SuspenseWithChunkError';
import { ToastListener } from './con... |
#include <cmath>
#include <iostream>
#include <unordered_map>
#include <vector>
#include <string>
// Función para calcular TF
double calculateTF(int termFrequency, int totalTerms) {
return static_cast<double>(termFrequency) / totalTerms;
}
// Función para calcular IDF
double calculateIDF(int totalDocuments, int d... |
using CompanyTask.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyTask.Infrastructure.EntitiesConfig
{
public class AppUserConfig : BaseEntityConfig<AppUser>
{
public override void Configure(EntityTypeBuilder<AppUser> builde... |
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../providers/auth.dart';
import '../models/http_exception.dart';
enum AuthMode { Signup, Login }
class AuthScreen extends StatelessWidget {
static const routeName = '/auth';
@override
Widget build(Bui... |
---
title: New 20 Time-Saving Adobe Premiere Shortcuts Every Editor Should Know for 2024
date: 2024-04-29T19:37:48.688Z
updated: 2024-04-30T19:37:48.688Z
tags:
- video editing software
- video editing
categories:
- ai
- video
description: This Article Describes New 20 Time-Saving Adobe Premiere Shortcuts Ever... |
<ng-container *ngIf="{
loading: loading$ | async,
searchText: searchText$ | async,
totalCount: totalCount$ | async,
error: error$ | async,
movies: movies$ | async,
showCreateMovie: showCreateMovie$ | async
} as data">
<div *ngIf="data?.loading" class="align-center">{{labels.LOADING}}</div>
<app-snackbar... |
package com.example.huffman;
import java.util.HashMap;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Queue;
import static java.util.Objects.requireNonNull;
public class Huffman {
private Node root;
private final String text;
private Map<Character, Integer> charFrequencies;
... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
//addMethod
function addMethod(object, name, fn) {
var old = object[name];
object[name] = function () {
if (fn.length === arguments.length) ... |
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Variables</title>
<link rel="stylesheet" href="./index.css">
<link rel="stylesheet" href="../_astro/Bucles.8pTambmz.css" />
<link rel="stylesheet" hr... |
/**
* ApuJar - A useful bot for Twitch with many cool utility features.
* Copyright (C) 2024 BlockyDotJar (aka. Dominic R.)
*
* 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... |
import '@src/spa/view/pages/basketPage/basketPage.scss';
import PageView from '@src/spa/view/pages/pageView';
import { PageNames } from '@src/spa/view/pages/types';
import { CustomBasketData, CustomBasketProductData, IBasketPage } from '@src/spa/view/pages/basketPage/types';
import * as constants from '@src/spa/view/pa... |
<script setup lang="ts">
const props = withDefaults(
defineProps<{
shape?: 'straight' | 'rounded' | 'curved'
}>(),
{
shape: 'rounded',
},
)
const menu = [
{
name: 'Global',
url: '/',
icon: 'lucide:circle',
},
{
name: 'Business',
url: '/',
icon: 'lucide:briefcase',
},
{... |
# DOKUMENTASI JARKOM PRAKTIKUM 2
## ANGGOTA
| Nama | NRP |
| --------------------------- | ---------- |
| Athalla Barka Fadhil | 5027231018 |
| Jody Hezekiah Tanasa Sagala | 5027221050 |
SOAL: [PRAKTIKUM-MODUL-2](https://docs.google.com/document/d/1_fe7aJ1Yq5xQLb7NjR_BoH00GFyinYw... |
-- shell escaping
-- https://github.com/GUI/lua-shell-games/blob/master/lib/shell-games.lua#L219
-- https://github.com/python/cpython/blob/main/Lib/shlex.py#L323
-- but for now we just replace newlines
local function print_line(prefix, name)
just(io.write(prefix, " ", name:gsub("\n", "⏎"), "\n"))
end
local function p... |
package Catan;
import javax.swing.*;
/** ForcedPopup
* The ForcedPopup class is used to create JPopupMenus that the player is forced to interact with.
* The popup will not close until the closePopup function is called (which will typically only be when a menu item is selected).
*/
public class ForcedPopup exten... |
/*
* Copyright 2024 The Backstage 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 ... |
---
title: "\"[New] Decoding YouTube's Mystery A Sequential Exploration Guide for 2024\""
date: 2024-06-05T16:31:45.404Z
updated: 2024-06-06T16:31:45.404Z
tags:
- ai video
- ai youtube
categories:
- ai
- youtube
description: "\"This Article Describes [New] Decoding YouTube's Mystery: A Sequential Exploration G... |
<template>
<div class="grid grid-rows-none justify-items-center mx-auto w-full">
<div>
<div class="btn-group">
<button
class="
btn
border-green-300
hover:bg-green-400 hover:border-green-300 hover:text-white
"
@click="setSelectedCompon... |
const {
EmbedBuilder, StringSelectMenuBuilder, ActionRowBuilder
} = require("discord.js");
module.exports = {
data: {
name: "shop",
description: "Afficher le shop"
},
guildOnly: true,
disabled: false,
/**
*
* @param {Client} client
* @param {CommandInteraction} interaction
*/
run: asy... |
package fundraise;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.TextField;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transforme... |
import kotlin.math.sign
class Day9 : DaySolver(9, "Disk Fragmenter") {
override val exampleInput = "2333133121414131402".lines()
private fun String.printBlock() {
var emptyBlock = false
var blockID = 0
forEach {
print((if (emptyBlock) "." else "*").repeat(it.digitToInt()))
... |
import { Button, Drawer, Table, Typography } from 'antd';
import React from 'react';
import { useAppDispatch, useAppSelector } from '../../slice';
import { GetTeamAction } from '../../slice/team';
import { Manager } from '../../types/teams';
import { NewTeamForm } from '../../component/forms/newTeam';
export const Tea... |
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import ForeignKey, Column, Integer, String, Date, LargeBinary
from sqlalchemy.orm import relationship
db = SQLAlchemy()
############################ DATABASE ################################
class Session(db.Model):
__tablename__ = 'users_sessio... |
package com.katalon_demo_cura.tasks;
import com.katalon_demo_cura.utils.UrlPage;
import net.serenitybdd.core.pages.PageObject;
import net.serenitybdd.screenplay.Actor;
import net.serenitybdd.screenplay.Task;
import net.serenitybdd.screenplay.Tasks;
import net.serenitybdd.screenplay.actions.Open;
import net.thucydides.... |
defmodule Mix.Tasks.Aoc2024.Day4 do
@moduledoc """
Documentation for Advent of Code 2024 Day4.
"""
use Mix.Task
def run(_) do
p1 = part1() |> IO.inspect(label: "Part 1")
p2 = "" # part2() |> IO.inspect(label: "Part 2")
[p1, p2]
end
@doc """
Solve Day4 part 1 stuff.
## Examples
ie... |
# Neural Networks Training
## Graded Quiz
### Question 1
Here is some code that you saw in the lecture:

```python
model.compile(loss=BinaryCrossentropy())
```
For which type of task would you use the binary cross entropy loss function?
- Bin... |
import { useEffect, useState } from 'react';
import { Route, Routes, useLocation } from 'react-router-dom';
import Loader from './common/Loader';
import PageTitle from './components/PageTitle';
import SignIn from './pages/Authentication/SignIn';
import SignUp from './pages/Authentication/SignUp';
import Calendar from ... |
"""
URL configuration for maintenance_job project.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, na... |
import {
MigrationInterface,
QueryRunner,
TableColumn,
TableForeignKey,
} from 'typeorm';
export default class AddCategoryIdToTransaction1600847200431
implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.addColumn(
'transactions',
new ... |
<?php
namespace backend\controllers;
use common\models\LoginForm;
use Yii;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;
use yii\web\Controller;
use yii\web\Response;
/**
* SignIn controller
*/
class SignInController extends Controller
{
public $defaultAction = 'login';
public function behavi... |
use async_once_cell::OnceCell;
use core::hash::{Hash, Hasher};
use url::Url;
use super::HelixAuth;
use crate::prelude::*;
const USER_API: &str = "https://api.twitch.tv/helix/users";
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum UserType {
Admin,
G... |
declare namespace java {
namespace rmi {
namespace server {
/**
* An <code>ServerNotActiveException</code> is an <code>Exception</code>
* thrown during a call to <code>RemoteServer.getClientHost</code> if
* the getClientHost method is called outside of serv... |
import { MdMoreTime } from 'react-icons/md';
type GetOlderMessagesButtonProps = {
handleFetchChatMessages: (messageScope?: 'all' | 'latest') => Promise<void>;
isSubmitting: boolean;
};
/**
* GetOlderMessagesButton component for triggering the fetch of older chat messages.
*
* @component
* @param {GetOlder... |
const { PhotoManager } = require('../dao');
const photoManager = new PhotoManager();
const { isValidObjectId, isValidURL } = require('../functions/validationPhotos.js');
const createPhoto = async (req, res) => {
try {
const { url } = req.body;
if (!isValidURL(url)) {
res
.status(400)
.json({ error: 'El... |
public class QuickSort {
public static void quickSort(int arr[], int low, int high) {
if (low < high) {
int pi = partition(arr, low, high);
quickSort(arr, low, pi - 1);
quickSort(arr, pi + 1, high);
}
}
public static int partition(int[] arr, int low, int h... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>Coming Soon | Triangle</title>
<link href="/resources/css/bootstrap.min.css" rel="styl... |
import Puzzle from '../../types/AbstractPuzzle';
type Node = {
value: number;
key: number;
prev?: Node;
next?: Node;
index?: number;
decryptedValue?: number;
};
class List {
private head: Node;
// private tail: Node;
private size: number;
constructor() {
this.size = 0;
}
public pushBack(... |
require 'active_support'
require 'active_support/core_ext'
require 'active_support/inflector'
require 'erb'
require_relative './session'
require 'byebug'
class ControllerBase
attr_reader :req, :res, :params
# Setup the controller
def initialize(req, res, route_params = {})
@req = req
@res = res
@alr... |
# dictionary comprehension allows us to create a new dictionary from the values in a list or dictionary
# general structure (from a list):
new_dict = {new_key: new_value for item in list}
# creating a new dictionary from values in an existing dictionary:
new_dict = {new_key: new_value for (key, value) in dict.items()}... |
import { Route } from '@/types';
import { getCurrentPath } from '@/utils/helpers';
const __dirname = getCurrentPath(import.meta.url);
import got from '@/utils/got';
import { load } from 'cheerio';
import { art } from '@/utils/render';
import * as path from 'node:path';
const baseUrl = 'https://www.mindmeister.com';
e... |
<p>你好,我是炒炒。</p><p>在上一个模块的课程中,我们完成了一整套的体验量化的课程学习。</p><p>我们从设计师的能力水平、设计需求优先级、设计创意、设计价值、设计方案的验证、产品体验的评估、不同产品阶段的设计、设计师的成长八个角度出发,都加以了量化。</p><p>从今天开始,我们来讨论<strong>一些设计师的进阶话题</strong>,比如说,什么样的设计流程才最高效。在开始这个话题之前,我先跟你分享一个我们团队里面发生过的小故事。</p><p>有一次,我们接到一个很紧急的需求,业务追在屁股后面要设计稿。因为着急,接这个需求的设计师做完设计稿后,没有经过组内的设计内审,就直接召开了业务和技术的外部评审会议。</p><... |
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import { HomeComponent } from './components/home/home.component';
import { LoginComponent } from './components/login/login.component';
import { NuevaExperienciaComponent } fr... |
import 'package:intl/intl.dart';
import 'package:json_annotation/json_annotation.dart';
part 'models.g.dart';
final _releaseDateFormat = new DateFormat('yyyy-MM-dd');
DateTime _releaseDateFromJson(String date) =>
date.isEmpty ? null : _releaseDateFormat.parse(date);
String _releaseDateToJson(DateTime date) =>
... |
package user
import (
"context"
"github.com/Amore14rn/888Starz_test/internal/domain/user/model"
"github.com/Amore14rn/888Starz_test/internal/domain/user/service"
"github.com/Amore14rn/888Starz_test/pkg/common/core/clock"
"github.com/Amore14rn/888Starz_test/pkg/errors"
"time"
)
type IdentityGenerator interface {... |
/*
* Copyright (C) 2018-2021 Rerrah
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publ... |
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2023 Robin Appelman <robin@icewind.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the F... |
# 数据操作
为了能够完成各种数据操作,我们需要某种方法来存储和操作数据。通常包括两件重要的事:
获取数据 和 数据计算。
## 创建数据及数据运算
tensor 初始化可以利用相关函数,例如`torch.ones()`、 `torch.zeros()`、`torch.randn()`
查看tensor的形状有以下几种方法:
```pytorch
x = torch.arange(12)
print(x.shape)
print(x.size())
# 输出tensor 元素的总数
print(x.numel())
```
数据运算一般是按元素进行运算,包括加、减、乘、除以及幂运算等等。
### 不同对象... |
import React, { useState, useEffect } from "react";
import PrimaryButton from "./PrimaryButton";
import SecondaryButton from "./SecondaryButton";
import ThirdButton from "./ThirdButton";
import { Link } from "react-scroll";
import { useNavigate } from "react-router-dom";
const links = [
{ id: "home", text: "HOME" ... |
'use client'
import { useState, useEffect, useRef } from 'react'
const ComponentVisible = (initialIsVisible: boolean) => {
const [isVisible, setIsVisible] = useState(initialIsVisible)
const ref = useRef<HTMLElement>(null)
const handleClickOutside = (event: MouseEvent | TouchEvent) => {
if (ref.current && !r... |
import React from 'react'
import styled from '@emotion/styled'
//import { colors } from '@configs/styles/config'
import { Progress } from '@nextui-org/react'
type Props = {
withPercentage?: boolean
value: number //percentages loaded
height?: string
width?: string
percentOnLeft?: boolean //if true show percen... |
<script setup lang="ts">
</script>
<template>
<div id="app">
<div
v-for="flower in flowers" class="flower"
:style="{'bottom': flower.bottom, 'left': flower.left }"
>
<div class="wiggle-wrapper">
{{ flower.type }}
</div>
</div>
<div class="body" v-if="auth">
<n... |
import React from 'react';
// import { Bar } from 'react-chartjs-2';
// // import { Bar } from 'react-chartjs-2'
import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer } from 'recharts';
import useAstra from '../../hooks/useAstra';
import useCham from '../../hooks/useCham';
import u... |
// import { setBlockTracking } from "vue";
import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
import { getAuth, onAuthStateChanged } from "firebase/auth";
import Home from "../views/Home.vue";
const routes: Array<RouteRecordRaw> = [
{
path: "/",
name: "Home",
component: Home,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.