text stringlengths 184 4.48M |
|---|
use std::path::PathBuf;
use crate::config;
pub struct ServiceConfig {
pub data_dir: PathBuf,
pub repos_path: PathBuf,
pub data_path: PathBuf,
pub internal_path: PathBuf,
pub secrets: config::secrets::Secrets,
pub tokens: config::permissions::Tokens,
pub projects_store: config::projects::Pr... |
// require("dotenv").config();
import "dotenv/config";
import "express-async-errors";
import express from "express";
import path from "path";
import errorHandler from "./middleware/errorHandler";
import { logger } from "./middleware/logger";
import cors from "cors";
import cookieParser from "cookie-parser";
import cor... |
import Alert from "../components/Alert";
import ActionBar from "../components/ActionBar";
import ItemsGrid from "../components/ItemsGrid";
import { useQuery } from "@tanstack/react-query";
import useAxiosPrivate from "../hooks/useAxiosPrivate";
export default function Home() {
const axios = useAxiosPrivate();
cons... |
package mysql
import (
"database/sql"
"github.com/go-test/deep"
"github.com/joeycumines/go-sql/export"
_ "github.com/pingcap/tidb/types/parser_driver"
"reflect"
"strings"
"testing"
)
const (
schemaExample1 = `../../testdata/schema-example-1.json`
schemaExample1Query = "SE... |
import React, {useState} from "react";
import "./style.css";
import MoreFilter from "./MoreFilter";
import Button from "./Button";
import Category from "./Category";
import TaskModel from "./TaskModel";
import TaskContent from "./TaskContent";
const optionsList = [
{
value: "NONE",
label: "None",
color: ... |
package com.zenjava.playground.browser2.navigation;
import com.sun.javafx.css.StyleManager;
import com.zenjava.playground.browser.ActivityParameterException;
import com.zenjava.playground.browser2.activity.Activatable;
import com.zenjava.playground.browser2.activity.HasNode;
import com.zenjava.playground.browser2.acti... |
export const fetchData = async () => {
const response = await fetch("/api/client");
if (!response.ok) {
throw new Error("Failed to fetch data");
}
return response.json();
};
export const fetchEmployeeData = async () => {
const response = await fetch("/api/employee");
if (!response.ok) {
throw new Er... |
import { defineStore } from "pinia"
import { copy, isEmpty, uuid } from "@/utils/common"
import { wallpaperStore } from "@/plugins/localforage"
import { isImageFile } from "@/utils/img"
import { usePreferredDark } from "@/utils/use"
import { getDailyWallpaperUrl } from "@/api/bing"
import { isObjectURL } from "@/utils/... |
<?php
namespace App\DataTables\Admin\Master;
use App\Models\StatusKawin;
use Yajra\DataTables\Html\Button;
use Yajra\DataTables\Html\Column;
use Yajra\DataTables\Html\Editor\Editor;
use Yajra\DataTables\Html\Editor\Fields;
use Yajra\DataTables\Services\DataTable;
class StatusKawinDataTable extends DataTable
{
/*... |
//
// NewsService.swift
// Life
//
// Created by Shyngys Kassymov on 14.02.2018.
// Copyright © 2018 Shyngys Kassymov. All rights reserved.
//
import Foundation
import Moya
enum NewsService {
case topNews(top: Int)
case news(id: String)
case likeNews(withId: String)
case addCommentToNews(withId: S... |
<single-spa-router>
<!--
This is the single-spa Layout Definition for your microfrontends.
See https://single-spa.js.org/docs/layout-definition/ for more information.
-->
<!-- Example layouts you might find helpful:
<nav>
<application name="@org/navbar"></application>
</nav>
<route path="set... |
package com.example.hermes.ui.delivery
import android.app.Application
import androidx.lifecycle.viewModelScope
import com.example.hermes.R
import com.example.hermes.application.Hermes
import com.example.hermes.domain.models.Address
import com.example.hermes.domain.models.Order
import com.example.hermes.domain.usecase.... |
package com.itangcent.utils
/**
* A map of escape characters to their unescaped versions.
*/
private val escapeCharacters = mapOf(
'b' to '\b', // Backspace
't' to '\t', // Tab
'n' to '\n', // Newline
'r' to '\r', // Carriage return
'\\' to '\\', // Backslash
)
/**
* Used to convert es... |
import React, { Component } from "react";
import axios from "axios";
import "../JokeList.css";
import JokeItem from "./JokeItem";
export default class JokeList extends Component {
static defaultProps = {
numJokestoGet: 10,
};
constructor(props) {
super(props);
this.state = {
jokes: [],
l... |
var createError = require('http-errors');
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
var indexRouter = require('./routes/index');
var usersRouter = require('./routes/users');
var spRouter = require('./routes/sanpham');
var ... |
/**********************************************************************************
* @name CESS_helperMassiveTest
* @version 1.0
* @author María Dolores Sánchez Meroño - mdolores.sanchez@iecisa.com
* @creation date 16/11/2020
* @description Apex Class with test for CESS_helperMassive
* @group... |
'use client'
import { logOut } from "@/app/actions/logout"
import { useUiStore } from "@/store/ui-store"
import clsx from "clsx"
import { useSession } from "next-auth/react"
import Link from "next/link"
import { IoCloseOutline, IoLogInOutline, IoLogOutOutline, IoPeopleOutline, IoPersonOutline, IoReaderOutline, IoSearc... |
import MockDate from 'mockdate'
import { describe, expect, vi, it, beforeAll, afterAll } from 'vitest'
import { SaveSurveyResultController } from '@/presentation/controllers'
import { InvalidParamError } from '@/presentation/errors'
import { forbidden, ok, serverError } from '@/presentation/helpers'
import { faker } f... |
import * as PIXI from "pixi.js";
import Constant from "./Constants";
import { getReels, getReelStops, setStartReelsStopping } from "./Model";
import Reel from "./Reel";
import Resize from "./Resize";
export default class ReelsContainer extends Resize {
private reelsPanel: PIXI.Container;
private reelsContainer... |
export interface SettingsFromPage {
code_commands: CodeCommand[];
parse_commands: ParseCommand[];
expected_output_fields: ExpectedOutputFields;
input_schema: InputSchema;
}
export interface CodeCommand {
cmd: string;
args: Arg[];
summary: string;
description: string;
examples?: string[];
screenshot... |
#include "Beings/Shared/PICharacterBase.h"
#include "WaterBodyActor.h"
#include "Beings/Player/States/PIClimbingState.h"
#include "Beings/Shared/States/PIMovementState.h"
#include "Beings/Shared/States/PIStateBase.h"
void APICharacterBase::SetCurrentState(const TSharedPtr<FPIStateBase>& state)
{
auto setCurrentLamb... |
import type { BlogMeta } from 'types/types';
import { Fragment } from 'react';
import Blog from 'components/blog';
import Section from 'design-system/section';
import SignUp from 'components/sign-up';
import Head from 'next/head';
import pkg from '../package.json';
interface LayoutBlogProps {
blog: BlogMeta;
child... |
<div class="container-fluid">
<div class="row">
<div class="col ms-5 p-5">
<div class="row">
<div class="col">
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Escriba para filtrar...</mat-label>
... |
package com.fnmain.controller;
import com.fnmain.pojo.Result;
import com.fnmain.pojo.User;
import com.fnmain.service.UserService;
import com.fnmain.utils.JwtUtil;
import com.fnmain.utils.Md5Util;
import com.fnmain.utils.ThreadLocalUtil;
import jakarta.validation.constraints.Pattern;
import org.hibernate.validator.cons... |
import { GetServerSideProps } from "next"
import {
Box,
Button,
FormControl,
Grid,
MenuItem,
Select,
TextField,
Typography,
} from "@mui/material"
import { ShopLayout } from "@/components/layouts"
import { jwt, countries } from "@/utils"
import { useForm } from "react-hook-form"
import C... |
'use client'
import { useState } from "react"
import { useRouter } from "next/navigation"
import Link from "next/link"
import { signIn } from "next-auth/react"
export default function LoginForm () {
const router = useRouter()
const [data , setData] = useState({
email: "",
passw... |
import { ListItem, ListItemButton, ListItemIcon, ListItemText } from '@mui/material';
import { useRouter } from 'next/dist/client/router';
import { MouseEvent } from 'react';
import { BaseListItemProps } from '.';
const LinkListItem: React.FC<BaseListItemProps> = ({ item }) => {
const router = useRouter();
// rou... |
package com.bosen.product.controller.admin;
import com.bosen.common.constant.response.PageData;
import com.bosen.common.constant.response.ResponseData;
import com.bosen.product.service.IProductCategoryBrandService;
import com.bosen.product.vo.request.ProductCategoryBrandQueryVO;
import com.bosen.product.vo.request.Pro... |
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
import dash_table as dtb
import dash_daq as daq
from datetime import datetime, timedelta
from utils.dash_helpers import parse_options
import pandas as pd
import bing_maps_smartcity as bms
from data.bingmaps_da... |
package io.nagurea.smsupsdk.contacts.deduplicate;
import io.nagurea.smsupsdk.common.TestIntBase;
import io.nagurea.smsupsdk.common.status.ResponseStatus;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
... |
package com.example.myfitness.DataAccessObjects
import android.content.Context
import android.util.Log
import com.example.myfitness.utils.Hash
import com.google.android.gms.tasks.Task
import com.google.firebase.firestore.DocumentReference
import com.google.firebase.firestore.ktx.firestore
import com.google.firebase.kt... |
from argparse import ArgumentParser
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union, cast, no_type_check
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from numpy import ndarray
from pandas import DataFrame, Series
ROOT = Path(__file__).resol... |
<template>
<v-container>
<v-row>
<v-col>
<PhotoCard
:image_src="rex_ying_image_src"
name="Rex Ying"
role="Instructor"
></PhotoCard>
</v-col>
</v-row>
<v-row>
<v-col v-for="p in staff">
<PhotoCard v-bind="p" />
</v-col>
</v-r... |
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function ... |
import React from 'react';
import { graphql } from 'gatsby';
import styled from 'styled-components';
import SEO from '../components/SEO';
const BeersGridStyles = styled.div`
display: grid;
gap: 2rem;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
`;
const SingleBeerStyles = styled.div`
border: 1... |
<template>
<div class="rounded-2xl bg-white py-6 px-6 flex items-center justify-center">
<div class="flex flex-col items-center">
<h3
class="uppercase text-paperdazgray-500 font-semibold text-center mb-4 text-xl"
>
Free Account
</h3>
<div
class="circle circle-75 bor... |
# 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 in writing, software
# distributed under the... |
/*
LZ4 - Fast LZ compression algorithm
Copyright (C) 2011-present, Yann Collet.
BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
... |
import { useEffect, useState } from "react";
import { Chat } from "./components/core/Chat";
import Auth from "./components/core/Auth/Auth.tsx";
import {
getItemFromLS,
removeItemFromLS,
setItemToLS,
} from "./utils/localStorage.ts";
import SideBar from "./components/core/SideBar/SideBar.tsx";
import { Group, Priv... |
package noctiluca.features.authentication.templates.scaffold.instancedetail
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.material3.*
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
i... |
import { Component, Injectable, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { PoMenuItem, PoToolbarAction, PoToolbarProfile } from '@po-ui/ng-components';
import { FindEasyService } from './services/findEasy.service';
import { Utils } from './utils/functions.utils';
@Injectable({
p... |
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.linhv.repository.impl;
import com.linhv.pojo.PostComment;
import com.linhv.repository.PostCommentRepositor... |
import { ChangeDetectionStrategy, Component, AfterViewInit, ViewChild, ElementRef } from '@angular/core';
import { NbDialogRef } from '@nebular/theme';
import { ShopCardComponent } from '..';
import { ThreeJsService } from '../../services';
/**
* Компонент модального окна с информацией о точке, в которой находится ма... |
import React from "react";
import { Route, Routes } from "react-router-dom";
import Counter from "./Counter";
import PackagesUsed from "./PackagesUsed";
import ReduxThunk from "./ReduxThunk";
import TodoApp from "./TodoApp";
import Home from "../Pages/Home";
import Login from "../Pages/Login";
import Feeds from "../Pag... |
<a name="readme-top"></a>
# Node JS Learings
| Topics | Go to Topic |
| ----------- | ----------- |
| Event Loop and Async Patterns | <a href="#event-loop-and-async-patterns">Link</a> |
| Advanced express js : Template engines, serving static files | <a href="#advanced-express-js-template-engines-serving-static-file... |
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import pathOr from 'ramda/src/pathOr';
import { breakpointMedium } from 'config/styles/breakpoints';
const TemperatureInfo = ({ block }) => {
const [isCentigrade, setIsCentigrade] = useState(true);
let lowEnd = -10;
let highEnd =... |
import {Link} from "react-router-dom";
import styles from "./MovieCard.module.scss";
interface MovieCardProps{
id: number,
title: string;
overview: string;
popularity: number;
poster_path: string;
release_date: string;
vote_average: number;
vote_count: number;
image?: string;
}
con... |
/**
* BulletinBoard
* Copyright (c) 2017 - present Alexis Aubry. Licensed under the MIT license.
*/
import UIKit
/**
* An object that defines the appearance of bulletin items.
*/
@objc public class BLTNItemAppearance: NSObject {
// MARK: - Color Customization
/// The tint color to apply to the actio... |
import vidFrame1 from "../assets/video frame.png"
import link from "../assets/link.png"
import more from "../assets/more.png"
import { Link } from "react-router-dom"
import RepoHeader from "../components/repoHeader"
function Repo(params) {
const data = [
{
category: "Recent Files",
... |
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:valorant_fantasy/views/authentication_page/team_build_page/team_player_list_page.dart';
class TeamBuildPage extends StatelessWidget {
final String? playerName;
final String? teamInitials;
const TeamBuildPage({super.key, this.p... |
/**
* External dependencies
*/
import classNames from 'classnames';
/**
* WordPress dependencies
*/
import { useInstanceId } from '@wordpress/compose';
import { forwardRef } from '@wordpress/element';
/**
* Internal dependencies
*/
import BaseControl from '../base-control';
import InputBase from '../input-contr... |
import UIKit
import SnapKit
class TableViewController: UIViewController {
private var tableView = UITableView()
private var filteredContacts: [String] = []
let contacts = [
"Alice",
"Bob",
"Charlie",
"David",
"Eve",
"Frank",
"Grace",
"Ha... |
# Cheat sheet for RUN - SLEEP - STOP2 Hands on
How to reduce consutmption step by step on STM32U575 device in every operation mode!
## Reduce SRAM and Flash size in linker script
```c
MEMORY
{
RAM (xrw) : ORIGIN = 0x28000000, LENGTH = 16K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
}
```
##... |
import { BannerProps } from 'components/Banner'
import { GameCardProps } from 'components/GameCard'
import { GameItemProps } from 'components/GameItem'
import { HighlightProps } from 'components/Highlight'
import { BannerFragment } from 'graphql/generated/BannerFragment'
import { GameFragment } from 'graphql/generated/... |
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import App from "./App";
import * as serviceWorker from "./serviceWorker";
import reducer, { initialState } from "./reducer";
import { StateProvider } from "./StateProvider";
import { createRoot } from "react-dom/client"; // Import creat... |
import matplotlib.pyplot as plt
import os
# Assuming Env class is defined somewhere else and imported properly
from env import Env
def main():
game_types = ['basic', 'intermediate', 'hard']
task_volumes = [10, 50, 100]
plots_dir = "./plots"
if not os.path.exists(plots_dir):
os.makedirs(plots_... |
package com.github.zigcat.BlogPlatform.controllers;
import com.github.zigcat.BlogPlatform.models.AppUser;
import com.github.zigcat.BlogPlatform.models.AppUserRole;
import com.github.zigcat.BlogPlatform.models.Post;
import com.github.zigcat.BlogPlatform.repositories.AppUserRepository;
import com.github.zigcat.BlogPlatf... |
import './App.css';
import GalleryList from './containers/galleryList/GalleryList'
import { BackArrow, Categories, Container, Header, Overlay } from './AppStyles';
import { Link, Route, Switch } from 'react-router-dom';
import Gallery from './containers/gallery/Gallery';
import { api } from './api'
import { useEffect, ... |
package com.example.registeractivity;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class AddCustomer extends AppCompa... |
<!-- Write a script which moves a ball object, given the
speed = 5, and direction = 45 degrees
Set vx and vy –using the given angle and speed, and the trigonometric functions.
Move the x and y position of the ball according to vx and vy (remember that you are adding on the velocity variable at each frame iteration).... |
// /*
// * Copyright 2015 Adobe Systems Incorporated
// *
// * 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
// *
// ... |
import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
import { PasswordHashing } from "../../Authentication/PasswordHashing";
@Entity('Users')
export class User {
@PrimaryGeneratedColumn('uuid')
Id: string;
@CreateDateColumn({ type: 'timestamp with time zo... |
from ptydls.cluster.scheduler import JobStatus, Slurm
from ptydls.utils.helper import slurm_job_status
import typing
import time
from job_util import submission_manager
from util.config import config
from util import deployment_restrictions
UPDATE_CACHE_INTERVAL = 5
jtid_statuses_cache: typing.Dict[str, JobStatus] = ... |
package frc.robot;
/*
* MIT License
*
* Copyright (c) 2022 PhotonVision
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
... |
package com.luantang.socialmediaanalytics.dashboard.controller;
import com.luantang.socialmediaanalytics.dashboard.dto.facebook.*;
import com.luantang.socialmediaanalytics.dashboard.service.FacebookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
impor... |
package org.hyperledger.identus.presentproof.controller.http
import org.hyperledger.identus.api.http.Annotation
import org.hyperledger.identus.pollux.core.service.serdes.*
import org.hyperledger.identus.presentproof.controller.http.RequestPresentationInput.annotations
import sttp.tapir.{Schema, Validator}
import sttp.... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "logic.h"
/**
* @file life.c
*
* @author Maya Savino
*
* @date 05/03/2023
*
* Assignment: Final - Conway's Game of Life
*
* @brief logic for game of life
*
* @bugs -x option sometimes induces a seg fault, typecasing issue
*
* @todo fix -x... |
//
// CoinListView.swift
// CryptoTracker
//
// Created by Marvis Ighedosa on 20/12/2023.
//
import SwiftUI
struct CoinListView: View {
let coin: CoinModel
var showPortfolioView:Bool = false
var body: some View {
HStack{
leftItem
Spacer()
if... |
import React, { useState } from 'react';
import axios from 'axios';
import { CopyToClipboard } from 'react-copy-to-clipboard';
import { Container } from '../../globalStyles';
import {
InputContainer,
InputDiv,
Form,
FormInput,
InputSubmit,
Msg,
ShortedUrlDiv,
ShortUrl,
LongUrl,
CopyBtn,
ShortUrlDiv,
} from ... |
import pandas as pd
from sklearn.metrics.pairwise import cosine_similarity
import shelve
class NetworkPair:
# Each NetworkPair instance record previous attacking informtion related to a specific connection
def __init__(self, amount: int, attack_amount: int, comm_id: str) -> None:
self.amount = amount ... |
export class Util {
static deepCopy = <T>(target: T): T => {
if (target === null) {
return target;
}
if (target instanceof Date) {
return new Date(target.getTime()) as any;
}
if (target instanceof Array) {
const cp = [] as any[];
... |
= 같은 객체에 대한 여러 변수의 참조
* 하나의 객체에 대한 여러 변수의 참조
** 두 참조 변수에서 읽기/쓰기는 같은 객체에 적용됨
image:./images/image04.png[]
[source, java]
----
BankAccount account = new BankAccount();
account.accountNumber = 1;
account.ownerName = “James”;
BankAccount account2 = account;
System.out.println(account2.accountNumber);
System.out.println(... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from gsfanalysis.statistics import mode
from scipy.stats import skew
def quantile_interval(data, q, midpoint=0):
sorted_data = np.sort(data - midpoint)
q = np.quantile(abs(sorted_data), q)
interval = (
midpoint + sorted_data[s... |
import { Box, Icon, Text } from '@chakra-ui/react';
import { HeadProps, Link, PageProps, graphql } from 'gatsby';
import React from 'react';
import { IoTodayOutline, IoTrophyOutline } from 'react-icons/io5';
import { Card, CommonHead } from '../components';
import { useContent, useHead } from '../hooks';
import { form... |
import useUser from '@/hooks/useUser';
import { profileMessages } from '@/translations/profile';
import Head from 'next/head';
import React, { Fragment } from 'react';
import { useIntl } from 'react-intl';
import InactiveAlert from './components/InactiveAlert';
import ChangePassword from './components/ChangePassword/Ch... |
import { React, useState, useEffect } from "react";
import { v4 as uuidv4 } from "uuid";
const Checklist = () => {
// const [notes, setNotes] = useState(initNotes);
const [notes, setNotes] = useState("");
// const [obj, setObj] = useState(getInitObj());
// получение данных из localStorage
const [localItem, ... |
import { useState } from "react";
import { Box, Button, Card, TextField } from "@material-ui/core";
import { updatePassword } from "../../../../actions/updateProfile";
const ProfilePassword = () => {
const [password, setPassword] = useState("");
const [passwordVer, setPasswordVer] = useState("");
const [error, s... |
const express = require('express');
const router = express.Router();
const roleController = require('../Controllers/roleController');
const { verifyToken, isAdmin } = require('../middleware/authMiddleware'); // Importer les middlewares
/**
* @swagger
* tags:
* name: Roles
* description: Roles CRUD
*/
/**
*... |
import React, { useEffect, useState } from "react";
import { Form, FormGroup, Input, Button, Container, Row, Col, Label } from 'reactstrap';
import { IoIosAddCircleOutline } from "react-icons/io";
import { Modal, ModalHeader, ModalBody } from "reactstrap";
import { useNavigate } from "react-router-dom";
import Paginati... |
import { AdminRepo, IAdminAllResponse } from '../repo/admin'
import Admin, { IAdmin } from '../../models/Admin'
import { logger } from '../../config/logger'
import AppError from '../../utils/appError'
export class AdminStorage implements AdminRepo {
private scope = 'storage.admin'
async find(query: Object): P... |
package function;
public class Ex03 {
// 함수 만들기
// 1. 함수의 호출부분이 있으면 복사해서 정의할 부분으로 가져온다.
// 함수 호출 부분이 대입식이라면 좌변과 우변의 자료형이 같아야함을 이용하여 반환형을 결정함.
static int summary(int from, int to) {
int sum = 0;
for(int i = from; i <= to; i++) {
sum += i;
}
return sum;
}
// This method must return a result of type ... |
/*
* Copyright (c) 2023 Airbyte, Inc., all rights reserved.
*/
package io.airbyte.cdk.integrations.destination.s3.avro
import io.airbyte.cdk.integrations.destination.s3.avro.JsonSchemaType.Companion.fromJsonSchemaType
import java.util.stream.Stream
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api... |
import 'package:auto_route/auto_route.dart';
import 'package:carousel_slider/carousel_slider.dart';
import 'package:domain/domain.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../../bloc/home_bloc.dart';
import 'widgets/book_card_item.dart';
import 'widgets/car... |
import React, { useEffect, useState } from "react";
import { useSelector, useDispatch } from "react-redux";
import { selectProduct } from "../Feautures/products/productSlice";
const columns1 = [
{
Header: "SELECT",
accessor: "select",
},
{
Header: "ID",
accessor: "id",
},
{
Header: "TITLE... |
<section>
<div class="container mt-md-5">
<div class="d-flex justify-content-between mb-4 posts-header">
<div class="article-title"> My Posts </div>
<a href="/new-post"> Write a post </a>
</div>
<div class="container-fluid py-1 mb-1 posts-nav border-bottom">
<ul class="nav contain... |
import React, { lazy,Suspense } from "react";
import ReactDOM from "react-dom/client"
import reslogo from "../images/reslogo.jpg"
import Header from "./components/Header";
import Body from "./components/Body";
import { createBrowserRouter,RouterProvider,Outlet } from "react-router-dom";
import About from "./components... |
import { Link } from 'react-router-dom';
import Carousel from 'react-bootstrap/Carousel';
import KidsCloths from '../../../assets/images/kids-ethnic-dress.jpg';
import MensCloths from '../../../assets/images/men-shirt.jpg';
import WomenCloths from '../../../assets/images/women-dress.jpg';
import './LiveOffersCarousel.c... |
import pygame
import os
pygame.font.init()
pygame.mixer.init()
pygame.display.set_caption("SPACE INVADERS")
WIDTH, HEIGHT = 900, 500
WINDOW = pygame.display.set_mode((WIDTH, HEIGHT))
SPACESHIP_WIDTH = 55
SPACESHIP_HEIGHT = 40
BORDER = pygame.Rect(WIDTH//2-5, 0, 10, HEIGHT)
YELLOW_HIT = pygame.USEREVENT + 1
RED_HIT = ... |
import { io } from "socket.io-client"
import { useAuth } from "../hooks/auth"
import { useEffect, useState } from "react"
import { useParams} from "react-router-dom"
import { CommentsList, Footer, Header, InputLarge } from "../components"
import { FindByIdTopics } from "../services/topics.services"
export const TopicP... |
"use client"; // Error components must be Client Components
import { Alert, Button, Center, Flex, Text } from "@chakra-ui/react";
import { useEffect, useState } from "react";
import { BloatcareIcon } from "./components/Icons/Components/IconComponents";
import { motion } from "framer-motion";
export default function E... |
'''
This algo is a homemade implemantation of the SVM
Tutorial:
https://pythonprogramming.net/svm-in-python-machine-learning-tutorial/?completed=/svm-constraint-optimization-machine-learning-tutorial/
'''
import matplotlib.pyplot as plt
from matplotlib import style
import numpy as np
style.use('ggplot')
class SVM:
... |
import React from "react";
import ButtonComponent from "@mui/material/Button";
type props = {
width?: string;
label: string;
headlight?: boolean;
disabled?: boolean;
onClick?: () => void;
type?: 'button' | 'submit';
};
export const Button = ({ width, label, headlight,disabled, onClick,type }: props) => {
... |
import { Slide, Heading, Appear, Text, Notes } from "spectacle";
import { Draggable } from "../components/Draggable";
export const MemoSlide: React.FC = () => {
return (
<Slide>
<Heading>React.memo</Heading>
<Appear>
<Text>
If your component is pure, you can avoid rendering it by us... |
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/mman.h>
int main()
{
int fbfd = 0;
struct fb_var_screeninfo vinfo;
struct fb_fix_screeninfo finfo;
long int screensize = 0;
char *fbp = 0;
int x = 0, y = 0;
long int location = 0;
// Open the ... |
## GP-Bart
#' @useDynLib spBART7
#' @importFrom Rcpp sourceCpp
#'
# Getting the BART wrapped function
#' @export
rbart <- function(x_train,
y,
x_test,
n_tree = 2,
n_mcmc = 2000,
n_burn = 500,
alpha = 0.95,
... |
This file will contain links for additional materials that I found interesting while doing FSDL
### Lab 00:
- [What is Serverless? (Blog Post)](https://sst.dev/chapters/what-is-serverless.html)
### Lab 01:
- [Probability - Math for Machine Learning (Video)](https://www.youtube.com/watch?v=LBemXHm_Ops&ab_channel=Weight... |
using FuryRent.Core.Contracts;
using FuryRent.Core.Services;
using FuryRent.Infrastructure.Data;
using FuryRent.Infrastructure.Data.Models;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
namespace Microsoft.Extensions.DependencyInjection
{
public static class ServiceCollectionExtension... |
from oemof.thermal_building_model.tabula.tabula_reader import Building
from oemof.thermal_building_model.m_5RC import M5RC
from oemof.solph import views
import oemof.solph as solph
def test_building_optimization():
# create solver
solver = "cbc" # 'glpk', 'gurobi',....
solver_verbose = False # show/hi... |
<?php
namespace App\Http\Controllers;
use App\Models\TipoDocumento;
use App\Http\Requests\StoreTipoDocumentoRequest;
use App\Http\Requests\UpdateTipoDocumentoRequest;
use Inertia\Inertia;
use Illuminate\Http\Request;
class TipoDocumentoController extends Controller
{
/**
* Display a listing of the resource.... |
# Facades
[[toc]]
## 简介
`facades` 为应用的核心功能提供一个「静态」接口,能够提供更加灵活、更加优雅、易于测试的语法。
Goravel 所有的 `facades` 都定义在 `github.com/goravel/framework/facades` 下。我们可以很轻松的使用 `facades`:
```go
import "github.com/goravel/framework/facades"
facades.Route().Run(facades.Config().GetString("app.host"))
```
## facades 工作原理
`facades` 一般会在... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.