text stringlengths 184 4.48M |
|---|
<?php
namespace App\Entity\Enums;
use App\Entity\Traits\EnumsTrait;
use BackedEnum;
enum Priority: string
{
use EnumsTrait;
case Null = '';
case Hight = '1';
case Medium = '0';
case Low = '-1';
/**
* @param BackedEnum|string $enum
* @return string
*/
public static functio... |
"""Request API"""
import asyncio
import copy
import datetime
import json
import os
import re
import statistics
import urllib.parse
from functools import reduce
from pathlib import Path
from typing import Any, Dict, List
import httpx
import orjson
import requests
from dateutil import parser
from easy_logger.log_format... |
/*using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using OvermorrowMod.Common;
using OvermorrowMod.Common.Cutscenes;
using OvermorrowMod.Common.Particles;
using OvermorrowMod.Content.WorldGeneration;
using OvermorrowMod.Core;
using System;
using System.Linq;
using System.Xml;
using Terraria;
using... |
import 'package:audiorecord/screen/box.dart';
import 'package:audiorecord/widget/comment_tile.dart';
import 'package:flutter/material.dart';
class CommentScreen extends StatefulWidget {
@override
_CommentScreenState createState() => _CommentScreenState();
}
class _CommentScreenState extends State<CommentScreen> {... |
import 'package:flutter/material.dart';
import 'package:smart_rent/core/values/app_colors.dart';
import 'package:get/get.dart';
class RecentlyDialogWidget extends StatelessWidget {
const RecentlyDialogWidget({
super.key,
required this.onPressed,
});
final Future<void> onPressed;
@override
Widget bui... |
<template>
<section id="search-section">
<Filters v-model="filters" id="filters" />
<div class="d-flex flex-column" id="search-results">
<div v-if="searchResults.length !== 0">
<FlightCard
v-for="result in searchResults"
:key="result.id"
:details="result... |
package cache
import (
"context"
"errors"
"github.com/go-redis/cache/v9"
"time"
)
type Cache interface {
Set(ctx context.Context, key string, value interface{}) error
Get(ctx context.Context, key string, dest interface{}) error
}
type Adapter struct {
cache *cache.Cache
ttl time.Duration
}
func NewCacheAd... |
@inject SweetAlertService swal
<NavigationLock OnBeforeInternalNavigation="OnBeforeInternalNavigation"></NavigationLock>
<EditForm Model="asignacionMateriales" OnValidSubmit="OnValidSubmit" ReturnAction="Return">
<DataAnnotationsValidator />
<div class="mb-3">
<label>Id: Materiales:</label>
<... |
import { CurveFactory, CurveFactoryLineOnly, NumberValue } from "d3";
import { Word } from "d3-cloud";
export type MapDataProps = {
x: string | number | Date;
y: number;
key: string;
stackedY: number;
defined: any;
};
type D3Function = (value: any, index: number, iterable: Iterable<any>) => any;
type BaseType =... |
package org.k8loud.executor.openstack.cinder;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.k8loud.executor.exception.OpenstackException;
import ... |
/*
* @Copyright 2018-2023 HardBackNutter
* @License GNU General Public License
*
* This file is part of NeverTooManyBooks.
*
* NeverTooManyBooks 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 v... |
#include "lists.h"
/**
* add_node - adds a new node at the beginning of linked list
* @head: A pointer point to the head
* @str: the new string
*
* Return: address of the new element, or NULL if it failed
*/
list_t *add_node(list_t **head, const char *str)
{
list_t *ptr;
ptr = malloc(sizeof(list_t));
i... |
import { useEffect, useState } from 'react';
import axios from 'axios';
import React from 'react'
// Import Swiper React components
import { Swiper, SwiperSlide } from 'swiper/react';
import SwiperCore, { Navigation } from 'swiper';
SwiperCore.use([Navigation]);
// Import Swiper styles
import 'swiper/css';import Heade... |
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<link rel="apple-touch-icon" type="image/png" href="https://cpwebassets.codepen.io/assets/favicon/apple-touch-icon-5ae1a0698dcc2402e9712f7d01ed509a57814f994c660df9f7a952f3060705ee.png" />
<meta name="apple-mobile-web-app-title" content="CodePen">
<... |
import React, { useEffect, useState } from 'react'
import { Link } from 'react-router-dom';
import { YOUTUBE_VIDEOS_API } from '../utils/constant';
import Shimmer from './Shimmer';
import VideoCard, { AdVideoCard } from './VideoCard';
const VideoContainer = () => {
const [videos , setVideos] = useState([])
useE... |
import 'package:flutter/material.dart';
import 'package:fl_components/theme/app_theme.dart';
import 'package:fl_components/router/app_routes.dart';
class HomeScreen extends StatelessWidget {
const HomeScreen({Key? key}) : super(key: key);
// ignore: annotate_overrides
Widget build(BuildContext context) {
f... |
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateLedgerTransactionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ledg... |
// Global scope is different in node and browser window
// let a = 10
// const b = 20
// var c = 30 // FYI doesn't work in block scope
// console.log(a); // 10
// console.log(b); // 20
// console.log(c); // 30
// var c = 300
if (true) {
let a = 10
const b = 20
// var c = 30
// we have problem of m... |
//SourceUnit: NewShrimp.sol
pragma solidity 0.4.25;
contract TRC20 {
function totalSupply() public view returns(uint supply);
function balanceOf(address _owner) public view returns(uint balance);
function transfer(address _to, uint _value) public returns(bool success);
function transferFrom(address _from, ... |
const std = @import("std");
const zglfw = @import("zglfw");
const zgpu = @import("zgpu");
const zgui = @import("zgui");
const assets_dir = @import("build-options").assets_dir;
const window_title = "Free Away Forum Admin";
const State = struct {
showDemo: bool,
user_window_size: [2]f32,
users: []const Us... |
/**
* @file backend.h This file contains the functionality to switch between math backends
*
* @author TPOC: palisade@njit.edu
*
* @copyright Copyright (c) 2017, New Jersey Institute of Technology (NJIT)
* All rights reserved.
* Redistribution and use in source and binary forms, with or without modification,
*... |
<?php declare(strict_types=1);
namespace Shopware\Core\Content\Product;
use Shopware\Core\Framework\HttpException;
use Shopware\Core\Framework\Log\Package;
use Symfony\Component\HttpFoundation\Response;
#[Package('inventory')]
class ProductException extends HttpException
{
public const PRODUCT_INVALID_CHEAPEST_P... |
import { useSharedState } from "@microsoft/live-share-react";
import { FC } from "react";
export const ExampleSharedState: FC = () => {
const [counterValue, setCounterValue] = useSharedState<number>(
"counter-id",
0
);
const [checkboxValue, setCheckboxValue] = useSharedState<boolean>(
... |
###############################
# #
# Financial Analytics: #
# Scorecard Creation & #
# Reject Inference #
# #
# Dr Aric LaBarr #
# #
###############################
# Needed Libraries for Analysis... |
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { AppService } from '../../services/app.service';
import { Router } from '@angular/router';
@Component({
selector: 'app-registeration',
templateUrl: './registeration.component.html',
sty... |
package com.example.proyecto.servicios;
import com.example.proyecto.entidades.Comentario;
import com.example.proyecto.entidades.Proveedor;
import com.example.proyecto.entidades.Trabajo;
import com.example.proyecto.enumeraciones.EstadoTrabajo;
import com.example.proyecto.excepciones.MiException;
import com.example.proy... |
<ng-container *ngIf="isLoggedIn();else login">
<div class="principal-box overflow-hidden relative">
<app-aside (navbarBrand)="getTitle($event)" (openM)="openAsideModal($event)" (hideAside)="hideAside($event)"
[ngClass]="!toggleDrawer && innerWidth <= maxWidth? '-translate-x-full hidden' : 'trans... |
import toast from "react-hot-toast";
import axios from "axios";
// import { useSelector } from "react-redux";
import { setToken, setUser } from "../slices/AuthSlice";
const API_URL = "http://localhost:4000/api/v1";
// Send Otp
export const sendOtp = async (formData, navigate) => {
try {
const { email } = formD... |
@page "/updaterecipe/{Id:int}"
@inject RecipeService RecServ
@inject NavigationManager NavMan
<h3 style="font-weight: bold">Edytuj przepis</h3>
@if (tags is not null && recipe is not null)
{
<RecipeForm Recipe="recipe" OnValidSubmit="Update" Tags="tags"/>
}
@code {
[Parameter]
public int Id{ get; init; }... |
class Product:
name: str
price: float
description: str
quantity: int
def __init__(self, name, price, description, quantity):
self.name = name
self.price = price
self.description = description
self.quantity = quantity
def check_quantity(self, quantity) -> bool:
... |
import 'package:cart_design_asignment/item_list.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
debugShowCheckedModeBanner: ... |
import type { ConfigCommands } from "../../types/structure/commands";
export default <ConfigCommands>{
name: "addmode",
alias: ["addmember"],
usage: "<on|off>",
category: "group setting",
description: "Add Other Members",
isGroup: true,
isGroupAdmin: true,
isBotAdmin: true,
example:... |
<div class="center-container" *ngIf="product">
<div class="product-card">
<div class="product-image">
<img [src]="product.processedImg" alt="{{product.name}} image">
</div>
<div class="product-details">
<h2>{{product.name}}</h2>
<p class="description">{{product.description}}</p>
<... |
from transformers import GPT2Tokenizer, GPT2LMHeadModel, AdamW
from torch.utils.data import DataLoader, Dataset
import torch
# Load the dataset
class MyDebiasedDataset(Dataset):
def __init__(self, file_path):
# Load and preprocess the data
with open(file_path, 'r', encoding='utf-8') as file:
... |
#!/usr/bin/env python
#coding:utf-8
import pandas as pd
import itertools
def csp(candidates, players, team, requested_positions_attributes, budget):
"""Beginning of CSP algorithm for finding a valid combination of players.
Parameters
----------
candidates : pandas.core.frame.DataFrame
The da... |
/*This is the class creation of a board piece for the chessboard*/
#include<string>
#include<iostream>
using namespace std;
#ifndef PIECE_H
#define PIECE_H
class Piece
{
protected:
/* Information about the piece including its coordinate on the board by file and rank and its team*/
char rank;
char file;
int t... |
//===- ae.cpp -- Abstract Execution -------------------------------------//
//
// SVF: Static Value-Flow Analysis
//
// Copyright (C) <2013-2017> <Yulei Sui>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as... |
package br.com.danielschiavo.mapper.cliente;
import java.time.LocalDate;
import org.mapstruct.Context;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Named;
import br.com.danielschiavo.shop.model.cliente.Cliente;
import br.com.danielschiavo.shop.model.cliente.carrinho.Carrinho;
impo... |
const express = require('express');
const bodyParser = require('body-parser');
const path = require("path");
const app = express();
const cors = require("cors");
app.use(bodyParser.json());
app.use(cors());
let todos = [];
function findIndex(arr, id) {
for (let i = 0; i < arr.length; i++) {
if (arr[i].id === id... |
import { Button, Dialog, DialogActions, DialogContent, DialogTitle, TextField } from '@mui/material'
import { useContext, useState } from 'react'
import { useForm } from 'react-hook-form'
import { Transition } from '@/components/Transition'
import { useTranslation } from 'react-i18next'
import { CreateGuardianInput } f... |
import { ReactElement } from 'react';
import Document, { DocumentContext, DocumentInitialProps, Head, Html, Main, NextScript } from 'next/document';
import { enableNextSsr } from '@uniformdev/context-next';
import createUniformContext from '@/context/createUniformContext';
type CustomDocumentProps = DocumentInitialPro... |
import { Injectable } from '@angular/core';
import { AngularFireAuth } from '@angular/fire/compat/auth';
import { catchError, from, Observable, of, throwError } from 'rxjs';
import { map } from 'rxjs/operators';
import { GoogleAuthProvider, AuthProvider } from 'firebase/auth';
@Injectable({
providedIn: 'root'
})
exp... |
import { apiHandler } from '@libs/api-gateway';
import { Result } from '@libs/api-gateway/types';
import { Logger } from '@libs/log';
import createEvent from '@serverless/event-mocks';
import {
APIGatewayEvent,
APIGatewayProxyEvent,
APIGatewayProxyEventPathParameters,
APIGatewayProxyResult,
Context,
} from 'a... |
import { orderBy, range } from "lodash";
import { ObjectId } from "mongodb";
import {
Arg,
Authorized,
Ctx,
FieldResolver,
Int,
Query,
Resolver,
Root,
} from "type-graphql";
import { isDocument, Ref } from "@typegoose/typegoose";
import { ADMIN } from "../../constants";
import { CategoryImageAssociati... |
package com.macaosoftware.sdui.app.marketplace.auth
import androidx.compose.runtime.mutableStateOf
import com.macaosoftware.component.core.Component
import com.macaosoftware.component.stack.StackComponent
import com.macaosoftware.component.stack.StackComponentViewModel
import com.macaosoftware.component.stack.StackSta... |
# -*- coding: utf-8 -*-
# BSD 3-Clause License
#
# Copyright (c) 2020-2023, Faster Speeding
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the abo... |
import { BaseShape } from "./BaseShape";
export class Dot extends BaseShape {
private DOT_SIZE: number = 3;
public constructor(x: number, y: number, color: string = 'black') {
super(x, y, color);
}
public getHeight(): number {
return this.DOT_SIZE;
}
public getWidth(): number {
return this.D... |
/** @module : m_control
* @author : Secure, Trusted, and Assured Microelectronics (STAM) Center
* Copyright (c) 2022 Trireme (STAM/SCAI/ASU)
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the ... |
import React, { useEffect, useState } from 'react';
import { connect } from 'react-redux';
import * as actionType from '../../store/actions'
import MySpinner from '../hoc/Spinner'
import { Container, Jumbotron, Col, Table } from 'react-bootstrap';
import ProjectsList from '../projects/projectsList'
import { getUserFr... |
import 'package:flutter/material.dart';
import 'buttom_row.dart';
import 'button.dart';
class Keyboard extends StatelessWidget {
final void Function(String) cb;
Keyboard(this.cb);
@override
Widget build(BuildContext context) {
return Container(
height: 500,
child: Column(
children: <Wid... |
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('sessions', {
id: {
type: Sequelize.DataTypes.UUID,
primaryKey: true,
allowNull: false,
unique: true,
},
userId: {
ty... |
import { combineLatest } from 'rxjs';
import { map } from 'rxjs/operators';
import { ObservableBoolean } from '../../types';
/**
* Combines a series of ObservableBooleans using 'AND' and returns a single ObservableBoolean
*
* @param observableBooleans - An array of ObservableBooleans
*/
export const combineBoolea... |
const express = require("express");
const userRouter = express.Router();
const User = require('../Schema/UserSchema');
const bcrypt = require('bcrypt');
const cloudinary = require('cloudinary');
const multer = require("multer");
const generateCertificate = require('./CertficateRoute')
const storage = multer.memorySto... |
import { useState, useEffect } from 'react';
import './characterList.scss';
import { Link } from 'react-router-dom';
import { getCharacters, sortingByName } from '../../services/getCharacters';
const CharacterList = () => {
const [search, setSearch] = useState(localStorage.getItem('search') || '');
const [isLoadin... |
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:light_mart/modules/login/login_screen.dart';
import 'package:light_mart/shared/network/local/cache_helper.dart';
import 'package:smooth_page_indicator/smooth_page_indicator.dart';
class OnBoardingScreen extends StatefulWid... |
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import React from 'react';
import { screen, fireEvent } from '@testing-library/react';
import { MOCK_ACCOUNT, rend... |
<!--/
Angie Tracy
Dr. Payne
CSD 440-311A
Server Side Scripting
2023/10/08
Module 11 Programming Assignment
This file creates a PDF to display all of the data stored in the database in a table format.
-->
<?php
// Create connection to database
$serverName = "localhost";
$userName = "student1";
$password = "pass";
$d... |
import pytest
import jwt
from datetime import datetime, timedelta
from flask import current_app, g
from random import randint
import app.crud.user as crud
from app import create_app, db
@pytest.fixture()
def app():
app = create_app(test_config=True)
with app.app_context():
db.create_all()
# ad... |
using basic.common;
using OpenTK.Graphics.OpenGL4;
using OpenTK.Windowing.Common;
using OpenTK.Windowing.Desktop;
using OpenTK.Windowing.GraphicsLibraryFramework;
namespace basic.Rectangle;
public class OpenGlWindowDrawRectangle : GameWindow
{
private readonly float[] _rectangleVertices = [
0.5f, 0.5f, ... |
# ruff: noqa: ANN201
from __future__ import annotations
import typing
import unittest
if typing.TYPE_CHECKING:
from hw8.hashmap import CustomHashMap
else:
from hashmap import CustomHashMap
class TestCustomHashMap(unittest.TestCase):
# NOTE: I made each of these methods short enough and with descriptive ... |
<template>
<div class="Dialog">
<p>el-Dialog弹出框</p>
<p>:modal-append-to-body='false'(防止被遮罩层遮住)</p>
<el-dropdown trigger="click">
<span class="el-dropdown-link">
下拉查询条件<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu>
<el-form inline="false">
... |
// Copyright (c) 2021 MIT Digital Currency Initiative,
// Federal Reserve Bank of Boston
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "impl.hpp"
#include "crypto/sha256.h"
#include "util/common/ke... |
<?php
namespace amos\podcast\models\search;
use amos\podcast\models\PodcastEpisode;
use open20\amos\core\interfaces\CmsModelInterface;
use open20\amos\core\record\CmsField;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use amos\podcast\models\Podcast;
use yii\db\ActiveQuery;
/**
* PodcastSearch repr... |
#Preamble
import numpy as np
from scipy.optimize import fsolve, newton
from Fluids_Library import *
#Initial Conditions
#Calculate Shock Pressures
# Driver Helium properties
gamma_4 = 1.667
R_4 = 2077 # J/kg.K
P_4 = 3e6 # 3Mpa
cp_4 = 5192.6 # J/kg.k
T_4 = 300 # K
L_4 = 0.23 # m
U_4i = 0
# Print statements for... |
/**
* These codes are licensed under the Unlicense.
* http://unlicense.org
*/
#ifndef COMMATA_GUARD_0DE728A7_BABE_4C3A_94B1_A05CB3D0C9E4
#define COMMATA_GUARD_0DE728A7_BABE_4C3A_94B1_A05CB3D0C9E4
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cstdint>
#incl... |
import { usersService } from "../services/index.js";
import { createHash } from "../utils/hashing.js";
import Logger from "../utils/logger.js";
// all controllers use Service's functions. In this case, usersService
export async function getController(req, res, next) {
try {
const user = await usersService.getUs... |
import time
from functools import wraps
def backoff(exceptions=Exception, start_sleep_time=1, factor=2, border_sleep_time=60):
if start_sleep_time <= 0:
raise ValueError("start_sleep_time must be greater than 0")
if factor <= 1:
raise ValueError("factor must be greater than 1")
if border... |
import requests
from bs4 import BeautifulSoup
import csv
res = requests.get("https://www.91mobiles.com/top-10-mobiles-in-india")
soup = BeautifulSoup(res.text,'html.parser')
title = soup.title.string
#-----------------Phone-Image--------------------------#
ImageLink=[]
box_img = soup.find_all(class_="finder_pro... |
/*
* Copyright (c) 2022 SAP SE or an SAP affiliate company. All rights reserved.
*/
import {
ConfirmationModalConfig,
EVENT_CONTENT_CATALOG_UPDATE,
IAlertService,
IConfirmationModalService,
IExperienceService,
IPageInfoService,
LogService,
SeDowngradeService,
SystemEventService,
... |
import React, {useMemo} from 'react';
import styled from "@emotion/styled";
import {css, keyframes} from "@emotion/react";
interface Props{
width?: number;
height?: number;
circle?: boolean; //원형 스켈레톤
rounded?: boolean; // border radius가 적용되어 모서리가 둥글게됨
count?: number; // width, height을 지정하지 않았을 때 글자의 ... |
from typing import Union, List, ForwardRef
from pydantic import BaseModel
class MovieBase(BaseModel):
name: str
year: Union[str, None] = None
class MovieCreate(MovieBase):
pass
class Movie(MovieBase):
id: int
class Config:
from_attributes = True
class GenreBase(BaseModel):
name... |
<div class="container-fluid">
<div class="card card-title shadow p-3 mb-5">
<h3>Share your favorite quotes below <img src="https://img.icons8.com/material/24/000000/filled-star-filled.png" width="30"></h3>
</div>
<div class="row">
<form (ngSubmit)='submitQuote()' #quoteForm='ngForm' class="shadow p-3 ... |
import Flutter
import UIKit
public class SwiftAppCommunicationPlugin: NSObject, FlutterPlugin {
var resultFlutter: FlutterResult?
var notificationReceived: String?
var receivedValue : Dictionary<String, Any>?
public static func register(with registrar: FlutterPluginRegistrar) {
let ch... |
!!! question "Lesson: Check User Input Evenness"
=== "Task"
Create a small Python program that reads an integer value from user
input and prints if the input value is even or odd.
=== "Hints"
Find out about the modulo operator or the `divmod(...)` built-in
... |
/**
* Personium
* Copyright 2022 Personium Project Authors
* - FUJITSU LIMITED
*
* 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
*
... |
/* Sharon Yang
SMU Mathematics
Math 4370 / 6370 */
// Inclusions
#include "vec2d_b.hpp"
// This file implements the operations defined in the vec2d_b class
///// General class routines /////
// constructor (initializes values to 0.0)
vec2d_b::vec2d_b(long int m, long int n) {
// if m or n is illegal, crea... |
@extends(getTemplate() . '.layouts.app')
@push('styles_top')
@endpush
@section('content')
@if (
!empty($webinars) and count($webinars) or
!empty($teachers) and count($teachers) or
!empty($organizations) and count($organizations))
<section class="site-top-banner search-top-... |
---
interface Props {
size?: "md" | "lg";
block?: boolean;
style?: "outline" | "primary" | "inverted" | "secondary";
class?: string;
[x: string]: any;
}
const {
size = "md",
style = "primary",
block,
class: className,
...rest
} = Astro.props;
const sizes = {
md: "px-5 py-2.5",
lg: "px-6 py-3",... |
import React, { Component } from "react";
import { connect } from "react-redux";
import { actDatVe } from "./../store/actions";
class DatVe extends Component {
renderGheDaChon = () => {
const { gheDaChon, gheDaDat } = this.props;
return (gheDaChon.length > 0 ? gheDaChon : gheDaDat).map((ghe) => {
retur... |
CREATE TABLE employees (
id INT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
department VARCHAR(50),
salary DECIMAL(10, 2)
);
INSERT INTO employees (id, first_name, last_name, department, salary)
VALUES
(1, 'John', 'Doe', 'IT', 50000.00),
(2, 'Jane', 'Smith', 'HR', 60000.00),... |
import java.util.ArrayList;
import java.util.List;
public class Professor extends Pessoa {
private String titulacao;
private double salario;
private List<Curso> cursos;
public Professor() {
cursos = new ArrayList<>();
}
public void setTitulacao(String titulacao) {
this.titulac... |
package org.aquam.service.impl;
import lombok.RequiredArgsConstructor;
import org.aquam.model.AppUser;
import org.aquam.model.AppUserSettings;
import org.aquam.model.Country;
import org.aquam.model.Language;
import org.aquam.model.SupportLetter;
import org.aquam.model.dto.AppUserDto;
import org.aquam.model.dto.AppUser... |
def is_valid_sudoku(board):
# Use sets to keep track of seen numbers in rows, columns, and sub-boxes
rows = [set() for _ in range(9)]
cols = [set() for _ in range(9)]
boxes = [set() for _ in range(9)]
for i in range(9):
for j in range(9):
num = board[i][j]
if num... |
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:khalti_checkout_flutter/khalti_checkout_flutter.dart';
void main() {
runApp(
const MaterialApp(
home: KhaltiSDKDemo(),
),
);
}
class KhaltiSDKDemo extends StatefulWidget {
const KhaltiSDKDemo({super.key});
@overri... |
#!/usr/bin/env ruby
require "thor"
class App < Thor
include Thor::Actions
def self.exit_on_failure?
true
end
SERVICE_LIST = %w[db]
private_constant :SERVICE_LIST
class_option :force, type: :boolean, default: false
argument :cmd, type: :string, required: true, desc: "Action to perform"
desc "s... |
/*
Copyright 2015-Present Entando Inc. (http://www.entando.com) All rights reserved.
This library 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 2.1 of the License, or (at your option)
any l... |
import torch
from torch import nn
import torch.nn.functional as F
class FocalLoss(nn.Module):
def __init__(self, alpha=[1, 1, 1], gamma=2, reduction='mean', device='cpu'):
super(FocalLoss, self).__init__()
self.alpha = torch.tensor(alpha).to(device)
self.gamma = gamma
self.reduction... |
<template>
<div class="py-6 pb-[15rem] grid place-items-center" >
<p v-show="state" class="my-4 p-2 bg-gray-50 text-green-600 absolute bottom-0 right-10 font-bold" >{{ msg }}</p>
<form @submit.prevent="updateProduct" class="p-4 border-[1px] border-gray-50/10 rounded-md shadow-xl
flex flex-col gap-4"... |
// Calculator class
class Calculator {
// Adds two numbers
add(a, b) {
return a + b;
}
// Subtracts two numbers
subtract(a, b) {
return a - b;
}
// Multiplies two numbers
multiply(a, b) {
return a * b;
}
// Divides two numbers, checking for division by zero
divide(a, b) {
if (b ... |
package com.patients.main.features.patient.home_screen.presentation
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
i... |
import { useState, useContext } from "react";
import { Link, useNavigate } from "react-router-dom";
import { authContext } from "../context/AuthContext";
function Login() {
const [user, setUser] = useState({
email: "",
password: "",
});
const { login } = useContext(authContext);
const navigate = useNav... |
/*
* C implementations of test functions
* CSF Assignment 2 MS1
* Jianan Xu
* jxu147@jhu.edu
*/
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "image.h"
#include "drawing_funcs.h"
#include "tctest.h"
// an expected color identified by a (non-zero) character code
typedef s... |
/*
* This file is part of CELADRO_3D, Copyright (C) 2019-2021, Siavash Monfared
*
* 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... |
/* Home Arduino System v1.0
* learnelectronics
* 01-02-2017
*/
//---------------------------------------------------------------------------------
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
#define NUMFLAKES ... |
import React, { useState } from "react";
function TodoList({ todos, updateTodo }) {
const [active, setActive] = useState("");
const [filtered, setFiltered] = useState(todos);
const handleDelete = (name) => {
const updatedTodo = todos.filter((todo) => todo.name !== name);
console.log("deleted", name, upda... |
<script lang="ts">
import BaseTextInputVue from "@/components/BaseTextInput.vue";
import BaseButtonVue from "@/components/BaseButton.vue";
import { defineComponent } from "vue";
import Spinner from "@/components/Spinner.vue";
import { useAuthStore } from "@/stores/auth";
import { mapActions, mapState } from "pinia";
im... |
package com.example.fbaseauth
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Button
import android.widget.EditText
import android.widget.TextView
import android.widget.Toast
import com.google.firebase.auth.FirebaseAuth
import com.google.fire... |
from __future__ import division
from __future__ import print_function
from torch_geometric.utils import convert
import time
import argparse
import numpy as np
import torch
import torch.nn.functional as F
import torch.optim as optim
from utils import load_bail, load_income, load_pokec_renewed
from GNNs import GCN, GAT, ... |
/*
** client.c -- a stream socket client demo
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <netdb.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <pthread.h>
#include <arpa/inet.h>
#define PORT "3490" // the port clien... |
<%= render partial: 'layouts/page_header', locals: {ransack_q: @ransack_q, user_cart_product_num: @user_cart_product_num} %>
<%# 標題區 %>
<div class="flex items-center w-full rounded bg-marche_orange sm:mx-auto sm:w-10/12 mt-36">
<%# 標題 %>
<div class="w-10 my-2 ml-2 mr-4 border rounded-full">
<%= logo(@shop, size... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.