text stringlengths 184 4.48M |
|---|
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:first_test/constants/routes.dart';
import 'package:first_test/pop_ups.dart';
import 'package:first_test/services/auth/auth_exceptions.dart';
import 'package:first_test/services/firebase_auth_provider.da... |
package control
import (
"fmt"
)
type Student struct {
FirstName string
LastName string
}
type IntSlice []int
type Speaker interface {
Speak() string
run() string
}
type Dog struct {
Name string
}
type Man struct {
Name string
}
func (d Dog) Speak() string {
return "Woof!"
}
func (d Dog) run() string {
... |
namespace youtube_dl_gui_updater;
using System.Diagnostics;
using System.IO;
using System.Security.Cryptography;
using System.Threading.Tasks;
using System.Windows.Forms;
using murrty.controls;
internal partial class frmUpdater : Form {
private const int MaxRetries = 5;
private const int RetryDelay = 1_000;
... |
<?php
namespace App\Lib\CurrencyDataProvider;
use App\Constants\Status;
use App\Events\MarketDataEvent;
use App\Lib\CurlRequest;
use App\Models\Currency;
use App\Models\CurrencyDataProvider as CurrencyDataProviderModel;
use App\Models\MarketData;
use Exception;
class CoinmarketCap extends CurrencyDataProvider
{
... |
#how many employees are there
SELECT
COUNT(emp_no)
FROM
employees;
#how many unique first names
SELECT
COUNT(DISTINCT first_name)
FROM
employees;
#eldest person in the database
SELECT
MIN(birth_date)
FROM
employees;
#youngest person
SELECT
MAX(birth_date)
FROM
... |
import {IsNotEmpty, IsNumber, IsString, Length, Min } from "class-validator";
export class CalculateExchangeDto {
@IsString({message:'La moneda origen debe ser un string'})
@IsNotEmpty({message:'La moneda origen es requerido'})
@Length(3, 3,{message:'Solo se permite 3 carácteres'})
moneda_origen:string... |
## 1 \*\* Enzyme testing front-end with redux
import { mount } from 'enzyme';
import configureMockStore from 'redux-mock-store';
## 2 \*\* mocking
const reactRedux = jest.mock('react-redux', () => ({
useDispatch: jest.fn(),
useSelector: jest.fn()
},
}));
const useStatespy = jest.spyOn(React, 'useState');
expect(spy... |
def gen_fun1(my_list):
for name in my_list:
yield "_______"
yield "Name:"
yield name
yield " "
""" Run:
for i in gen_fun1(names):
print(i)
"""
def rev_str(my_str):
length = len(my_str)
for i in range(length - 1, -1, -1):
yield my_str[i]
... |
import { useState } from "react";
import { connect } from "react-redux";
import { handleAddTweet } from "../actions/tweets";
const NewTweet = ({dispatch, id}) => {
const [text, setText] = useState("");
const handleChange = (e) => {
const text = e.target.value;
setText(text);
};
const handleSubmit = ... |
import { credentials } from '../support/credentials';
export class LoginPage {
URL = '';
visit(): this {
cy.visit(this.URL);
return this;
}
fillUsernameInput(username: string): this {
cy.get('input[id="user-name"]').should('be.visible').type(username);
return this;
}
fillPasswordInput(password: string... |
package stepDefinitions;
import java.util.Map;
import java.util.Properties;
import org.junit.Assert;
import org.openqa.selenium.WebDriver;
import Factory.BaseClass;
import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import io.cucumber.datatable.DataTable;
import pageO... |
import React, { useEffect, useState } from 'react';
import '../App.css';
export default function AppStats() {
const [isLoaded, setIsLoaded] = useState(false);
const [stats, setStats] = useState({});
const [error, setError] = useState(null);
const getStats = () => {
const url = `http://acit3855... |
import UIKit
import SnapKit
final class NewsViewController : UIViewController {
private let newsViewModel: NewsViewModel
private lazy var tableView: UITableView = {
let tableView = UITableView()
tableView.delegate = self
tableView.dataSource = self
ta... |
import PropTypes from "prop-types";
import {
WrapperContainerWBckg,
StyledResponsiveContainer,
Title,
RenderLegendStyled,
} from "./style";
import { getScaledValue } from "./utils";
import { RadialBarChart, RadialBar } from "recharts";
import colors from "../../utils/colors";
/**
* Display the User Score in ... |
import React, {useEffect, useState} from 'react';
import {Button, Card, message, Table, Typography} from "antd";
import {getColumns, ITableDataType} from "./tableProps";
import {ILevelForm} from "../../types/forms";
import LevelApi from "../../api/level-api";
import LevelModal from "../../components/LevelModal/LevelMod... |
using CLASSES_HERENCIA_i_POLIMORFISME;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DAM_HERENCIA_i_POLIMORFISME_2.CLASSES
{
public class ClTriangle: ClPoligons
{
private i... |
Question 1
'let' and "const" when we are declaring variables in javascript.
The 'let' keyword is used for variables that can be reassigned.
However,variables that are declared by the "let" keyword can be re-assigned which of course allows variables for alteration.
"const" creates "constant" variables that cannot be... |
import React, { useEffect, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { getData } from '../../redux/actions/Store';
import Header from '../components/Header';
import axios from 'axios';
import { Link } from 'react-router-dom';
import Footer from '../components/Footer';
cons... |
import { useForm } from "react-hook-form";
import { Link, useNavigate } from "react-router-dom";
import { userSchema } from "../utils/validation";
import { zodResolver } from "@hookform/resolvers/zod";
import { z } from "zod";
import { useRegisterUser } from "../react-query/queries";
import toast from "react-hot-toast"... |
package com.design.factory.factorymethod.pizzastore.order;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import com.design.factory.factorymethod.pizzastore.pizza.Pizza;
public abstract class OrderPizza {
abstract Pizza createPizza(String orderType);
//订购披萨
public void setFactory(){
Pizza ... |
// flex
@mixin flex-middle() {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
@mixin flex-column() {
display: flex;
flex-direction: column;
}
@mixin flex-column-center() {
display: flex;
flex-direction: column;
align-items: center;
}
@mixin... |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>LinkedIn</title>
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="styles... |
/******************************************************************************
*
* Author: Masa Prodanovic
* Copyright (c) 2009, The University of Texas at Austin. All rights reserved.
*
******************************************************************************/
#include <arpa/inet.h>
#define LENGTH 8... |
package myCat.cat.controller;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import myCat.cat.domain.User;
import myCat.cat.domain.UserRole;
import javax.validation.constraints.NotEmpty;
import java.time.LocalDateTime;
@Getter
@Setter
@NoArgsConstructor
public class UserForm {
@Not... |
+++
title = '基环树'
date = 2021-11-16T15:38:25+08:00
draft = false
categories = ['算法']
tags = ['', '']
+++
## 定义
基环树指的是一个 $n$ 个节点,$n$ 条边的联通图。
叫基环树的原因是:给定一棵树,在这棵树上加上 **任意一条边**,就可以形成一个基环树了。
基环树的性质很优秀,比如:
1. 去掉环上的任意一条边,就可以转化为一棵树。
2. 基环树可以看作一个环上挂了很多棵子树,如果将环缩成一个点,那么得到的就是一棵树。
所以基环树的常用套路有:
1. 找环,然后删掉环上的任意一条边 $(u,v)$,对 $u... |
use std::fs;
fn main() {
let input = fs::read_to_string("input.txt").unwrap();
let height = input.lines().count();
let width = input.lines().next().unwrap().chars().count();
let image = Image::new(height, width, &input);
let empty_cols = image
.cols()
.enumerate()
.filter_... |
package com.raw.scraper.service;
import com.raw.scraper.constant.NepalState;
import com.raw.scraper.model.GetRollRequest;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
import org.springframework.web.reactive.function.BodyInserters... |
<!DOCTYPE html>
<html lang="ko">
<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>Animation</title>
<style>
*{margin: 0; padding: 0;}
.box{
width: 300px;
... |
//package LoginScenario;
//
//import org.openqa.selenium.WebDriver;
//import org.openqa.selenium.WebElement;
//import org.openqa.selenium.support.FindBy;
//import org.openqa.selenium.support.PageFactory;
//
//public class NaukriHomepage {
//
// WebDriver driver;
//
// @FindBy(xpath = "//img[@alt='naukri user profile ... |
<?php
// URL Shortener prototype
// --------------------------------------------------------------------------
// Database Connection
// --------------------------------------------------------------------------
require_once('../config/db_info.php') ;
$db = new PDO("mysql:host={$db_host};dbname={$db_name}", $db_user, ... |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AutoMapper;
using GymManegmentApplication.Contracts.Infrastructures;
using GymManegmentApplication.Contracts.Presistance;
using GymManegmentApplication.DTOs.MemberDTOs.Validation;
using GymManegmen... |
<?php
namespace App\Transformers;
use App\Models\Admin;
use Flugg\Responder\Transformers\Transformer;
class AdminTransformer extends Transformer
{
/**
* List of available relations.
*
* @var string[]
*/
protected $relations = [];
/**
* List of autoloaded default relations.
... |
package com.project.credit;
import com.project.credit.card.entity.CreditCard;
import com.project.credit.card.entity.CreditCardRequest;
import com.project.credit.card.exception.CardException;
import com.project.credit.card.exception.CreditCardRequestException;
import com.project.credit.card.service.CreditCardService;
i... |
import java.util.*;
/**
* Iterative solution
*
* This solution uses the exactly same idea sol1 does, but converting it to iterative version.
* In recursive, we can modify the temp list then reset it back to make temp list clean to next loop
* But in iterative solution, we couldn't do that. So we have to copy the ... |
package com.babylon.wallet.android.data.transaction
import android.util.Log
import com.babylon.wallet.android.domain.usecases.transaction.SignRequest
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import org.junit.Assert
import org.junit.Before
import org.junit.Test
import rdx.works... |
# Copyright 2022 Sabana Technologies, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
import { createSlice, configureStore } from '@reduxjs/toolkit';
// Counter.js에서 state.counter.counter인 이유:
const initialCounterState = {
counter: 0,
isCounterVisible: true,
};
const counterSlice = createSlice({
name: 'counter',
initialState: initialCounterState,
reducers: {
increment(state) {
// we can muta... |
<!DOCTYPE html>
<html lang="pt-BR">
<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>Aula 3 - Lua</title>
<link rel="stylesheet" href="/menu/main.css">
</head>
<body>
<div id="all">
... |
<template>
<div class="story-item">
<header class="story-item__header">
<app-progressbar
v-if="loader"
:is-running="active"
:time="5000"
@loaded="$emit('change')"
/>
<div class="story-item__header__profile">
<app-avatar
class="story-item__header_... |
## 12.你是什么类型的父母?
各位朋友大家好,我是段鑫星老师。
今天我们要分享的话题是,你是什么样的父母,你是哪一种类型的父母。
其实一说这个话题,大家都会觉得这还用讲?但是实际上这个父母的分类有很多种。美国的学者通常把父母的类型分为控制型的、放任型的、溺爱型的、民主型的。那我们看看这四类,你是属于哪一类?
控制型的一个表现就是说孩子要不然是顺从型的,要不然是叛逆型的。民主型的,那么孩子表现为就是说可以表达自己的意见,但是呢我们家长要有一个监管。放任型的就是自由生长,野蛮生长。溺爱型的就是以孩子为中心。
美国的这种研究表明,就是说什么样的家庭对孩子的成长是更有利的。它追踪那些成绩优异、人格发展良好的孩子,得出的结... |
// To parse this JSON data, do
//
// final getSkillModel = getSkillModelFromJson(jsonString);
import 'dart:convert';
List<GetSkillModel> getSkillModelFromJson(String str) => List<GetSkillModel>.from(json.decode(str).map((x) => GetSkillModel.fromJson(x)));
String getSkillModelToJson(List<GetSkillModel> data) => j... |
import React, { useEffect, useState } from "react";
import { Link, useNavigate } from 'react-router-dom';
import '../componentStyle/WatchList.css'; // Import the CSS file
import Axios from 'axios';
import { AiOutlineCloseCircle } from 'react-icons/ai';
import { ToastContainer, toast } from 'react-toastify';
import 're... |
import { Request, Response } from "express";
import {userService} from "../services/UserService";
class UserController {
async create(request: Request, response: Response) {
const { name, lastName, username, email, phone, city, state,password } = request.body;
const createUserService = userS... |
import React from 'react';
import { useDispatch } from 'react-redux';
import PropTypes from 'prop-types';
import { cartActions } from '../store/cartSlice';
import './product.css';
const Product = ({
name, id, imgURL, price,
}) => {
const dispatch = useDispatch();
const addToCart = () => {
dispatch(cartActio... |
import { useState, useEffect } from "react";
import { Link, useParams } from "react-router-dom";
// Link
import ReactPlayer from "react-player";
import { fetchFromAPI } from "../utils/fetchFrom";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faCheckCircle } from "@fortawesome/free-solid-svg... |
package com.hwapow.reservior.controller;
import java.util.List;
import com.hwapow.reservior.domain.ResSenor;
import com.hwapow.reservior.service.IResSenorService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.... |
import { DbLoadSurveyResult } from "./db-load-survey-result";
import { type LoadSurveyResultRepository, type LoadSurveyByIdRepository } from "./db-load-survey-result-protocols";
import {
mockLoadSurveyByIdRepository,
mockLoadSurveyResultRepository,
mockSurveyResultModel,
throwError
} from "@/utils/tests... |
/*
* Copyright (c) 2013, Pavel Lechev
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1) Redistributions of source code must retain the above copyright notice, this list of... |
import { BearerDid } from '@web5/dids';
import type {
JwtPayload,
JwtHeaderParams,
JwkParamsEcPublic,
JwkParamsOkpPublic,
} from '@web5/crypto';
import { Convert } from '@web5/common';
import { LocalKeyManager as CryptoApi } from '@web5/crypto';
import { DidDht, DidIon, DidKey, DidJwk, DidWeb, DidResolver, ut... |
import 'dart:convert';
import 'package:flutter/cupertino.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:http/http.dart' as http;
import 'package:logger/logger.dart';
class NetworkHandler {
// String baseurl = "http://10.0.2.2:5000";
String baseurl = "https://blog-serv... |
Input format: arr1 = [1,4,7,10,12], arr2 = [2,3,6,15]
Output format : 6.00000
Explanation:
Merge both arrays. Final sorted array is [1,2,3,4,6,7,10,12,15].
We know that to find the median we find the mid element.
Since, the size of the element is odd.
By formula, the median will be at [(n+1)/2]th position of the fi... |
package com.mgvozdev.casino.service.impl;
import com.mgvozdev.casino.dto.PlayerCreateDto;
import com.mgvozdev.casino.dto.PlayerEditDto;
import com.mgvozdev.casino.dto.PlayerReadDto;
import com.mgvozdev.casino.util.ErrorMessage;
import com.mgvozdev.casino.exception.PlayerException;
import com.mgvozdev.casino.mapper.Pla... |
This is the notes for OpenAddressingLinearProbing
Here is another strategy for handling collisions we call it open
addressing with this approach we do not store values in linked list
we store them directly in a cell or slots
just like in the last lecture lets say that we have a hash table with 5 slots and we
want t... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 20 22:53:41 2024
@author: elpidabantra
"""
from moviepy.editor import VideoFileClip, TextClip, CompositeVideoClip, AudioFileClip
from pydub import AudioSegment, effects
import speech_recognition as sr
import os
from googletrans import Translator
fr... |
<script lang="ts">
import { ethers } from 'ethers';
import { onMount } from 'svelte';
const ERC20_ABI = [
{
constant: true,
inputs: [
{
name: '_owner',
type: 'address'
}
],
name: 'balanceOf',
outputs: [
{
name: 'balance',
type: 'uint256'
}
],
payable: false... |
#pragma once
#include "CoreMinimal.h"
DECLARE_DELEGATE_TwoParams(FEnumObjectBrowserDelegate, UWorld* /* InContext */, TArray<UObject*>& /* OutData */);
/**
* Represents a type of object that will be shown in browser
*/
struct OBJECTBROWSERPLUGIN_API FObjectCategoryBase : public TSharedFromThis<FObjectCategoryBase... |
### 4 team CFP simulation
# load libraries
library(tidyverse)
library(gt)
library(cfbfastR)
library(cfbplotR)
library(webshot2)
# Define teams and probabilities
teams <- c("Michigan", "Washington", "Texas", "Alabama")
probabilities <- matrix(c(NA, 0.69, 0.60, 0.52,
0.31, NA, 0.40, 0.33,
... |
//
// ContentView.swift
// ToDo
//
// Created by Pranav on 3/28/23.
//
import SwiftUI
import CoreData
struct TaskListView: View {
@Environment(\.managedObjectContext) private var viewContext
@EnvironmentObject var dateHolder: DateHolder
@State var selectedFilter = TaskFilter.NonCompleted
var... |
import React, { Suspense, useEffect, useState } from 'react';
import { useParams, NavLink, Outlet, useLocation } from 'react-router-dom';
import { getMovieDetails, BASE_IMAGE_URL } from '../../components/API/API';
import './MovieDatails.css';
import { GoBack } from '..//../components/ButtonBack/buttonBack';
const Movi... |
import Icon from "@mdi/react";
import { mdiAccountCircle } from "@mdi/js";
import { IComment } from "../../types";
import { Link } from "react-router-dom";
import formatDistance from "date-fns/formatDistance";
import { useAppDispatch, useAppSelector } from "../../hooks/useField";
import {
handleRemoveLikeComment,
h... |
<!DOCTYPE html>
<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">
<title></title>
<link rel="stylesheet" href="${cdnUrl}/exts/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="${cdn... |
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { Order } from './order.entity';
import { CreateOrderDto } from './dto/create-order.dto';
import { UpdateOrderDto } from './dto/update-order.dto';
@Injectable()
export class Ord... |
/*
* Q5. High to Low - II
Problem Description
You are given uppercase string (S) and you have to return a string that is the lower case form of S.
Uppercase strings are those which have all letters in uppercase (Example: MACHINE)
Lowercase strings are those which have all letters in lowercase (Example: machine)
Pr... |
import pytest
from sklearn.ensemble import RandomForestClassifier
from src.models.train import load_dataset, encode_labels, train_model, evaluate_model
import mlflow
def test_load_dataset():
X_train, X_test, y_train, y_test = load_dataset()
assert X_train is not None
assert X_test is not None
assert y_... |
namespace AquaShop.Models.Aquariums
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AquaShop.Models.Aquariums.Contracts;
using AquaShop.Models.Decorations.Contracts;
using AquaShop.Models.Fish.Contracts;
using AquaShop.Utilities.Messages;
... |
import { Star } from "@mui/icons-material";
import { Rating, Stack, Typography } from "@mui/material";
export const Card = ({ name, description, review, image }) => {
return (
<Stack
spacing={3}
p={4}
borderRadius={2}
border="1px solid #ffffff20"
bgcolor="#ffffff05"
alignItems... |
<?php
namespace Tests\Feature;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Http\UploadedFile;
use Tests\TestCase;
class RecipientTest extends TestCase
{
use RefreshDatabase;
public function test_file_has_not_recipient_and_200_response(): void
{
$user = ... |
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <algorithm>
// BEGIN CUT HERE
#include <iostream>
#include "cout.h"
// END CUT HERE
#include <sstream>
#include <cmath>
using namespace std;
#define sz(a) int((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define tr... |
#include <string>
#include <iostream>
#include <fstream>
using namespace std;
enum platforma { Zoom, Skype, Teams, Empty };
class Participanti
{
public:
string nume;
int grupa;
int varsta;
Participanti()
{
nume = "Anonim";
varsta = 18;
grupa = 1000;
}
};
class Videoconferinta
{
private:
const int idCon... |
function [w,u_mat,d_in_g] = selforgmapi(d,g,w,n_iter)
% diego domenzain
% Boise State University
% ---------------------------------------------------------------------------
% builds self-organizing map from:
% data points d and graph g.
% ---------
% g -> is an incidence relation, e.g. (but not limited to):
% g = gr... |
<template>
<div id="box">
<p v-ellipsis:200>{{text}}</p>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue'
function ellipsis (el, binding) {
el.style.width = (binding.arg || 100) + 'px'
el.style.whiteSpace = 'nowrap'
el.style.overflow = 'hidden';
el.style.textOverflow = 'ellipsis';... |
//
// CustomItemsList.swift
// MealJournal
//
// Created by Jim Ciaston on 9/28/22.
//
import SwiftUI
import SwiftUIX
import FirebaseFirestore
import Firebase
struct CustomItemsList: View {
@EnvironmentObject var mealEntryObj: MealEntrys
@StateObject private var foodApi = FoodApiSearch()
@ObservedObject... |
<div id="top"></div>
<!-- https://github.com/othneildrew/Best-README-Template >
<!-- PROJECT SHIELDS -->
<!--
*** I'm using markdown "reference style" links for readability.
*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).
*** See the bottom of this document for the declaration of the refer... |
/*
* hmi.c
*
* Created: Apr 2021
* Author: Arjan te Marvelde
*
* This file contains the HMI driver, processing user inputs.
* It will also do the logic behind these, and write feedback to the display.
*
* The 4 auxiliary buttons have the following functions:
* GP6 - Enter, confirm : Used to select menu items... |
import java.util.Comparator;
import java.util.Arrays;
class Person {
String firstName;
String lastName;
int age;
Person(String firstName, String lastName, int age) {
this.firstName = firstName;
this.lastName = lastName;
this.age = age;
}
@Override
public String toS... |
import { ChangeEvent, useState } from "react";
import { useQuery } from "react-query";
import { HotelCardType } from "../../../backend/src/shared/types";
import * as apiClient from "../api-client";
import HotelResultCard from "../components/HotelResultCard";
import SortOptions from "../components/SortOptions";
import F... |
import { Injectable } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { StepDialogComponent } from '../components/step-dialog/step-dialog.component';
import { StepDialogData } from '../components/step-dialog/step-dialog.interface';
import { OperationMode } from '../components/step/ste... |
import React, {MouseEventHandler} from "react"
/**
* TopBar.
*/
type TopBar = {
label : string
backCta? : string
backLink? : string
forwardCta? : string
forwardLink? : string
doBackAction? : MouseEventHandler<HTMLButtonElement>
doForwardAction?: MouseEventHandler<HTMLBut... |
import type { Meta, StoryObj } from "@storybook/react";
import ProfileDiariesList from "./ProfileDiariesList";
const meta: Meta<typeof ProfileDiariesList> = {
title: "Organisms/ProfileDiariesList",
component: ProfileDiariesList,
parameters: {
layout: "centered",
nextjs: {
appDirectory: true,
},... |
from shutil import which
from os.path import exists, isdir
from os import mkdir, path, chdir, scandir
from subprocess import run
import argparse
dry_run = False
def is_empty(dir_name: str) -> bool:
"""
Returns True if the directory exists and contains item(s) else False
"""
try:
if any(scandi... |
package com.bluepig.alarm.ui.media.music
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.bluepig.alarm.domain.entity.music.MusicInfo
import com.bluepig.alarm.domain.result.resultLoading
import com.bluepig.alarm.domain.usecase.SearchFile
import dagger.hilt.android.lifecycle.HiltV... |
const Web3= require('web3')
//transcation crafting dependency
const Tx= require('ethereumjs-tx').Transaction
require('dotenv').config()
// loading my environment variables
infuraToken = process.env.INFURA_TOKEN
contractAddress=process.env.CONTRACT_ADDRESS
ownerAddress=process.env.OWNER_ADDRESS
privateKey=Buffer.fro... |
/*
* Copyright 2023 Palantir Technologies, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... |
<?php
use App\Http\Controllers\AbsensiController;
use App\Http\Controllers\DataPendudukController;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is w... |
import pandas as pd
import networkx as nx
import pickle
import numpy as np
train_data = pd.read_csv(r'/Users/hiteshchowdarysuryadevara/Downloads/champs-scalar-coupling/train.csv')
test_data = pd.read_csv(r'/Users/hiteshchowdarysuryadevara/Downloads/champs-scalar-coupling/test.csv')
structures = pd.read_csv(r'/Users/h... |
import classNames from "classnames";
type Color = "red" | "green" | "indigo" | "blue" | "gray";
export const Badge: React.FC<{
text: string;
color: Color;
className?: string;
}> = ({ text, color, className }) => {
return (
<>
{color === "green" && (
<span
className={
"i... |
-- Minesweeper Milestone 2
-- 4x4 Grid of Cells
-- Cell ( row , column )
type Cell = (Int,Int)
-- S [Robot's position] [List of Postions of Mines]
-- [The parent state is the last state the robot was in before doing the last performed action]
data MyState = Null | S Cell [Cell] String MyState deriving (Show,Ord... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>编写位置</title>
<!-- 可以将js代码编写到外部js文件中,然后通过script标签引入
写到外部文件中可以在不同的页面中同时引用,也可以利用到浏览器的缓存机制,推荐使用方式 -->
<script type="text/javascript" src="js/script.js">... |
import { Scene, SequenceElement } from '../../../../scene/scene';
import { PlaceOfActionProvider } from './placeOfAction.provider';
import { DescriptionProvider } from './descriptionProvider';
import { Section } from './section';
import { TestProvider } from './test.provider';
import { PlaceOfAction } from '../../../..... |
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAdopterPetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('adopterPets... |
package com.app.main.Filters;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServlet... |
package tengblogging.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
/**
*
... |
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later v... |
import brownie
from brownie import *
def test_minter_deployed(minter):
assert hasattr(minter, "mint")
def test_token_balance_updates_on_mint(token, minter, accounts):
quantity = 10 ** 18
init_bal = token.balanceOf(accounts[0])
minter.mint(quantity, {"from": accounts[0]})
assert token.balanceOf(... |
<p-toast position="top-right" key="emailResponse"></p-toast>
<h1> {{contactMe}}</h1>
<hr>
<form [formGroup]="myForm" (ngSubmit)="sendEmail()" class="mb-5">
<!-- Name -->
<div class="mb-3 row">
<label class="col-sm-3 col-form-label">{{name}}</label>
<div class="col-sm-9">
<input type="text" class="fo... |
# TODO 递归函数
# 在函数内部,可以调用其他函数。如果一个函数在内部调用自身本身,这个函数就是递归函数。
# 举个例子,我们来计算阶乘n! = 1 x 2 x 3 x ... x n,用函数fact(n)表示,可以看出:
# fact(n)=n!=1×2×3×⋅⋅⋅×(n−1)×n=(n−1)!×n=fact(n−1)×n
# 所以,fact(n)可以表示为n x fact(n-1),只有n=1时需要特殊处理。
# 于是,fact(n)用递归的方式写出来就是:
def fact(n):
if n == 1:
return 1
return n * fact(n - 1)
print(fac... |
import React, { memo, useEffect, useMemo, useState } from 'react';
import {
StyleSheet,
Text,
View,
ActivityIndicator,
FlatList,
} from 'react-native';
import { Colors } from '../constants';
import { wp } from '../utils/Responsive_layout';
import { MaterialCommunityIcons } from '@expo/vector-icons';
import Writer ... |
import { Field, InputType, Int } from '@nestjs/graphql';
import { IsDefined, IsInt, IsNotEmpty, IsNumber, IsString } from 'class-validator';
/* 문항 생성 DTO */
@InputType()
export class CreateQuestion {
@Field()
@IsNotEmpty({ message: '문항번호는 숫자로만 가능합니다.' })
@IsNumber()
question_number: number;
@Field()
@IsNo... |
// import React from 'react'
// import { Routes, Route } from "react-router-dom"
// import MainLayout from '../Components/MainLayout'
// import HomePage from './Pages/HomePage'
// import ReservationPage from './Pages/ReservatonPage'
// export default function App() {
// return (
// <div>
// <Routes>
// ... |
import 'dart:convert';
import 'package:coodesh/failures.dart';
import 'package:coodesh/modules/list/data/list_file_data_source.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
setUpAll(() {
WidgetsFlutterBinding... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.