text stringlengths 184 4.48M |
|---|
import BasePage from "./BasePage.js"
import LoginPage from "./LoginPage.js"
import PaymentPage from "./PaymentPage.js"
class CheckoutPage extends BasePage {
constructor(page) {
super(page)
this.page = page
}
getCartInfoSection = () => this.page.locator('#cart_info')
getCartProductDescription = () => this.page.lo... |
#ifndef DENSE_ARRAY_H
#define DENSE_ARRAY_H
#include <vector>
#include <string>
#include <numeric>
#include "H5Cpp.h"
#include "utils.h"
namespace dense_array {
enum class Type {
INTEGER,
NUMBER,
STRING,
BOOLEAN
};
inline void mock(const std::filesystem::path& dir, Type type, std::vector<hsize_t> d... |
#include "display.h"
#include <WiFi.h>
#include <ArduinoJson.h>
#include <ESP32Encoder.h>
#include "OneButton.h"
#include <Fetch.h>
#include <WiFiManager.h>
void get_printer_data();
void set_status(const char * status);
void process_printer_data(String data);
void set_active_axis(char axis);
void Click(void *oneButton... |
import { act, useState } from "react";
import { handleComplete } from "./handleComplete";
import { ITodos } from "../../types/todos";
import { renderHook } from "@testing-library/react";
const useTodoList = () => {
const [todos, setTodos] = useState<ITodos[]>([
{ name: "Убраться", completed: false },
{ name:... |
<div class="container m-5">
<div class="row">
<div class="col-md-12">
<div class="card">
<h5 class="card-header bg-dark text-white">Revenue Ledger</h5>
<div class="card-body bg-light text-dark">
<h5 class="card-title">Please enter your sales be... |
---
id: reading-halogens
title: '📝 Halogens'
custom_edit_url: null
hide_table_of_contents: true
---
import ReactPlayer from 'react-player';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Frame from "@site/src/components/Frame";
<Tabs
defaultValue="worksheet"
values={[
{ label: "... |
'use client';
import React, { useRef, useState, useEffect, useMemo } from 'react';
import { useSearchParams } from 'next/navigation';
import useIsHydrating from '~/libs/hooks/useIsHydrating';
import { getTargetElement } from '~/libs/browser/dom';
import { api } from '~/services/trpc/react';
import { useWindowVirtualize... |
import { useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { useGetFilteredProductsQuery } from "../redux/api/productApiSlice";
import { useFetchCategoriesQuery } from "../redux/api/categoryApiSlice";
import {
setCategories,
setProducts,
setChecked,
} from "../redu... |
import { PrismaClient } from "@prisma/client";
import { NoteModel } from "../models/NoteModel";
const prisma = new PrismaClient();
export class SharedNotesDAL {
static async shareNote(sharedBy: string, sharedWith: string, noteId: string, sharedAt: Date): Promise<boolean> {
try {
const res = aw... |
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:link_text/link_text.dart';
import 'package:propertyapp/dashboard.dart';
import 'package:propertyapp/signup.dart';
class LoginView extends StatefulWidget {
const LoginView({super.key});
@override
State<Logi... |
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:ecomp/Pages/CheckOutPage.dart';
import 'package:ecomp/Pages/HomePage.dart';
import 'package:ecomp/main.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:flutter_number_picker/flutter_nu... |
// To parse this JSON data, do
//
// final getCharactersById = getCharactersByIdFromJson(jsonString);
import 'dart:convert';
GetCharactersById getCharactersByIdFromJson(String str) => GetCharactersById.fromJson(json.decode(str));
String getCharactersByIdToJson(GetCharactersById data) => json.encode(data.toJson()... |
import * as React from "react";
import {WithTranslation, withTranslation} from "react-i18next";
import {
HOUSE_EDGE,
HOUSE_EDGE_DIVISOR,
MAX_NUMBER_DICE_1,
MIN_BET_VALUE,
MIN_NUMBER_DICE_1,
RANGE,
} from "../../../../config/config";
import {formatEth} from "../../../../reusable/Ether";
import {... |
<a name="readme-top"></a>
<div align="center">
</div>
<!-- TABLE OF CONTENTS -->
# 📗 Table of Contents
- [📖 About the Project](#about-project)
- [🛠 Built With](#built-with)
- [Tech Stack](#tech-stack)
- [Key Features](#key-features)
- [🚀 Live Demo](#live-demo)
- [💻 Getting Started](#getting-start... |
import React, { FC } from 'react';
import useFetchData from '@/hooks/use-fetch-data';
import ImageCard2 from '@/components/ui/card/image-card2';
import SplitCard from '@/components/ui/card/split-card';
import DownloadVersionBtn from '@/components/ui/button/actions/download-version-btn';
interface Version {
version... |
"use client";
import { Button } from "@/components/ui/button";
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
} from "@/components/ui/dialog";
import Link from "next/link";
import { FaClock } from "react-icons/fa6";
import { useState } from "react";
import {
F... |
from typing import TypeVar
T = TypeVar("T")
def get_rm(d: dict, key: str, value: T) -> T:
"""사전에서 키를 가져오고 제거합니다.
Args:
`d` (`dict`): 사전.
`key` (`str`): 가져오고 제거할 키.
`value` (`T`): 키가 없을 경우 반환할 값.
Returns:
`T`: 키가 있는 경우 해당 값, 그렇지 않으면 인수로 전달된 값.
"""
ret = d.get(ke... |
package com.example.BookStore.BookStore.service.Impl;
import com.example.BookStore.BookStore.domain.Category;
import com.example.BookStore.BookStore.repository.BookRepository;
import com.example.BookStore.BookStore.repository.CategoryRepository;
import com.example.BookStore.BookStore.service.CategoryService;
import or... |
# SPDX-FileCopyrightText: 2023-2024 MTS (Mobile Telesystems)
# SPDX-License-Identifier: Apache-2.0
from fastapi import APIRouter, Depends
from fastapi.security import OAuth2PasswordRequestForm
from typing_extensions import Annotated
from horizon.backend.dependencies.stub import Stub
from horizon.backend.providers.aut... |
//
// Created by mat on 8/2/17.
//
#ifndef ROS_HEXAPOD_CONTROLLER_SIMROSCLASS_H
#define ROS_HEXAPOD_CONTROLLER_SIMROSCLASS_H
#include <cstdio>
#include <cstdlib>
#include <ros/ros.h>
#include "std_msgs/Bool.h"
#include "std_msgs/String.h"
#include "std_msgs/Float32.h"
#include <std_msgs/Int32.h>
#include "std_msgs/Mu... |
import {useState,useEffect} from 'react'
import { useNavigate } from 'react-router-dom';
import axios from '../utils/axios';
import Topnav from './partials/Topnav';
import Dropdown from './partials/Dropdown';
import InfiniteScroll from 'react-infinite-scroll-component';
import Loading from './Loading';
import Cards fro... |
<?php
namespace Database\Factories;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Driver>
*/
class DriverFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<strin... |
import React, { useState, useEffect } from 'react'
import { Link, useNavigate } from 'react-router-dom'
import { Form, Button } from 'react-bootstrap'
import { useDispatch, useSelector } from 'react-redux'
import { useTranslation } from "react-i18next"
import Message from '../../components/Message'
import Loader from '... |
import rutas from "../routes"
import { useState } from "react"
import { Link } from 'react-router-dom'
function ConditionalRender() {
const [booleano, setBooleano] = useState(false)
return (
<>
<Link to={rutas.homepage} > Ir a Homepage </Link>
<h1 onClick={() => setBooleano(!booleano)} >Este h1 si... |
import {
ActionReducerMapBuilder,
Draft,
PayloadAction,
createAsyncThunk,
} from "@reduxjs/toolkit";
import axios from "axios";
import {
CartDetailCreateDto,
CartDetailReadDto,
CartDetailUpdateDto,
} from "../../data/dto/orderAggregate/cartDetailDto";
import BaseSlice, { BaseState } from "../shared/baseS... |
import React, { ReactNode, useState } from 'react';
import classes from './ResourceContent.module.css';
import { Altinn2LinkService } from 'app-shared/types/Altinn2LinkService';
import { useTranslation } from 'react-i18next';
import { ResourceNameAndId } from 'resourceadm/components/ResourceNameAndId';
import { replace... |
Based on the provided content, here's an analysis of CVE-2004-1456:
**Root Cause of Vulnerability:**
The vulnerability stems from insufficient sanitization of user-provided input to the "rcsinfo" parameter within the `filediff` command of CVSTrac. Specifically, the application does not properly validate the tags or r... |
import * as React from "react";
import * as renderer from "react-test-renderer";
import Property from "./property";
import {Provider} from "react-redux";
import configureStore from "redux-mock-store";
import {NameSpace} from "../../reducer/name-space";
const mockStore = configureStore([]);
const offerWithPremium = {
... |
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../styles/main.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com"... |
import React, { useState } from 'react';
import { Modal, Image } from 'antd';
import Slider from 'react-slick/lib/slider';
const ImageViewer = ({ images }) => {
const [nav1, setNav1] = useState(null);
const settings = {
dots: false,
infinite: true,
speed: 500,
slidesToShow: 1,
slidesToScroll: ... |
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Aqui você descobre quem é o Dev Treméa">
<title>Meu Site S2</title>
<link rel="stylesheet" href="style.css">
<link rel="style... |
package com.example.healthcareapplication.fragments
import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
import androidx.fragment.app.Fragment
import androidx.navigation.findNavController
i... |
import { Inter } from 'next/font/google'
import { ThemeProvider } from "@/components/theme-provider"
import { cn } from "@/lib/utils"
import "./globals.css"
import { Analytics } from "@vercel/analytics/react"
import { GoogleAnalytics } from '@next/third-parties/google'
const inter = Inter({ subsets: ["latin"] })
expo... |
/*
Copyright (C) 2016 3NSoft Inc.
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 3 of the License, or (at your option) any later
version.
This program is distributed in the h... |
package kr.co.kindernoti.auth.configuration;
import com.nimbusds.jose.JOSEException;
import com.nimbusds.jose.jwk.JWK;
import com.nimbusds.jose.jwk.JWKSet;
import com.nimbusds.jose.jwk.KeyUse;
import com.nimbusds.jose.jwk.RSAKey;
import org.springframework.context.annotation.Bean;
import org.springframework.context.an... |
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:go_router/go_router.dart';
import 'package:inposhiv/config/routes/app_routes.dart';
import 'package:inposhiv/core/utils/app_fonts.dart';
import 'package:inposhiv/features/auth/presentation/providers/role... |
# Launchpad_Mini_Control
## Overview
This is a low level library for communicating with the Launchpad Mini.
It provides functionality to set the LED lights, read button presses and make use of features like double buffering.
### Devices known to work
So far testing has only be done with the Launchpad Mini MK 1.
##... |
import { useNavigate } from 'react-router-dom';
'use client'
import { useState } from 'react';
import { Link } from 'react-router-dom';
import { FaEdit } from 'react-icons/fa'; // Thêm thư viện icon
import { useDispatch, useSelector } from 'react-redux';
import { resetUser } from '../redux/slides/user-Slide';
import {... |
import { SESSION_ID_COOKIE_NAME } from "#app/constants";
import { getCookie } from "#app/utils";
type DataType = "json" | "form-urlencoded";
export abstract class ApiBase {
//#region Fields
public readonly ERR_GENERIC: string = "There was an error";
protected readonly base: string;
//#region Public
cons... |
import React, { ChangeEvent, ChangeEventHandler, ReactNode, useEffect, useState } from 'react'
import styled from 'styled-components';
const CustomC = styled.div`
background-color : grey;
`;
const CustomComponentC = (props: any) => {
const [isDark, setIsDark] = useState(false);
type CustomCProps = {
the... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Portfolio Website</title>
<link rel="stylesheet" href="style.css">
<!-- font awesome cdn -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax... |
import json
import os
import sys
import pandas as pd
from nltk.corpus import stopwords
from sqlalchemy import (Column, DateTime, ForeignKey, Integer, String, Text,
create_engine)
from sqlalchemy.orm import Session, declarative_base, relationship
from utils.logging import build_logger
DB_ENGINE... |
"use client";
import {
Navbar as NextUINavbar,
NavbarBrand,
NavbarContent,
NavbarItem,
NavbarMenuToggle,
NavbarMenu,
NavbarMenuItem,
Button,
Link,
} from "@nextui-org/react";
import { usePathname } from "next/navigation";
import { useState } from "react";
const menuItems = [
{ name: "Home", href: ... |
\documentclass[11pt]{article}
\usepackage{finalreport} % uncomment this line for a final report
% \usepackage{progressreport} % uncomment this line for a progress report
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\usepackage{url}
\usepackage{booktabs}
\usepackage{amsfonts}
\usepackage{nicefrac}
\usepackage{microty... |
package com.sidharth.navachar.ui.screens.home.components
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.... |
import { Formik, Form, Field, ErrorMessage } from "formik";
import { addContact } from "../../redux/contactsOps";
import { useDispatch } from "react-redux";
import style from "./ContactForm.module.css";
import * as Yup from "yup";
const ContactSchema = Yup.object().shape({
name: Yup.string()
.min(3, "Too Short!"... |
---
title: 你可能正在写内存泄漏的 .NET 代码!
slug: you-might-be-writing-dotnet-code-with-memory-leaks
create_time: 2023-10-14 01:07:00
last_updated: 2023-10-14 01:07:00
description: 本文讨论了常见的 .NET 内存泄漏的代码写法,以提醒自己在编写代码过程中警惕内存泄漏。
tags:
- dotnet
---
[TOC]
## 0. 为什么会有这篇文章
现在是 2023 年 10 月 14 日凌晨 1 点 07 分,星期六,连上 7 天班终于放假,刚从外面嗨完回来,已经过... |
from api.models.transactions.index_facilities_new import index_facilities_new
from simple_history.models import HistoricalRecords
from django.db import models
def hooked_index_facilities(**kwargs):
instance = kwargs.get('instance')
index_facilities_new([instance.facility_id])
class FacilityMatchTemp(models... |
import { Injectable } from '@angular/core';
import { Database, listVal, ref } from '@angular/fire/database';
import { firstValueFrom, Observable, Subject } from 'rxjs';
import { ThemeName } from '@shared/models/theme-name.enum';
import { Theme } from '@shared/models/theme.model';
@Injectable()
export class ThemeServ... |
import { ethers, getNamedAccounts } from "hardhat";
async function main() {
const { deployer } = await getNamedAccounts();
console.log("Approving SZNS tokens for Burner contract with the account:", deployer);
// Address of the SZNS token contract
const sznsTokenAddress = "0xe3c200bC40066F9A61e5cf442b05497D65... |
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../services/api_service.dart';
import '../utils/navigation_utils.dart';
class RegisterScreen extends StatefulWidget {
const RegisterScreen({super.key});
@override
State<RegisterScreen> createState() => _... |
import asyncHandler from "../middlewares/asyncHandler";
import prisma from "../prisma/client";
import { customers, categories, products, admins } from "../db/data";
import {
invalidEmail,
incorrectCredentialsError,
resource404Error,
roleError,
unauthorizedError,
} from "../utils/errorObject";
import ErrorResp... |
import React, { useEffect, useState } from 'react';
export const TypewriterEffect = ({ text }: { text: string }) => {
const [displayText, setDisplayText] = useState('');
useEffect(() => {
let currentIndex = 0;
const interval = setInterval(() => {
if (currentIndex <= text.length) {
setDispl... |
export function darkenColor(color, factor) {
let red = (color >> 16) & 0xff;
let green = (color >> 8) & 0xff;
let blue = color & 0xff;
red = Math.floor(red * factor);
green = Math.floor(green * factor);
blue = Math.floor(blue * factor);
red = Math.min(Math.max(0, red), 255);
green = Math.min(Math.max(... |
import { Box, Flex, Image, Input, Loader, Stack, Text } from "@mantine/core";
import React from "react";
import classes from "./Style.module.css";
import { IconSearch } from "@tabler/icons-react";
import { useDebouncedState } from "@mantine/hooks";
import Link from "next/link";
import { useSearch } from "@/libs/hooks/u... |
# 1. Realizando Requisições para APIs
Para consumir dados de uma API, geralmente usamos o método GET para recuperar dados ou POST para enviar dados.
Exemplo de Requisição GET
import requests
url = "https://api.exemplo.com/dados"
response = requests.get(url)
if response.status_code == 200:
dad... |
# Tests for the Django admin modifications.
from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
# Tests for Django admin.
def setUp(self):
# Setup function for tests.
self.client = Client()
... |
import React from "react";
import { DownOutlined } from "@sryd/icons";
import type { MenuProps } from "sryd";
import { Dropdown, Space } from "sryd";
const items: MenuProps["items"] = [
{
label: (
<a
target="_blank"
rel="noopener noreferrer"
href="https://www.antgroup.com"
>
... |
import 'package:flutter/material.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:virtual.bell/Components/AppColor.dart';
import 'package:virtual.bell/widget_bg/appbar_Screen.dart';
class HomeScreen extends StatefulWidget {
const HomeScreen({super.key});
@override
State<HomeScreen> createStat... |
<blue-header [items]="crumbItems" [titleValue]="'Email Templates'"></blue-header>
<div class="grid-body">
<div class="header">
<button mat-button class="add-new-button" *ngIf="service.hasWritePermission()" (click)="openAddMode()">NEW TEMPLATE</button>
<div class="mrw-bi-input">
<mat-form-field [floatL... |
import { Component,OnInit,inject } from '@angular/core';
import { ApiService } from '../api.service';
import { apiKey } from '../apiKey';
import { Router } from '@angular/router';
import { Auth } from '@angular/fire/auth';
import tt from '@tomtom-international/web-sdk-maps'
@Component({
selector: 'app-duree-trajet',... |
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuGroup,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator, DropdownMenuShortcut,
DropdownMenuTrigger
} from '@/components/ui/dropdown-menu';
import { Button } from '@/components/ui/button';
import {
Dialog,
DialogContent... |
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Создание Пользователя</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" />
</head>
<body>
... |
from functools import wraps
def company_info(func):
@wraps(func)
def wrapper(*args, **kwargs):
func(*args, **kwargs)
print("Company name , address location , zipcode")
return func
return wrapper
def email_decorator(fromWho):
def _email_decorator(func):
def wrapper(*arg... |
import React, {useEffect, useState} from 'react';
import {ArrowDown} from "../../svgComponents/Icons";
import {InputBase, NativeSelect, styled} from "@mui/material";
import styles from './DropDown.module.scss';
import classNames from "classnames/bind";
const cx = classNames.bind(styles);
const BootstrapInput = styl... |
package util;
import java.util.Properties;
import org.hibernate.SessionFactory;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.service.ServiceRegistry;
import model.Autor;
import model.Edicao;
import ... |
// ProcessInformationScreen
<template>
<v-container fluid>
<v-row>
<v-col v-show="currentComponent === 'ProcessChart'" class="mb-13"
><ProcessChart
:incremented-units="incrementedUnits"
:non-defective-products="nonDefectiveProducts"
:working-rate="workingRate"
... |
using System;
using CourseWork1.Interfaces;
namespace CourseWork1
{
public class Person : IPerson
{
private string firstName;
private string lastName;
private string patronymic;
public Person(string firstName, string lastName, string patronymic)
{
FirstName... |
/*
* ------------------------------------------------------------------------
*
* Copyright by KNIME AG, Zurich, Switzerland
* Website: http://www.knime.com; Email: contact@knime.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public Licens... |
from spoonbill.datastores import KeyValueStore
from typing import List
class RdictBase(KeyValueStore):
"""
A key-value store based on [speedict](https://github.com/speedb-io/speedb)
"""
def __init__(self, store, strict=False, name: str = None, options=None):
super().__init__(store, strict)
... |
import { PlayerInput } from "yage/schemas/core/PlayerInput";
import { ComponentCategory } from "yage/systems/types";
import type { GameModel } from "yage/game/GameModel";
import { distanceSquaredVector2d } from "yage/utils/vector";
import { keyPressed } from "yage/utils/keys";
import { MappedKeys } from "yage/inputs/In... |
import { object, string, InferType } from 'yup';
/**
* @openapi
* components:
* error:
* DuplicatedPostCategoryName:
* properties:
* status:
* type: number
* example: 409
* message:
* type: string
* example: CATEGORY_NAME... |
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<style>
body {
margin: 0;
font-family: Arial, sans-serif;
background-color: #FBF6EE; /* Light gray background color */
}
h1, h2 {
color: #333;
}
.contain... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Portfolio</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.... |
using Application.Contracts.Repositories;
using Application.Models.DTOs.User.role;
using Application.Models.Helpers;
using Application.Services.Application.Services;
using Infrastructure.Entities;
using Microsoft.EntityFrameworkCore;
using System.Security.AccessControl;
using System;
using Microsoft.AspNetCore.Mvc;
u... |
package tema04.EjBasicos01.Ej29;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Alumno extends Persona {
// Primero los atributos
private String dni;
private Float nota;
private Curso curso;
// Segundo los constructores
// Constructor con parametros
pub... |
package com.example.kristp.service.impl;
import com.example.kristp.entity.*;
import com.example.kristp.enums.HoaDonStatus;
import com.example.kristp.repository.ChiTietSanPhamRepository;
import com.example.kristp.repository.HoaDonChiTietRepo;
import com.example.kristp.repository.HoaDonRepository;
import com.example.kri... |
import 'dart:convert';
import 'package:http/http.dart' as http;
class MovieTrailerFetcher {
static const String apiKey = '7b217eff129625c9d831ceb45f4d3c58';
static const String baseUrl = 'https://api.themoviedb.org/3/movie/';
Future<List<String>> getTrailers(int movieId) async {
List<String> trailers = [];
... |
# Problem Statement:
This project aims to utilize two randomized algorithms to achieve distributed consensus - "Gossip" for information dissemination and "PushSum" procotol to calculate the average of all the nodeIds in the network. We look at their convergence over different topologies and analyze their performance.
... |
import React, { useState } from 'react';
import {
View,
Text,
TextInput,
TouchableOpacity,
StyleSheet,
Modal,
FlatList,
} from 'react-native';
import { LinearGradient } from 'expo-linear-gradient';
const CriarConta = () => {
const [selectedGender, setSelectedGender] = useState('');
const [selectedDay... |
To go beyond, we will be using Generative AI to create and expand. There are several 'stages' that may be considered.
1. Manual, and automated use of GenAI to [improve and refine](#improve_and_refine_content) content already present.
1. Automatic triggering of GenAI to [incorporate new](#incorporate) content coming ... |
class BellmanFordSolution:
def findCheapestPrice(self, n: int, flights: List[List[int]], src: int, dst: int, k: int) -> int:
# Map nth prices (vertices) to infinity then initialize the source vertex as 0
# Source is 0 since price to source is 0
prices = [float("inf")] * n
prices[... |
<?php
session_start();
if (!isset($_SESSION['user_id'])) {
header("Location: index.php");
exit();
}
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "flowershop";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: ... |
import streamlit as st
import os
import openai
from PIL import Image
# openai.api_key = os.environ.get('openai.api_key')
# 页面设置
st.set_page_config(
page_title="小译学长|一张原图生成多张不同图",
page_icon=":robot:"
)
st.header("🔥AI一张原图生成多张不同图")
#检查账号登陆
def get_text1():
if 'openai_key' not in st.session_state:
i... |
package com.example.runapps.starter
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.graphics.BitmapShader
import android.graphics.Canvas
import android.graphics.Paint
import android.graphics.Shader
import android.util.Log
import android.widget.ImageView
import android.widget.TextVie... |
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
import { Author } from './Author';
import { ManyToOne } from 'typeorm';
import { Category } from './Category';
import { ManyToMany } from 'typeorm';
import { JoinTable } from 'typeorm';
import { JoinColumn } from 'typeorm';
@Entity('sample21_post')
expo... |
using SnakeGame.Handlers;
using SnakeGame.Models;
using SnakeGame.Models.FactoryModels;
using SnakeGame.Models.FactoryModels.Fruit;
using SnakeGame.ResponsibilityChains;
using SnakeGame.Services;
using static SnakeGame.Models.Snake;
namespace SnakeGame.Template
{
public abstract class MovementTemplate
{
... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>App Trybe</title>
<script src="https://unpkg.com/redux@latest/dist/redux.js"></script>
<style>
body {
color: white;
background-colo... |
using System.Collections.Generic;
using System.Data;
using System.Text;
using Oracle.ManagedDataAccess.Client;
using DevPlanWebAPI.Base;
using DevPlanWebAPI.Models;
namespace DevPlanWebAPI.Logic
{
/// <summary>
/// お気に入り(月次計画)業務ロジッククラス
/// </summary>
public class MonthlyWorkFavoriteLogic : BaseLogic... |
# SETUP ------------------------------------------------------------------------
pacman::p_load(
xgcmsm,
methods,
EpiModelHIV,
data.table,
magrittr,
rms,
stringr,
pscl,
lhs,
rlecuyer
)
slurm_array_task_id <- as.numeric(Sys.getenv("SLURM_ARRAY_TASK_ID"))
epi_run_type <- Sys.getenv("EPI_RUN_TYPE")
a... |
<?php
// Connect to your MySQL database
$mysqli = new mysqli("localhost", "root", "root", "secure_file_storage");
// Check connection
if ($mysqli->connect_error) {
die("Connection failed: " . $mysqli->connect_error);
}
// Query to fetch user data
$user_query = "SELECT * FROM users";
$user_result = $mysqli->query(... |
//import org.testng.Assert;
//import org.testng.annotations.Test;
//
import org.testng.Assert;
import org.testng.annotations.*;
import org.testng.asserts.SoftAssert;
import io.restassured.RestAssured;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.uti... |
// ignore_for_file: prefer_const_constructors, deprecated_member_use
import 'package:flutter/material.dart';
class MBI_page extends StatelessWidget {
const MBI_page({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text... |
"use client"
import Sidebar from '@/components/Sidebar';
import { Button } from '@/components/ui/button';
import { ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTr... |
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:weather_app/data/entities/weather_response.dart';
import 'package:weather_app/provider/setting_provider.dart';
import 'package:weather_app/ui/widgets/info_container.dart';
import 'package:weather_app/utils/common_functions.... |
#ifndef SHELLSORT_H_
#define SHELLSORT_H_
#include <iostream>
using namespace std;
// Metodo para ordenar un arreglo de enteros utilizando el algoritmo Shell Sort.
// Parametros:
// arr: arreglo de enteros a ordenar.
// size: numero de elementos en el arreglo.
//
// Descripcion:
// Shell Sort es un algoritmo de ... |
'use client'
// import { useEffect, useRef } from 'react'
import Link from 'next/link'
import { motion} from 'framer-motion'
import { Github, Linkedin, Mail, ChevronDown } from 'lucide-react'
import { Button } from '@/components/ui/button'
import { TypeAnimation } from 'react-type-animation'
import { Skills } from '@/... |
export const createShortUrlPath = {
post: {
security: [
{
BearerAuth: [],
},
],
tags: ["ShortUrl"],
summary: "Endpoint para criar uma url encurtada",
requestBody: {
required: true,
content: {
"application/json": {
schema: {
type: "objec... |
/*
Exercises: Functions, Triggers and Transactions
*/
-- This document defines the exercise assignments for the "Databases Basics - MySQL" course @ Software University.
/* Part I – Queries for SoftUni Database */
-- 1.Employees with Salary Above 35000
-- Create stored procedure usp_get_employees_salary_above_3500... |
"use server";
import { Booking, User, Rental } from "../models";
import { getSession } from "../auth";
import { revalidatePath } from "next/cache";
export const createBooking = async (data) => {
const { startAt, endAt, totalPrice, guests, days, rental } = data;
const booking = new Booking({ startAt, endAt, total... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.