text stringlengths 184 4.48M |
|---|
from random import choice
import re
import json # import json
import requests # import requests
class Bank: # two lines need(PEP8: E302)
colours = ['red', 'blue'] # Missing space after ','
animals = ['dog', 'cat'] # Missing space after ','
topic_names = ['Colours', 'Animals'] # Missing space after '... |
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you... |
import TextField from "@mui/material/TextField";
import { GitHub } from "@mui/icons-material";
import FormControl from "@mui/material/FormControl";
import { useState } from "react";
import Box from "@mui/material/Box";
import GitHubTable from "./GitHubTable";
import { LoadingButton } from "@mui/lab";
import { Typograph... |
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddOwnerIdToVenuesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('venues', fu... |
Script started on Mon 06 Mar 2017 03:04:25 PM EST
liu1ee@alpha:~/workspace/AdvancedSystemProgramming/labs/lab7$ gcc -o lab7 lab7.c
liu1ee@alpha:~/workspace/AdvancedSystemProgramming/labs/lab7$ ./lab7 5 8
keyboard event CTRL-C and CTRL-Z were ignored.
I am the parent with pid 14035, start to wait the child 14036
I am t... |
import { Button } from "@material-ui/core";
import { DataGrid } from "@material-ui/data-grid";
import React, { useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";
import { Link } from "react-router-dom";
import Loader from "../Layout/Loader";
import { getAllOrdersOfShop } from "../../redux... |
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using SSHConfigurator.Extensions;
namespace SSHConfigurator
{
/// <summary>... |
---
title: 7주차 강의 복습
categories: [멋쟁이사자처럼, 강의 복습]
tags: [Spring]
pin: false
math: false
mermaid: false
---
<style>s{text-decoration: none;background: #ffd00066;border-radius: 4px;padding: 2px;}</style>
## Spring Security
* <s>스프링 기반 애플리케이션의 인증과 권한을 담당하는 하위 프레임워크</s>
* 관리자 및 사용자 계정 추가, 권한 추가, DB 연동이 복잡하다는 문제점이 있음
* `b... |
<!DOCTYPE html>
<!--
This is the first test html website while DJ is starting to learn HTML
-->
<html>
<head>
<meta charset= "UTF-8" >
<meta name="description" content="DJ's Thank you Page">
<meta name="author" content="Dylan Jude Bautista">
<meta name="keywords" content= "... |
import { CardItem } from './CardItem.component';
interface Props {
items: IProspect[];
name: string;
color: string;
isDragging: boolean;
handleDragging: (dragging: boolean) => void;
handleUpdateList: (id: number, status: string) => void;
}
export const ContainerCards = ({ items = [], name, color, isDraggi... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GPS Access with Flask</title>
</head>
<body>
<h1>GPS Access with Flask</h1>
<div id = "details"></div>
<script>
var reqcount = 0;
navigator... |
import { z } from "zod";
import { getYear } from "@/utils/getYear";
import DOMPurify from "isomorphic-dompurify";
export const reviewListSchema = z.array(
z.object({
id: z.string(),
movieId: z.number(),
title: z.string(),
description: z.string(),
rating: z.number(),
user: z.object({
id:... |
package com.jintin.bundle.key
import io.mockk.every
import io.mockk.verify
import org.junit.Before
import org.junit.Test
class BooleanArrayKeyTest : BaseKeyTest() {
private val key = BooleanArrayKey("Test")
private val expect = BooleanArray(2)
@Before
fun setup() {
every { bundle.getBooleanAr... |
import { Sequelize } from 'sequelize';
import { CacheStats } from '../types';
import { SyPersistMixin } from './mixins/SyPersistMixin';
import { SyLogger } from '../../logging/SyLogger';
/**
* @todo persist mixin in clients, so the proper cache can be passed?
*/
export abstract class SyBaseCache<T> {
public cache... |
import { View, ScrollView, Image, TouchableOpacity } from 'react-native'
import React, { useEffect, useState } from 'react'
import { colors, defaultStyle } from '../../styles/styles'
import Header from '../../components/Header'
import PageHeading from '../../components/PageHeading'
import ImageCard from '../../componen... |
import { render, screen } from '@testing-library/react';
import { getPeople } from './api/people';
import App from './App';
import data from './data.json';
test('It should show a six characters of the list from API', async () => {
const list = await getPeople();
console.log("Running test async...");
expect... |
---
title: "Top 10 iPhone Lens Capabilities in iOS 11 for 2024"
date: 2024-06-04T10:18:19.287Z
updated: 2024-06-05T10:18:19.287Z
tags:
- screen-recording
- ai video
- ai audio
- ai auto
categories:
- ai
- screen
description: "This Article Describes Top 10 iPhone Lens Capabilities in iOS 11 for 2024"
excer... |
import React, { useContext } from "react";
import { IoTrashBin, IoThumbsUp, IoPencil, IoClipboardSharp } from "react-icons/io5";
import { EditingVeiculoContext } from "../../context/EditingVeiculoContext";
import { FormModalContext } from "../../context/FormModalContext";
import { MovimentationContext } from "../../c... |
//
// MountedElement.swift
// SwiftAR
//
// Created by Jan Luca Siewert on 04.04.21.
//
// Based on the implementation of Tokamak
import Foundation
import Combine
class MountedElement<R: Renderer>: Hashable {
// MARK: - Initialization
/// Element is the type elements get rendered into
typealias Elemen... |
import { Address } from "@/app/staff/utils/orders";
import AddressAutoComplete from "@/components/Form/AutoCompleteInput";
import {
District,
SpecificAddress,
Ward,
getDistrictsByProvince,
getProvinces,
getWardsByDistrictAndProvince,
} from "@/libs/address";
import { removeVietnameseTones } from "@/utils/helper";... |
# cython: profile=True
##
# S. Rychkov, S. El-Showk, May-June 2013
# File contains prec_float and prec_interval classes : cython wrappers for mpfr_t and mpfi_t
# with overloaded arithmetic operations
##
# Edit by Carlos Cardona 2022
from libc.stdlib cimport malloc, free
import utils.stats as stats
def isinteger(a)... |
# global
import abc
from typing import Optional, Union
# local
import ivy
class _ArrayWithLossesExperimental(abc.ABC):
def l1_loss(
self: Union[ivy.Array, ivy.NativeArray],
target: Union[ivy.Array, ivy.NativeArray],
/,
*,
reduction: Optional[str] = "mean",
out: Opt... |
/*
* dedupv1 - iSCSI based Deduplication System for Linux
*
* (C) 2008 Dirk Meister
* (C) 2009 - 2011, Dirk Meister, Paderborn Center for Parallel Computing
* (C) 2012 Dirk Meister, Johannes Gutenberg University Mainz
*
* This file is part of dedupv1.
*
* dedupv1 is free software: you can redistribute it and/o... |
import styled from "styled-components";
import SectionHeader from "./SectionHeader";
// import useFakeFixtures from "../../hooks/fake/useFakeFixtures";
import useColor from "../../hooks/useColor";
import { mix } from "polished";
import SubTitle from "../common/SubTitle";
import Loading from "../common/Loading";
import... |
/* render.c: functions for rendering a peg solitaire game
* Copyright (C) 2018 Juhani Numminen
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* ... |
<!DOCTYPE html>
<html>
<head>
<title>Using a Function for Promises</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<body>
<script>
$(document).ready(function() {
const apple = new Image(),
orange = new Image(),
carrot = new I... |
/*
* @Author: lyf
* @Date: 2021-02-25 16:37:45
* @LastEditors: lyf
* @LastEditTime: 2021-12-13 15:07:57
* @Description: In User Settings Edit
* @FilePath: /js-css-case/src/examples-react/case3/index.tsx
*
* context
* 1. context的value值改变, 其子孙组建中 使用useContext的组建都会重新渲染(即使该组建被memo函数包裹, 即使该组建的props未改变)
* 2. 如下: co... |
const app = require("../server");
const request = require("supertest");
const authenticateToken = require("../middlewares/authenticateToken");
const { UserRepository } = require("../repositories/user.repository");
const { reportRepository } = require("../repositories/report.repository");
jest.mock("jsonwebtoken");
jest... |
<?php
declare(strict_types=1);
/*
* This file is part of the latent/el-admin.
*
* (c) latent<pltrueover@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Latent\ElAdmin\Controller;
use Illuminate\Http\JsonResponse;
use Late... |
# Inventory Management System (MERN Project)

## Introduction
Welcome to the Inventory Management System! This project is built using the MERN stack (MongoDB, Express.js, React.js, Node.js). It allows users to manage inventory by performing CRUD (Create, Read, Update, Delete) ... |
# Stable Diffusion XL for JAX + TPUv5e
[TPU v5e](https://cloud.google.com/blog/products/compute/how-cloud-tpu-v5e-accelerates-large-scale-ai-inference) is a new generation of TPUs from Google Cloud. It is the most cost-effective, versatile, and scalable Cloud TPU to date. This makes them ideal for serving and scaling ... |
#include <Seeed_Arduino_SSCMA.h>
#include <Arduino.h>
#include <ArduinoJson.h>
#include <WiFi.h>
#include <WiFiMulti.h>
#include <HTTPClient.h>
#include <WiFiClientSecure.h>
#include "certs.h"
SSCMA AI;
JsonDocument doc;
JsonDocument dataIn;
WiFiMulti WiFiMulti;
void setup() {
AI.begin();
WiFi.mode(WIFI_STA);
W... |
# Задание на практику 
# Задания лекции
1. Для заданных значений параметров несущего колебания и НЧ сигнала определите значение частоты дискретизации (в менеджере переменных), значение индекса АМ. Получите временную и спектральную диаграммы несущего колебания и НЧ сигна... |
/*
* Unless expressly otherwise stated, code from this project is licensed under the MIT license [https://opensource.org/licenses/MIT].
*
* Copyright (c) <2018> <Markus Gärtner, Volodymyr Kushnarenko, Florian Fritze, Sibylle Hermann and Uli Hahn>
*
* Permission is hereby granted, free of charge, to any person obta... |
# 将两个升序链表合并为一个新的 升序 链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。
#
#
#
# 示例:
#
# 输入:1->2->4, 1->3->4
# 输出:1->1->2->3->4->4
#
# Related Topics 链表
# 👍 1260 👎 0
# leetcode submit region begin(Prohibit modification and deletion)
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next... |
import { TECH_STACKS } from '@/constants';
import { QueryType } from '@/type';
import { Button, Form, Input, InputNumber, message, Radio, Select } from 'antd';
import dayjs from 'dayjs';
import { Dispatch, SetStateAction } from 'react';
import styles from './Sider.module.scss';
const Option = Select.Option;
export def... |
<?php
/*
* This file is part of the 'octris/core' package.
*
* (c) Harald Lapp <harald@octris.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Octris\Core\Db\Type;
/**
* Iterator for recursive iterating data objec... |
import React, {useContext, useEffect} from "react";
import {browseDisplayStrings} from "../../../resources/PublicDisplayStrings";
import {LocaleContext} from "../../../context/LocaleContext";
import {apiUrl} from "../../../helpers/Variables";
import Panel from "../../commons/elements/containers/Panel";
import ArticleCa... |
import "./product-search-bar.css";
import React, { Dispatch, SetStateAction, useState } from "react";
import ICategory from "../../models/category.model";
import IBrand from "../../models/brand.model";
export interface ProductSearchBarProps {
className?: string;
categories: ICategory[];
brands: IBrand[];
searc... |
import {inject} from 'aurelia-framework';
import {Dependency} from './dependecy';
import {Redirect} from 'aurelia-router';
@inject(Dependency)
export class App {
constructor() {
this.header = 'Navigation';
this.content = 'Page info';
console.log(Dependency);
}
updateContent() {
this.header = '... |
import React from "react";
import { Form } from "antd";
import { useMultiStepForm } from "../Hooks/useMultiStepForm";
import Styles from "../App.module.css";
import From1 from "./From1";
import From2 from "./From2";
import { useFroms } from "../Contest/FormContext";
const NewForm = ({ setOpen }) => {
const { steps, ... |
#include "Bureaucrat.hpp"
Bureaucrat::Bureaucrat(std::string name, size_t grade) : _name(name), _grade(grade)
{
if (this->_grade < 1)
throw Bureaucrat::GradeTooHighException();
if (this->_grade > 150)
throw Bureaucrat::GradeTooLowException();
}
Bureaucrat::~Bureaucrat()
{
}
Bureaucrat::Bureaucrat(const Bureau... |
if !exists('g:loaded_telescope') | finish | endif
nnoremap <silent> ff <cmd>Telescope find_files<cr>
nnoremap <silent> fr <cmd>Telescope live_grep<cr>
nnoremap <silent> \\ <cmd>Telescope buffers<cr>
nnoremap <silent> ;; <cmd>Telescope help_tags<cr>
lua << EOF
local actions = require('telescope.actions')
local fb_acti... |
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:ui="http://... |
import { Logger } from '@nestjs/common';
import { IoAdapter } from '@nestjs/platform-socket.io';
import {
ConnectedSocket,
MessageBody,
OnGatewayConnection,
OnGatewayDisconnect,
OnGatewayInit,
SubscribeMessage,
WebSocketGateway,
WebSocketServer,
} from '@nestjs/websockets';
import { Server, Socket } fro... |
<template>
<ValidationObserver v-slot="{ handleSubmit }">
<form @submit.prevent="handleSubmit(processForm)">
<div class="modal-card" style="width: 40em">
<header class="modal-card-head">
<p class="modal-card-title">
{{ currentData ? `Edit ${currentData.name}` : "Add a new Clien... |
<template>
<main>
<div class="container-elements">
<div class="mt-5">
<a v-show="searchedFilmList != 0" class="anchor" href="#film-list">FILM</a>
<a v-show="searchedSeriesList != 0" class="anchor" href="#series-list">SERIE TV</a>
</div>
... |
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import { UsersComponent } from './users/users.component';
import { PostsComponent } from './posts/posts.component';
import { DetailsComponent } from './details/details.compon... |
import numpy as np
import torch
import re
import os
import wfdb
U_INDICES = [16, 23, 24, 31]
NO_U_INDICES = [0,1,2,3,4,5,6,7,8,9,
10,11,12,13,14,15,17,
18,19,20,21,22,25,26,
27,28,29,30]
def extract_info_from_name(filename):
parsed = {}
basename = os.path.basena... |
<template>
<q-banner rounded class="bg-grey-3">
<q-img :src=coaBackground height="160px">
<div class="absolute-full text-subtitle2 flex flex-center">
name: {{ name }}
<br/>
wins: {{ nWins }}
<br/>
losses: {{ nLosses }}
<br/>
ratio: {{ ratio }}
</... |
#!/usr/bin/python3
"""Function that prints a square with # character"""
def print_square(size):
"""prints square with # character"""
if type(size) is not int:
raise TypeError("size must be an integer")
elif size < 0:
raise ValueError("size must be >= 0")
elif type(size) is float and si... |
from django.db import models
import random
import datetime
from django.contrib.auth.models import User
from django.utils import timezone
from django.core.validators import MaxValueValidator, MinValueValidator
import os
from django.conf import settings
from django.utils.safestring import mark_safe
class Publisher(mode... |
// Given a number N and a bit number K, check if Kth index bit of N is set or not. A bit is called set if it is 1. Position of set bit '1' should be indexed starting with 0 from LSB side in binary representation of the number.
// Note: Index is starting from 0. You just need to return true or false, driver code will ta... |
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter/foundation.dart';
part 'qr_scan_event.dart';
part 'qr_scan_state.dart';
class QRScanBloc extends Bloc<QRScanEvent, QRScanState> {
QRScanBloc() : super(const QRScanState()) {
on<QRScanOnDetectEvent>(_onQRScanOnDet... |
import { Box, Tooltip } from "@chakra-ui/react"
import { FC, PropsWithChildren, useEffect, useRef, useState } from "react"
import CopyToClipboard from "react-copy-to-clipboard"
import { useOnClickOutside } from "../hooks"
interface CopyTooltipProps extends PropsWithChildren {
copyValue: string
prompt?: string
m... |
import React, { useContext, useRef, useState } from "react";
import { AuthContext } from "@/context/AuthContext";
import classNames from "classnames";
import styles from '@/app/posts/postspage.module.scss';
import { db, storage } from "@/firebase/config";
import { v4 as uuid } from 'uuid';
import { Timestamp, doc, setD... |
import { type FC } from "react";
import Sidebar from "./Sidebar";
import Topbar from "./Topbar";
interface ILayoutProps {
children: React.ReactNode;
}
const Layout: FC<ILayoutProps> = ({ children }) => {
return (
<div className="min-w-screen flex relative w-full h-full bg-white">
<Sidebar />
<div... |
// Different data types and attributes example
class DataTypeAttributes extends HTMLElement {
// Return list of attributes
static get observedAttributes() {
return ['text', 'integer', 'number', 'date', 'boolean'];
}
// Callback function that the browser calls to inform the custom element that o... |
package domain;
public class Employee extends Person implements Worker, Comparable {
protected int no;
protected int year;
public Employee(int no, String firstName, String lastName) {
super(firstName, lastName);
this.no = no;
}
public Employee(int no, String firstName, String last... |
package TOML;
# -------------------------------------------------------------------
# TOML - Parser for Tom's Obvious, Minimal Language.
#
# Copyright (C) 2013 Darren Chamberlain <darren@cpan.org>
# -------------------------------------------------------------------
use 5.008005;
use strict;
use warnings;
use Exporte... |
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using MusicWebApp1.Models;
namespace MusicWebApp1.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class ArtistController : ControllerBase
{
private readonly MusicApiContext _context;
public ArtistCont... |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstclear_bonus.c :+: :+: :+: ... |
// (C) 2024 FOTEC Forschungs- und Technologietransfer GmbH
// Das Forschungsunternehmen der Fachhochschule Wiener Neustadt
//
// Kontakt biss@fotec.at / www.fotec.at
//
// Erstversion vom 15.11.2023 10:55
// Entwickler Mandl Matthias (MMa)
// Projekt IXchange
using System;
using System.Linq;
using Syst... |
import Link from "next/link"
import { Button } from "./ui/button"
import { Card } from "./ui/card"
const FeatureSection = () => {
return (
<section
id="features"
className="container py-8 space-y-6 rounded-lg md:py-12 lg:py-24"
>
<div className="mx-auto flex max-w-[58rem] flex-col items-ce... |
import User from "../models/userModel.js";
import bcrypt from "bcryptjs";
import generateToken from "../utils/jwtToken.js";
import sendEmail from "../utils/sendEmail.js";
import { sendVerificationCode } from "../utils/sendEmailSignUp.js";
import generateVerificationCode from "../utils/VerificationCode.js";
import { sen... |
import { createContext, useContext } from 'react'
import {
NOTIFICATION_TYPES,
NO_NOTIFICATION_STATE,
handleAxiosError,
NOTIFICATION_TIMEOUT,
ERROR_NOTIFICATION_TIMEOUT,
} from '@/features/notification'
/**
* The context object for the notification state.
*
* @typedef {Object} NotificationContextObject
... |
"""
https://docs.python.org/3/library/sqlite3.html
Run this as a standalone Python module.
How-to guides for further reading:
How to use placeholders to bind values in SQL queries
How to adapt custom Python types to SQLite values
How to convert SQLite values to custom Python types
... |
import { YouTrackIssue, YouTrackUser, YouTrackWorkItem } from '../types/YouTrackApi.types'
export interface YouTrackApi {
/**
* Возвращает список ранее загруженных пользователей
*/
get users(): YouTrackUser[]
/**
* Обновить список пользователей
*/
fetchUsers(): Promise<void>
/**
* Получить с... |
<html lang="en">
<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>Document</title>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
</head>
<body>
<h1... |
#pragma once
#include <memory>
#include <my_cpp_utils/json_formatter.h>
#include <spdlog/sinks/daily_file_sink.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/spdlog.h>
namespace utils
{
class Logger
{
private:
inline static std::shared_ptr<spdlog::logger>& GetSingletoneInstance()
{
s... |
package john.LOGIN_SYSTEM.forgetpassword;
import jakarta.servlet.http.HttpSession;
import john.LOGIN_SYSTEM.common.components.PasswordStrength;
import john.LOGIN_SYSTEM.common.components.VerificationCode;
import john.LOGIN_SYSTEM.common.components.email.EmailService;
import john.LOGIN_SYSTEM.common.components.email.Tr... |
import { HelmetProvider } from 'react-helmet-async';
import { Routes, Route } from 'react-router-dom';
import HistoryRouter from '../history-route/history-route';
import browserHistory from '../../browser-history';
import ScrollToTop from '../scroll-to-top/scroll-to-top';
import Main from '../../pages/main/main';
impor... |
<script>
import { writable } from 'svelte/store'
import H2 from 'components/H2/H2.svelte'
import Input from 'components/Input/Input.svelte'
import ButtonBurgerShape from 'components/ButtonBurgerShape/ButtonBurgerShape.svelte'
import RecipeCard from 'components/RecipeCard/RecipeCard.svelte'
impor... |
package com.ntumart.dipapp.api.controllers;
import com.ntumart.dipapp.api.repository.InterestRepository;
import com.ntumart.dipapp.api.service.InterestService;
import com.ntumart.dipapp.exceptions.EmptyFileException;
import com.ntumart.dipapp.exceptions.ProductNotFoundException;
import com.ntumart.dipapp.models.Intere... |
/**
* The starting point of the application.
*
* @author Eric Sundqvist
* @author Mats Loock
* @version 1.0.0
*/
import express from 'express'
import helmet from 'helmet'
import logger from 'morgan'
import { router } from './routes/router.js'
import { connectDB } from './config/mongoose.js'
try {
await connec... |
import { useState } from 'react';
import { useDispatch } from 'react-redux';
import * as productActions from '../actions/productsActions';
const AddProductForm = () => {
const [visible, setVisible] = useState(false);
const [name, setName] = useState('');
const [price, setPrice] = useState(0);
const [quantity, ... |
# IOTA
- Em uma declaração de constantes, o identificador IOTA representa números sequenciais não tipados.
```GO
package main
import "fmt"
const (
x = iota
y = iota
z = iota
)
func main() {
fmt.Println(x, y, z)
}
OUTPUT: 0, 1, 2
```
- Podemos descartar valores
````... |
"use server";
import { RegisterSchema } from "@/schemas/registerSchema";
import * as z from "zod";
import bcrypt from "bcryptjs";
import { db } from "@/lib/db";
import { getUserbyEmail } from "@/data/auth/user";
export const register = async (values:z.infer<typeof RegisterSchema>) => {
const validatedFields = ... |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../34_ERC721_en/IERC165.sol";
/**
* @dev ERC1155 standard interface contract, realizes the function of EIP1155
* See: https://eips.ethereum.org/EIPS/eip-1155[EIP].
*/
interface IERC1155 is IERC165 {
/**
* @dev single-type token transfer event... |
向通道中加入一个组织
-----------
> 原文链接:https://hyperledger-fabric.readthedocs.io/en/latest/channel_update_tutorial.html
> 提示:确保您已按照 Install Samples, Binaries and Docker Images 和 Prerequisites 文章所述下载了相应的 docker 镜像和二进制文件。特别是,您的 fabric-samples 文件夹版本必须包含 eyfn.sh 脚本(first-network 文件夹中)及其相关脚本。
本篇教程是构建第一个 fabric 网络教程的扩展,并演示向 BYFN ... |
package seq_cmd
import (
"fmt"
"strconv"
"time"
"github.com/lunfardo314/proxima/ledger"
"github.com/lunfardo314/proxima/ledger/transaction"
"github.com/lunfardo314/proxima/ledger/txbuilder"
"github.com/lunfardo314/proxima/proxi/glb"
"github.com/lunfardo314/proxima/sequencer/factory/commands"
"github.com/lunf... |
import React, { useContext, useState, useEffect, useRef } from "react";
import { useNavigate } from "react-router-dom";
import axios from "axios";
// mui
import { Stack, Typography, Grid, TextField, Button, Box, Toolbar, Paper, Autocomplete } from "@mui/material";
import LoadingButton from "@mui/lab/LoadingButton";
imp... |
/* eslint-disable @typescript-eslint/no-explicit-any */
"use client";
import dynamic from "next/dynamic";
import { FC } from "react";
const Chart = dynamic(() => import("react-apexcharts"), { ssr: false });
type TCurve =
| "smooth"
| "straight"
| "stepline"
| "smooth"
| "straight"
| "stepline";
type Props... |
/*
* Copyright (c) 2010 International Health Terminology Standards Development
* Organisation
*
* 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/LICE... |
//
// LoginViewController.swift
// CBDS Calculator
//
// Created by Zhang Sheng on 7/23/20.
// Copyright © 2020 Sheng Zhang. All rights reserved.
//
import UIKit
import FirebaseAuth
class LoginViewController: UIViewController, UITextFieldDelegate {
@IBOutlet weak var emailTextField: UITextField!
@IB... |
// 199 https://leetcode.com/problems/binary-tree-right-side-view/
/**
* Definition for a binary tree node.
* function TreeNode(val, left, right) {
* this.val = (val===undefined ? 0 : val)
* this.left = (left===undefined ? null : left)
* this.right = (right===undefined ? null : right)
* }
*/
function ... |
/// adult : false
/// gender : 0
/// id : 3234630
/// known_for_department : "Acting"
/// name : "Sangeeth Shobhan"
/// original_name : "Sangeeth Shobhan"
/// popularity : 214.068
/// profile_path : "/7Vox31bH7XmgPNJzMKGa4uGyjW8.jpg"
/// known_for : [{"adult":false,"backdrop_path":"/jBnnkkXRZ0pV3Tw31Z2ALO638wA.jpg","id... |
package me.shu.exercise.zookeeper;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.Watcher.Event.Event... |
import { useTheme } from "next-themes";
import React, { useEffect, useRef, useState } from "react";
import { IoMdAdd } from "react-icons/io";
import { GrPowerReset } from "react-icons/gr";
import { MdOutlineCancel } from "react-icons/md";
import { AiOutlineCopy } from "react-icons/ai";
import toast, { Toaster } from... |
3 # The Location Class
class Location:
# Constructor
def __init__(self, name):
self.name = name
self.power = 0
self.units = []
# ACTIONS : Sometimes even our territory values must be changed when Actions occur, we do this in these functions
# --------------------------... |
var CG = (function(CG) {
let g_width, g_x, g_y, g_z, g_x0, g_y0;
class Tetraedro{
/**
* @param {WebGLRenderingContext} gl
* @param {Number[]} color
* @param {Number} width
* @param {Matrix4} initial_transform
* Constructor de tetraedro
*/
co... |
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { HttpResponse } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { FormBuilder } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';
import { RouterTestingModule } f... |
<!DOCTYPE html>
<html>
<head>
<title>PSY9219M - Research Methods and Skills</title>
<meta charset="utf-8">
<meta name="author" content="Dr Matt Craddock" />
<link href="libs/remark-css/default.css" rel="stylesheet" />
<link href="libs/remark-css/default-fonts.css" rel="stylesheet" />
<link rel... |
<script setup>
import { ref, onMounted } from 'vue'
const DataValue = ref([]);
const isLoad = ref(true);
const LoadImg = (imgUrl) => {
const imgArr = [...imgUrl];
let i = 0;
imgArr.forEach(src => {
const img = new Image();
img.src = src;
img.o... |
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\SharedCatalog\Test\Unit\Model;
use Magento\CatalogPermissions\App\ConfigInterface;
use Magento\Framework\App\Config\ScopeConfigInterface;
/**
* Unit test for Magento\SharedCatalog\Model\Category... |
#include <iostream>
using namespace std;
class Base
{
protected:
int baseData;
public:
Base(int baseData) : baseData(baseData) { }
Base& operator= (const Base& rhs)
{
cout << "Base& operator= ()" << endl;
baseData = rhs.baseData;
return *this;
}
void Show() { cout ... |
use crate::cartridge;
use crate::cartridge::mbc1::MBC1;
use crate::cartridge::Interface;
#[test]
fn new() {
struct TestCase {
init_fn: fn() -> Vec<u8>,
}
let test_cases: Vec<TestCase> = vec![
TestCase {
init_fn: || -> Vec<u8> {
let mut cart_data: Vec<u8> = vec![... |
/*
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Installation : #
# NodeMCU ESP8266/ESP12E RFID MFRC522 / RC522 #
# D2 <---------... |
import {Action} from '@ngrx/store';
import {Visitor} from '../models/visitor.model';
import {VisitorForm} from '../models/visitor-form.model';
export const FETCH_VISITORS_SUCCESS = '[Visitor] Fetch Visitors Success';
export const FETCH_VISITORS_START = '[Visitor] Fetch Visitors Start';
export const FETCH_VISITOR_STAR... |
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('group_user', function (... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.