text stringlengths 184 4.48M |
|---|
import pytest
import numpy as np
from itertools import product
from .. import states
QUBITS = []
for i in range(1, 4):
qubits_i = [s for s in product(states.QBIT_MATRICES.keys(), repeat=i)]
QUBITS.extend(["|" + "".join(s) + ">" for s in qubits_i])
QUBITS.extend(["-|" + "".join(s) + ">" for s in qubits_i])... |
Use Case: Use MVAPICH2 (message passing interface for InfiniBand version 2) for running parallel programming applications in a cluster.
Code details and examples:
Code:
To illustrate the usage of this software let's take a simple MPI code which finds the maximum number in a list.(max.c)
```C
#include <stdio.h>
#i... |
<h1 align="center">
🦅 Dramatiq Header Middleware for RabbitMQ
</h1>
# 🛠 Installation
```sh
pip install dramatiq-header
```
# ⬆️ Upgrade version
```sh
pip install dramatiq-header --upgrade
```
# ✏️ Usage
## Worker code:
```py
import dramatiq
from dramatiq.brokers.rabbitmq import RabbitmqBroker
from dramat... |
#https://leetcode.com/problems/high-access-employees/description/
"""
2933. High-Access Employees
Medium
You are given a 2D 0-indexed array of strings, access_times, with size n. For each i where 0 <= i <= n - 1, access_times[i][0] represents the name of an employee, and access_times[i][1] represents the access time o... |
#!/usr/bin/env node
//this is nodejs shebang syntax
let inputArr=process.argv.slice(2);
let fs=require("fs");
const path = require("path");
console.log(inputArr);
//node main.js tree "directoryPath"
//node main.js organize "directoryPath"
//node main.js help
let command=inputArr[0];
switch(command) {
case "tree":
... |
package com.ssafy.soltravel.v2.controller;
import com.ssafy.soltravel.v2.dto.ResponseDto;
import com.ssafy.soltravel.v2.dto.group.GroupDto;
import com.ssafy.soltravel.v2.dto.group.ParticipantDto;
import com.ssafy.soltravel.v2.dto.group.request.CreateGroupRequestDto;
import com.ssafy.soltravel.v2.dto.group.request.Crea... |
import styled from "styled-components";
import Heading from "../../components/layout/Heading";
import PostFeatureItem from "../post/PostFeatureItem";
import React from "react";
import {
collection,
limit,
onSnapshot,
query,
where,
} from "firebase/firestore";
import { db } from "../../firebase-app/f... |
"use client"
import React, { useState } from 'react'
import Navbar from '@/components/Navbar'
import Hero from "@/components/hero/index"
import Company from "@/components/partner/index"
import Courses from "@/components/courses/index"
import HowWork from "@/components/howtowork/index"
import Feature from "@/components/... |
<?php
namespace App\Http\Controllers;
use App\Models\Categoria;
use Illuminate\Http\Request;
class CategoriaController extends Controller
{
/**
* Muestra la lista de categorías.
*/
public function index()
{
$categorias = Categoria::all();
return view('categorias.index', compact(... |
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { BookEntity } from 'src/entities/book.entity';
import { Repository } from 'typeorm';
import { BookItemDto } from './dto/book.item.dto';
import { BookCreateDto } from './dto/book.create.dto';
import { BookUpdateDto }... |
package com.vobi.bank.service;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import javax.validation.Validator;
import org.springframework.beans.factory.annotation.Autowired;
import org.spring... |
const express = require('express');
const SocketServer = require('ws').Server;
const WebSocket = require('ws');
const uuidv4 = require('uuid/v4');
// Set the port to 3001
const PORT = 3001;
// Create a new express server
const server = express()
// Make the express server serve static assets (html, javascript, css... |
import pandas as pd
def new_col(stat: pd.Series, n_matches: pd.Series) -> float:
"""
Calculate the weighted average of a statistic.
Parameters
----------
stat : pandas.Series
The statistic to calculate the weighted average for.
n_matches : pandas.Series
The number of matches f... |
import SortField from './SortField';
import SortOrder from './SortOrder';
export default function getProducts(
productsFromServer,
categoriesFromServer,
usersFromServer,
selectedUserId,
selectedCategoriesId,
query,
sortField,
sortOrder,
) {
let result = [...productsFromServer];
result = result.fil... |
<template>
<h1>Here are our Professionals</h1>
<div>
<filter-caretakers @change-filter="applyFilters"> </filter-caretakers>
</div>
<div>
<button @click="loadCaretakers()">Refresh</button>
<button v-if="isCaretaker">
<router-link to="requests"> Received</router-link>
</button>
<div clas... |
library(ggplot2)
library(ggsci)
library(rstan)
library(bayesplot)
library(reshape2)
library(dplyr)
library(tidyr)
library(loo)
library(deSolve)
theme_set(theme_classic())
compare_parameters = function(data1, data2, name1, name2, params_in_both = c("sigma","alpha","b_A","b_P","b_F","c_A","c_P","c_F","b","a_FP","a_FA",... |
// src/__tests__/FAQSection.test.jsx
import { render, screen, fireEvent } from '@testing-library/react';
import FAQSection from '../components/FAQSection';
describe('FAQ Section', () => {
test('renders the FAQ title', () => {
render(<FAQSection />);
const titleElement = screen.getByText(/Frequently Asked Que... |
man7.org > Linux > man-pages
Linux/UNIX system programming training
* * *
# fold(1p) -- Linux manual page
PROLOG | NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | STDIN | INPUT
FILES | ENVIRONMENT VARIABLES | ASYNCHRONOUS EVENTS | STDOUT | STDERR | OUTPUT
FILES | EXTENDED DESCRIPTION | EXIT STATUS | CONSEQUENCES... |
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org" lang="zh">
<head>
<title th:text="${sectionName}+'-嘟嘟社区'"></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/bootstrap-theme.css">
... |
<?php
namespace Tests\Unit;
use App\Models\Categoria;
use App\Models\Producto;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class ProductoTest extends TestCase
{
use RefreshDatabase;
protected $categoria;
protected $otraCategoria;
protected $producto;
public function s... |
import React from "react";
import clsx from "clsx";
import LoadingSpinner from "./LoadingSpinner";
import styles from "./LoadingOverlay.module.scss";
export default function LoadingOverlay({
text = "Loading...",
relativePosition = false,
}: {
text?: string;
relativePosition?: boolean;
}): React.ReactElement {
... |
package Project2;
import java.util.Scanner;
class BankAccout{
String name;
String userName;
String password;
String accountNo;
float balance = 1000000f;
int transactions = 0;
String transactionHistory = "";
public void register() {
Scanner sc = new Scanner(System.in);
System.out.println("\nEnter your N... |
const { NotAllowedError } = require("../../errors");
const logger = require("../../logger");
const { encrypt62 } = require("../../utils/encrypt.util");
const {
StudyroomChat,
User,
StudyroomMember,
Sequelize,
} = require("../../models");
const getChatByCursor = async ({ studyroom_id, cursor = null, user_id }) ... |
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h2>Intent Aware Recommender Systems</h2>
<p align="center">
<img src="intentAware.webp" width="300", title="Intent Aware Recommender Systems">
</p>
<h3>Introduction</h3>
<p align="justify">This reproducibility package was prepared for the paper titled "Performance C... |
import { useCallback, useRef, useState } from "react";
import { searchMovies } from "../services/getMovies";
import Movies from "../interfaces/movie";
import { searchMovieByID } from "../services/getMoviesByID";
export default function useMovies ({search, id}:{search: string, id: string}){
const [movies, setMovies... |
/*
* Copyright 2022-2023 the original author or authors.
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... |
import 'package:get/get.dart';
import 'package:kesehatan/app/modules/login/views/login_view.dart';
import 'package:kesehatan/app/modules/profile/views/profile_view.dart';
import '../modules/home/bindings/home_binding.dart';
import '../modules/home/views/home_view.dart';
import '../modules/login/bindings/login_binding.... |
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JS 14-03 QuerySelector</title>
<style>
div {
margin: 10px;
}
.btn {
width: 100px;
h... |
package util
import exception.NullArgumentException
/**
* Miscellaneous utility functions.
*
* @author haokangkang
* @see Precision
*/
object MathUtils {
/**
* Returns an integer hash code representing the given double value.
*
* @param value the value to be hashed
* @return the hash code... |
import React, { useState, useEffect } from "react";
import { toast, ToastContainer } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
const GradeForm = ({ cohort }) => {
const [modules, setModules] = useState([]);
const [selectedModule, setSelectedModule] = useState("");
const [grade, setGr... |
'use strict';
const express = require('express');
const graphqlHTTP = require('express-graphql');
const {
GraphQLSchema,
GraphQLObjectType,
GraphQLID,
GraphQLString,
GraphQLInt,
GraphQLBoolean
} = require('graphql');
const { log, warn } = require('../utils');
const PORT = process.env.PORT ||... |
import { z } from 'zod';
import { createZodDto } from '../utils/createZodDto';
// Define the Health schema using Zod
export const HealthSchema = z.object({
status: z.string(),
timestamp: z.string().datetime(),
version: z.string().optional(),
uptime: z.number().optional(),
memory: z
.object({
used: ... |
import React, { useState, useEffect } from 'react'
import { useSelector } from 'react-redux'
import AutoSizer from 'react-virtualized-auto-sizer'
import { connectedInstanceSelector, connectedInstanceOverviewSelector } from 'uiSrc/slices/instances/instances'
import { pubSubSelector } from 'uiSrc/slices/pubsub/pubsub'
i... |
'use server';
import { getServerAuthSession } from '@repo/auth/server';
import { prisma } from '@repo/db';
import type { CommentRoot } from '@repo/db/types';
const PAGESIZE = 10;
const sortKeys = ['createdAt', 'vote', 'replies'] as const;
const sortOrders = ['asc', 'desc'] as const;
export type SortKey = (typeof sor... |
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # Writing a for loop and methods for avoiding loops # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # #... |
<template>
<div>
<div v-if="getCategory != null">
<div class="banner banner-cat" style="background-image: url('assets/images/banners/banner-top.jpg');">
<div class="banner-content container">
<h2 class="banner-subtitle">check out over <span>200+</span></h2>
... |
import SmallCard from "./SmallCard";
import css from "./SmallCardGrid.module.css";
interface CardData {
title: string;
icon: string;
href?: string;
onClick?: () => void;
}
interface SmallCardGridProps {
cards: Array<CardData>;
}
const SmallCardGrid: React.FC<SmallCardGridProps> = (
props: SmallCardGridPr... |
package org.tpjava.emsbackend.model;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@Entity
@Table(name = "products")
public class Product {
@Id
@GeneratedValue... |
import React, { useState } from "react";
import Dialog from "@mui/material/Dialog";
import DialogActions from "@mui/material/DialogActions";
import DialogContent from "@mui/material/DialogContent";
import DialogContentText from "@mui/material/DialogContentText";
import DialogTitle from "@mui/material/DialogTitle";
impo... |
package app.commands.executables;
import app.commands.Executable;
import app.io.nodes.Node;
import app.io.nodes.input.InputNode;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import library.Library;
import library.entities.audio.audioFiles.Song;
import library.users.User;
import lombok.Getter;
import lomb... |
package assign03;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
/**
* CS 1420 Assignment 3
*
* @author Zifan Zuo
* @version Sep 9, 2024
*/
public class GradeCalculator {
public static void main(String[] args) {
// to get a valid input file
Scanner file;
do {
Sy... |
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min... |
Semantic Policy Difference Tool for Security Enhanced Linux
Overview:
---------
The sediff and sediffx programs are policy analysis tools that take
two policies and compare them, showing a list of the differences. The
former is a command-line only program while the latter is a GTK+
application. They can compare sou... |
import copy
import functools
import gc
import inspect
import logging
import os
import warnings
import numpy as np
from astropy.convolution import convolve_fft
from astropy.io import fits
from astropy.nddata.bitmask import interpret_bit_flags, bitfield_to_boolean_mask
from astropy.stats import sigma_clipped_stats, Sigm... |
using Google.Apis.Auth.OAuth2;
using Google.Apis.Drive.v3;
using Google.Apis.Services;
using Google.Apis.Util.Store;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.W... |
### 第十五关挑战:海量场景问题该如何解决
* 原题目:给定一个输入文件,包含40亿个非负整数,请设计一个算法,产生一个不存在该文件中的整数,假设你有1GB的内存来完成这项任务。
* 现在请你思考:让你将这40亿中不存在的整数,全部找出来,该如何做?
## 解题过程
看到`40亿`数据就知道是`海量数据类型`题目,考虑使用`位存储`、`分块处理`、`堆`等方式。
* __明确限制条件__:1GB内存
* __明确大致做法__:遍历数据,统计并存储每个数是否存在的情况,最后遍历输出不存在的值。
* __考虑使用位存储__:对于每个整数,只有存在和不存在两个状态,正好可以使用二进制位的值1、0来表示。所以每个整数的状态存储仅需占... |
import React from "react";
import Home from "../Pages/Home";
import { Routes, Route } from "react-router-dom";
import AllProducts from "../Pages/AllProducts";
import Men from "../Pages/Men";
import Women from "../Pages/Women";
import DescriptionPage from "../components/Description/DescriptionPage";
import AllshoesD fro... |
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { InferRequestType, InferResponseType } from "hono";
import { toast } from "sonner";
import { client } from "@/lib/hono";
type ResponseType = InferResponseType<typeof client.api.objectivemembers["bulk-create"]["$post"]>;
type RequestType = In... |
package iat.alumni.controller;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springfr... |
import {
Body,
Controller,
Delete,
HttpStatus,
InternalServerErrorException,
Param,
Post,
Req,
UseGuards,
} from '@nestjs/common';
import { ObjectId } from 'mongodb';
import { AuthenticationGuard } from 'src/common/guards/authentication.guard';
import {
AuthorizationGuard,
Ro... |
import fetch from 'node-fetch';
import { writeFileSync } from 'fs';
async function fetchAndWriteGoogleBooksData() {
try {
const googleBooksUrl = 'https://www.googleapis.com/books/v1/volumes';
const apiKey = "AIzaSyAOrXNWOcB5bNoZTgrlMiZR9lBl6OOJQ4Y"
const queryParams = {
q: 'les coulisses du footbal... |
/*
* Copyright (C) 2020 The Android Open Source Project
*
* 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 app... |
export class Binatang {
constructor(public name: string, public isCarnivore: boolean) {}
makan(): void {
console.log("Binatang makan");
}
}
export class Katak extends Binatang {
constructor(name: string, isSwimming: boolean, public color: string) {
super(name, isSwimming)
}
ma... |
import { Route,Routes } from "react-router-dom";
import {useEffect} from 'react';
import {useDispatch} from 'react-redux';
import {getallProperties, getCities,getCitiesA} from './redux/actions/index';
import Landing from "./pages/landing/Landing.jsx";
import Home from './pages/home/Home.jsx';
import Detail from "./page... |
# Data Warehouse, Introduzione
Sono basi dati usate per il supporto alle decisioni, e sono mantenute separate dalle basi dati operative dell'azienda.
I dati contenuti all'interno di un data warehouse sono **orientati ai soggetti di interesse**, **consistenti** e **durevoli nel tempo** e sono d'aiuto per le decisioni a... |
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:google_nav_bar/google_nav_bar.dart';
import '../../../../core/constants/colors.dart';
class NavBar extends StatelessWidget {
const NavBar({super.key});
@override
Widget build(BuildContext contex... |
import React from 'react'
import Image from 'next/image';
import ArrowUpRightIcon from '@heroicons/react/20/solid/ArrowUpRightIcon';
interface Props {
learnWeb3NFTs: any;
buildSpaceNFTs: any
}
function NFTCard({ learnWeb3NFTs, buildSpaceNFTs }: Props) {
return (
<div className="mx-auto max-w-2x... |
import 'package:flutter/material.dart';
import 'package:toikhoe/MainScreen/bac_si_detail_screen.dart';
import 'package:toikhoe/MainScreen/bs_info_screen.dart';
import 'package:toikhoe/database/fetch_user_doctor.dart';
class FavoriteDoctorsScreen extends StatefulWidget {
@override
_FavoriteDoctorsScreenState create... |
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "list.h"
typedef struct Node Node;
struct Node {
void * data;
Node * next;
Node * prev;
};
struct List {
Node * head;
Node * tail;
Node * current;
};
typedef List List;
Node * createNode(void * data) {
Node * new = (Nod... |
import { defaultAfterAll, defaultAfterEach, defaultBeforeAll, defaultBeforeEach, haveNoAdditionalKeys } from "../utilities/setup";
import { Db, MongoClient } from "mongodb";
import { BaseSchema } from "@uems/uemscommlib";
import { EquipmentDatabase } from "../../src/database/EquipmentDatabase";
import Intentions = Base... |
import { Fragment, useContext, useEffect, useRef, useState } from "react"
import { useRouter } from "next/router"
import { Event, getAllLocalStorageItems, getRefValue, getRefValues, isTrue, preventDefault, refs, set_val, spreadArraysOrObjects, uploadFiles, useEventLoop } from "/utils/state"
import { EventLoopContext, i... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>About Me Section</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f9;
display: flex;
fl... |
// Copyright 2020-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import * as React from 'react';
import 'react-quill/dist/quill.core.css';
import { boolean, select } from '@storybook/addon-knobs';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
i... |
import numpy as np
import pandas as pd
import eq_parameters
import state_variables
def cauchy_function(t: float, y: np.array, constants: dict) -> np.array:
"""The derivative y'(t) = [V'(t), m'(t), h'(t), n'(t)] of the Cauchy's initial problem.
Args:
t (float): instante of time t
y (float): fun... |
<template>
<v-row>
<v-col md="8" offset-md="2">
<admin-store></admin-store>
</v-col>
<v-col md="10" offset-md="1">
<v-data-table :headers="headers" :loading="loading" :items="admins" :items-per-page="10">
<template v-slot:item.state="{ item }">
{{ item.state.name }}
<... |
from NavigoPlatform.CommonBase.BasePage import BasePage
from selenium.webdriver.common.by import By
class CreateAirCraftPage(BasePage):
LOCAircraftTab = (By.XPATH, "//*[@id='root']/div/div[2]/div/div/div[1]/div[3]")
LOCAvailableAircraftTab = (By.XPATH, "//*[@id='root']/div/div[2]/div/div/div[2]/div/div/div[1]... |
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.EntityFrameworkCore;
using MidStateShuttleService.Models;
using MidStateShuttleService.Service;
namespace MidStateShuttleService.Controllers
{
public... |
import * as React from 'react';
import {ChangeEvent, useCallback, useState} from 'react';
import {createRoot} from 'react-dom/client';
import {Provider} from 'react-redux';
import {Route, HashRouter, Link, Routes} from 'react-router-dom';
import Chooser from './components/Chooser';
import Footer from './components/Foot... |

export class CollectionController {
constructor(private readonly collectionService: CollectionService) {}
@Get()
async getAllCollect... |
import { useState } from "react";
function RecipeForm() {
const [newRecipeName, setNewRecipeName] = useState("");
async function addRecipe() {
if (newRecipeName.trim() !== "") {
try {
const response = await fetch("http://localhost:8080/api/v1/recipes", {
method: "POST",
heade... |
package org.cdlib.xtf.dynaXML;
/**
* Copyright (c) 2004, Regents of the University of California
* 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 ... |
'use client';
import { Tooltip } from 'react-tooltip'
import { IconType } from "react-icons";
// import { randomUUID } from 'crypto';
import { v4 as uuidv4 } from 'uuid';
import { toast } from 'react-hot-toast';
interface ButtonProps {
label?: string;
onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
... |
# application support center - iOS Demo App

This is a simple but complete iOS app which includes the asc SDK to demonstrate the integration between the app and server. If configured correctly, the app will display the help pages, app contacts announcements and release n... |
import pandas as pd
import numpy as np
import os
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from keras.models import Sequential
from keras.layers.embeddings import Embedding
from keras.layers.core import Dense, initializers, Dropout, Masking
from keras.layers.r... |
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any la... |
package synth;
import java.io.InputStream;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
public class Sample {
private final int sampleRate;
private final int baseMidiNote;
private final int loopStart;
private final int loo... |
var express = require('express');
var router = express.Router();
const { PrismaClient } = require('@prisma/client');
const { parseGoal } = require('../utils/parseGoal');
const prisma = new PrismaClient();
/* GET users listing. */
router.get('/', async (req, res) => {
try {
const goals = await prisma.goal.findMa... |
package com.food.recipes.services;
import com.food.recipes.model.User;
import com.food.recipes.model.dto.security.AuthenticationRequest;
import com.food.recipes.model.dto.security.AuthenticationResponse;
import com.food.recipes.model.dto.security.RegisterRequest;
import com.food.recipes.model.enums.Role;
import com.fo... |
package main
import (
"fmt"
"sync"
"testing"
)
/*
Pool -> implementasi design pattern bernama object pool pattern
sederhananya, design pattern ini digunakan untuk menyimpan data, selanjutnya untuk menggunakan datanya kita bisa mengambil dari pool, dan selesai menggunakan kita bisa menyimpan kembali ke Poolnya
impl... |
// In an online shopping application, customers can add items to their shopping cart. Implement a
// class ShoppingCart with a method addItem that adds items to the cart. If the customer attempts
// to add an item with a negative quantity or an invalid product code, throw appropriate exceptions
// (NegativeQuantityExce... |
use crate::common::card::{AuctionType, Card, CardColor};
use leptos::ev::DragEvent;
use leptos::*;
pub const CARD_ID_FORMAT: &'static str = "mart/card";
#[component]
pub(crate) fn CardView(
card: Card,
#[prop(optional)] selectable: bool,
#[prop(optional)] display_only: bool,
) -> impl IntoView {
let s... |
import os
import openai
from openai import OpenAI
class ChatGPT:
def __init__(self, api_key_path: str):
with open(api_key_path, 'r') as arquivo:
# Lê o conteúdo do arquivo
conteudo = arquivo.read()
openai.api_key = conteudo
self.messages = []
def add_message(... |
// 04_GoBananas
// Author: https://github.com/Mark-MDO47/
//
// The core algorithm is from https://playground.arduino.cc/Code/CapacitiveSensor/
// Here is the code history from that page
// * Original code by Mario Becker, Fraunhofer IGD, 2007 http://www.igd.fhg.de/igd-a4
// * Updated by: Alan Chatham http://unojoy.tum... |
Flying PhotoBooth
The source code for the Android applications **Flying PhotoBooth** and **Party PhotoBooth**.
## Flying PhotoBooth <a href="https://play.google.com/store/apps/details?id=com.groundupworks.flyingphotobooth&utm_source=global_co&utm_medium=prtnr&utm_content=Mar2515&utm_campaign=PartBadge&pcampaignid=M... |
# Creation of EU-HYDI database structure according to guidelines EUHYDI_v1.1.pdf and example file EUHYDI_v1.1_example.xls
#
# Author: M. Weynants
# Date created: 2012/11/09
# Last update: 2012/11/22
######################################################################
# load packages
# load functions
source('general... |
require 'rails_helper'
RSpec.describe ResponseSerializer do
context 'attributes' do
describe 'votes' do
it 'should only return the votes from current game' do
prompt = create(:prompt)
correct_response = create(:response, prompt: prompt, game: nil, correct: true)
game = create(:game... |
#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
using namespace std;
const int ESTIMATE_INPUT_SIZE = 16;
int left_child_of(int node_index) {
return 2 * node_index + 1;
}
int parent_of(int node_index) {
return (node_index - 1) / 2;
}
// Repair the heap whose root element is at ... |
import React from "react";
import { Link } from "react-scroll";
import { useState } from "react";
import "./Navbar1.scss";
import logo from "../../assets/Logo/black-logo.png";
import { IoMenu } from "react-icons/io5";
import { IoClose } from "react-icons/io5";
import { motion, AnimatePresence } from "framer-motion";
c... |
#include "variadic_functions.h"
#include <stdarg.h>
/**
* sum_them_all - Returns the sum of all its paramters.
* @n: The number of argument passed to the function.
* @...: A variable number of paramters to calculate the sum of.
*
* Return: If neutral
*/
int sum_them_all(const unsigned int n, ...)
{
va_list vr;
... |
<!DOCTYPE html>
<html
lang="en"
xmlns:th="http://www.thymeleaf.org"
xmlns:sec="https://www.thymeleaf.org/thymeleaf-extras-springsecurity5"
>
<head>
<meta charset="utf-8" />
<title>Lg Issue Report</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.mi... |
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-classic/resources/theme-classic-all.css"
rel="stylesheet"/>
<meta charset="UTF-8">
<title>Title</title>
<script src="../static/js/ext-all.js"></script>
<script type="text/ja... |
'use strict';
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(gene... |
<div align="center">
<a href="https://git.io/typing-svg">
<img src="https://readme-typing-svg.demolab.com?font=Silkscreen&size=20&duration=1500&pause=1000¢er=true&vCenter=true&multiline=true&repeat=false&random=false&width=700&height=110&lines=API+MEDICAL"
alt="Typing SVG" />
</a>
<h5 align="cente... |
/*****************************************************************************
* *
* UNURAN -- Universal Non-Uniform Random number generator *
* *
***... |
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
//#define DEBUG (1)
#define ESP8266
#define USEWIFI
#define TEMP_HIGH_LIM 40.0f
#define TEMP_LOW_LIM 38.0f
#define FILTER_SZ 50
// initialize the library by associating any needed LCD interfac... |
package me.fengyj.springdemo.web.configs;
import me.fengyj.springdemo.utils.exceptions.ResourceNotFoundException;
import me.fengyj.springdemo.utils.exceptions.UserInvalidInputException;
import org.springframework.http.HttpStatusCode;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springfra... |
/* eslint-disable consistent-return */
import React from 'react';
import { Link, useForm, usePage } from '@inertiajs/react';
import { Camera, Loader2 } from 'lucide-react';
import { Transition } from '@headlessui/react';
import { PageProps } from '@/types';
import { UpdateUser } from '@/types/user';
import { cn, getI... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.