text stringlengths 184 4.48M |
|---|
<div class="container-fruid mt-5">
<% if flash[:success].present? %>
<div class="alert alert-success" role="alert">
<%= flash[:success] %>
</div>
<% end %>
<% if flash[:error].present? %>
<div class="alert alert-danger" role="alert">
<%= flash[:error] %>
<ul>
<% flash[:error_... |
using DataStructures
using TimeZones
"""
create_tuples(input_data::InputData)
Create all tuples used in the model, and save them in the tuplebook dict.
# Arguments
- `input_data::InputData`: Struct containing data used to build the model.
"""
function create_tuples(input_data::InputData) # unused, should be de... |
#include <SFML/Graphics.hpp>
#include <iostream>
#include <ctime>
using namespace std;
void handleBallCollision(sf::CircleShape ball, sf::RectangleShape paddle);
const int WINDOW_WIDTH = 1200;
const int WINDOW_HEIGHT = 800;
const int PADDLE_HEIGHT = 200;
const int PADDLE_WIDTH = 20;
const float PADDLE_SPEED = 0.4f;
... |
import argparse
import pandas as pd
import numpy as np
import torch
import os
from models import GraphConvolution, GraphConvolutionalEncoder, GRACE, learner
from utils import setup_config_args, fix_seed, get_logger, get_activation, save_np, save_heatmap, make_route, get_device
from functionals import symmetric_normali... |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Capped.sol";
contract AlchemicaToken is ERC20Capped, Ownable {
//@todo: auto-approve... |
# Test assignment aab
__testcafe and JavaScript__
The environment exists of 2 pages, which I mirrored in testcode:
- login_page.js
- index_page.js
__Login_page__
I combined the log in and log out function on the same page, they are both a authentication-related functionality and belong together. This makes them easy... |
# 0x0F. Python - Object-relational mapping
In the first part, we will use the module MySQLdb to connect to a MySQL database and execute your SQL queries.
In the second part, we will use the module SQLAlchemy, an Object Relational Mapper (ORM).
The biggest difference is: no more SQL queries! Indeed, the purpose of an... |
##-----------------------------------------------##
## Author: Maximilian H.K. Hesselbarth ##
## ##
## mhk.hesselbarth@gmail.com ##
## www.github.com/mhesselbarth ##
##-----------------------------------------------##
#### Im... |
<?php
namespace backend\models;
use Yii;
use yii\db\Expression;
use yii\behaviors\TimestampBehavior;
/**
* This is the model class for table "parliament_constituency".
*
* @property int $id
* @property string $name
* @property int $constituency_type 1. Rajya Sabha 2.Lok Sabha
* @property int $status
* @propert... |
# --
# OTOBO is a web-based ticketing system for service organisations.
# --
# Copyright (C) 2001-2020 OTRS AG, https://otrs.com/
# Copyright (C) 2019-2021 Rother OSS GmbH, https://otobo.de/
# --
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public Licens... |
script;
use std::{alloc::alloc, hash::*, intrinsics::{size_of, size_of_val}};
struct TestStruct {
boo: bool,
uwu: u64,
}
struct ExtendedTestStruct {
boo: bool,
uwu: u64,
kek: bool,
bur: u64,
}
fn main() -> bool {
// Create a struct
let foo = TestStruct {
boo: true,
uw... |
import { AfterViewInit, ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms';
import { Subscription } from 'rxjs';
import { SnackBarService } from 'src/app/shared/snackbar.service';
import { SpinnerService } from 'src/app/shared/spin... |
// Solución al reto de PlayGrounds
export async function runCode(url) {
if (url.substring(0, 8) != "https://") throw new Error('Invalid URL'); // Verifico que la url comience con "https://" y uso método ".substring(0,8)"
try {
const response = await fetch(url);
const data = await response.json()... |
package com.example.budgetwise
import android.app.Application
import android.content.Context
import androidx.room.Room
import com.example.budgetwise.database.RecordDAO
import com.example.budgetwise.database.RecordDatabase
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.andro... |
#pragma once
#include "core/operator.h"
namespace infini {
/**
* @brief Base class of **binary** element-wise operators.
* Unary operators like activations are not the derived classes of
* ElementWiseObj.
*
*/
class ElementWiseObj : public OperatorObj {
public:
/**
* @brief Construct a new ElementWise ... |
/**
* @swagger
* /api/v1/products/categories/{category}:
* get:
* summary: Get products based on category
* description: Retrieve a list of products based on the specified category
* parameters:
* - in: path
* name: category
* required: true
* description: Category ... |
/*
* Copyright 2019 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... |
package com.bpplanner.bpp.model.base
import androidx.lifecycle.LiveData
import com.bpplanner.bpp.utils.LogUtil
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import retrofit2.*
import java.lang.reflect.ParameterizedType
import java.lang.reflect.Type
cla... |
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./INarfexP2pFactory.sol";
import "./INarfexP2pRouter.sol";
/// @title Buy offer in Narfex P2P service
/// @author Danil Sakhinov
/// @dev Allow to create trades with current offer pa... |
import React, { PureComponent } from 'react';
import {
FlatList,
Text,
StyleSheet,
View,
Platform,
TouchableOpacity,
} from 'react-native';
import { LinearGradient } from 'expo-linear-gradient';
import { adaptiveColor, setAlphaColor } from './util';
import type {
ItemType,
IViuPickerProps,
IViuPickerS... |
package me.joeleoli.hcfactions.faction.argument;
import com.doctordark.util.command.CommandArgument;
import me.joeleoli.hcfactions.FactionsPlugin;
import me.joeleoli.hcfactions.faction.FactionMember;
import me.joeleoli.hcfactions.faction.struct.Relation;
import me.joeleoli.hcfactions.faction.type.Faction;
import me.jo... |
import { Footer } from "@features/chat/components"
import { render } from "@src/test-utils"
import { screen } from "@testing-library/react"
import UserEvent from "@testing-library/user-event"
import { axe } from "jest-axe"
import { testId } from "@src/test-utils"
const mockContent = "Hello world!"
const mockOnSend = ... |
//
// TVShowDetailInteractor.swift
// Euskal-Telebista
//
// Created by Aitor Zubizarreta on 2023-04-01.
//
//
import Foundation
class TVShowDetailInteractor {
// MARK: - Properties (from TVShowDetailPresenterToInteractorProtocol)
var presenter: TVShowDetailInteractorToPresenterProtocol?
var ap... |
<div *ngIf="mobiliarios" class="container order-container py-2">
<form [formGroup]="orderForm" (ngSubmit)="onNewOrder()">
<!-- Details -->
<div class="row my-3">
<div class="col">
<div class="row">
<label>Detalle pedido: Lista de mobiliarios</label>
</div>
<div class="r... |
import React, { useState } from 'react';
import axios from 'axios';
import { v4 as uuidv4 } from 'uuid';
import './ImageUploader.css';
function ImageUploader({ setFilesUploaded }) {
const [imageUrls, setImageUrls] = useState([]);
const [moderationResults, setModerationResults] = useState([]);
const [uploadMessag... |
//
// Copyright (c) Clemens Cords (mail@clemens-cords.com), created 5/3/23
//
#pragma once
#include <mousetrap/menu_model.hpp>
namespace mousetrap
{
#ifndef DOXYGEN
class PopoverMenu;
namespace detail
{
struct _PopoverMenuInternal
{
GObject parent;
GtkPopoverMe... |
package cms
import (
"errors"
"fmt"
client "github.com/openshift-online/ocm-sdk-go"
v1 "github.com/openshift-online/ocm-sdk-go/accountsmgmt/v1"
cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1"
)
// RetrieveClusterDetail will retrieve cluster detailed information based on the clusterID
func Retrieve... |
const methodMap = [
[
'requestFullscreen',
'exitFullscreen',
'fullscreenElement',
'fullscreenEnabled',
'fullscreenchange',
'fullscreenerror',
],
// New WebKit
[
'webkitRequestFullscreen',
'webkitExitFullscreen',
'webkitFullscreenEle... |
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Subject } from 'rxjs';
import { map } from 'rxjs/operators';
import { Router } from '@angular/router';
import { environment } from "../../environments/environment";
import { Post } from './post.model';
const BACKEN... |
import React, { useEffect, useMemo, useState } from "react";
import { useSelector } from "react-redux";
import { Button, Container, Content, Sidebar, Nav, Sidenav, Modal } from "rsuite";
import { useActions } from "../../store";
import { GridTable } from "../../components/grid";
import GroupIcon from "@rsuite/icons/leg... |
from dataclasses import dataclass
from ..entities.chat import ChatID
from ..entities.player import PlayerState
from ..common import (
Handler,
UnitOfWork,
ApplicationException,
GameOver,
)
from ..protocols.gateways.game import GameGateway
from ..protocols.gateways.player import PlayerGateway
@datacla... |
Curso de Arduino e AVR 149
WR Kits Channel
Sensor de Temperatura DS18B20 Dallas
Autor: Eng. Wagner Rambo Data: Dezembro de 2017
www.wrkits.com.br | facebook.com/wrkits | youtube.com/user/canalwrkits
HARDWARE Termômetro olhando-o de frente:
Terminal da direita -> 5V do Arduino
T... |
// ignore_for_file: use_build_context_synchronously
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:tttt_project/common/constant.dart';
import 'package:tttt_project/routes.dart';
import 'package:tttt_project/common/user... |
import React, { Component } from 'react'
class ClassComponentIntro extends Component {
render() {
return (
<>
<div className="row">
<div className="col">
<p>class components are more complex than function components.It required you to... |
import './register.css'
import { useRef, useState } from 'react';
import axios from 'axios';
import toast, { Toaster } from 'react-hot-toast';
import { Navigate } from 'react-router-dom';
export default function Register(props) {
const [disabledButton, setDisabledButton] = useState(false)
const [message, setM... |
# Google Fit Data Heatmap
This repository contains a Python script to generate a heatmap from Google Fit data exported in `.tcx` format.
The script parses the `.tcx` files for geolocation data (latitude and longitude) and creates an interactive heatmap using `folium`.
## Requirements
- Python 3.6 or later
- `pandas... |
const express = require('express');
const bodyParser = require('body-parser');
const admin = require('firebase-admin');
const cors = require('cors');
const dotenv = require('dotenv');
const multer = require('multer');
dotenv.config();
const serviceAccountPath = process.env.SERVICE_ACCOUNT_KEY_PATH;
if (!serviceAccoun... |
from aiogram.types import ReplyKeyboardMarkup, KeyboardButtonPollType
from aiogram.utils.keyboard import ReplyKeyboardBuilder
def reply_keyboard() -> ReplyKeyboardMarkup:
"""
Creating of the Inline Keyboard works in 4 stages:
1. Initialization InlineKeyboardBuilder
2. Make buttons with button() method... |
# rpc框架
## 总体思路
1. 第一步,先定义一个接口,这个接口就是客户端向服务端发起调用所使用的接口
```java
public interface EchoService {
String echo(String request);
}
```
2. 在服务端实现这个RPC
```java
class EchoServiceImpl implements EchoService {
public String echo(String request) {
return "echo : " + request;
}
}
```
3. 把这个接口发布到网络上
```java
publi... |
# ----------------------------------------------------------------------- #
# Cartes interractives permettant de représenter le nb de périls par an
# pour une maille géographique donnée
# Pour lancer le shiny : Ctr+A puis Ctrl+Entrée
# Etre patient pour l'affichage en maille commune qui est un peu lent
# --------------... |
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:monochrome_jump/game/monochrome_jump.dart';
import 'package:monochrome_jump/widgets/credits_menu.dart';
import 'package:monochrome_jump/widgets/hud.dart';
import 'package:monochrome_jump/widgets/settings_menu.dart';
class MainMenu extends State... |
import { resolve } from './deps.ts';
export const externalToInternalURL = (
externalURL: string,
vendorSourcePrefix: string,
): string => {
const url = new URL(externalURL);
return `${vendorSourcePrefix}/${url.hostname}${url.pathname}`;
};
export const internalToExternalURL = (
internalURL: string,
vendor... |
import { GetItemsInFolderUseCase } from '@app/inventory/read/hexagon/usecases/get-items-in-folder/get-items-in-folder.usecase';
import { InMemoryAuthGateway } from '@app/authentication/infra/gateways/auth-gateways/in-memory-auth.gateway';
import { StubGetItemsInFolderQuery } from '@app/inventory/read/infra/queries/get-... |
const {
fetchAllPlayers,
fetchSinglePlayer,
addNewPlayer,
removePlayer,
renderAllPlayers,
renderSinglePlayer,
renderNewPlayerForm,
} = require("./script");
class Player{
constructor(name, breed, status, imageUrl){
this.name = name;
this.breed = breed;
this.status = status;
this.imageUrl = im... |
import { customAlphabet } from 'nanoid/async';
import { createTransport } from 'nodemailer';
import { z } from 'zod';
import got from 'got';
import urlcat from 'urlcat';
const Env = z
.object({
EMAIL_HOST: z.string(),
EMAIL_PORT: z.string(),
EMAIL_SECURE: z.string(),
EMAIL_AUTH_USER... |
<!DOCTYPE html>
<html lang="en">
<head>
<title>React Quick Start Guide</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="./styles.css"/>
</head>
<body>
<nav id="navbar">
<header>GET STARTED</header>
... |
import React, { useState } from 'react'
function Todo() {
const [inputData, setInputData] = useState('')
const [items, setItems] = useState([])
function onAdd (){
if(!inputData){
}
else{
setItems([...items, inputData])
setInputData('')
}
}
... |
<template>
<v-container>
<v-card class="mx-auto" outlined>
<v-card-title class="justify-center pb-0">O que desenhar? </v-card-title>
<v-card-text>
<p>{{ idea }}</p>
<v-btn
color="primary"
:loading="!showButton"
:disabled="!showButton"
@click="sub... |
import {
Links,
LiveReload,
Meta,
Outlet,
Scripts,
ScrollRestoration,
} from "@remix-run/react";
import type { LinksFunction, MetaFunction } from "@remix-run/cloudflare";
import globalStyle from "./global.css";
import tailwind from "./tailwind.css";
export const meta: MetaFunction = () => ({
charset: "ut... |
package xfacthd.framedblocks.cmdtests;
import com.mojang.brigadier.Command;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.context.CommandContext;
import net.minecraft.ChatFormatting;
import net.minecraft.Util;
import net.minecraft.commands.CommandSourceStack;
import net.minecraf... |
---
title: "Chapter 02.01: Linear Models with L2 Loss"
weight: 2001
quizdown: true
---
In this section, we focus on the general concept of linear regression and explain how the linear regression model can be used from a machine learning perspective to predict a continuous numerical target variable. Furthermore, we intr... |
import axios from "axios";
import React, { useState } from "react";
import useSWR, { mutate } from "swr";
const BestPost = () => {
const [pageIndex, setPageIndex] = useState(1);
const { data } = useSWR(
`http://localhost:8000/bestpost?_page=${pageIndex}&_limit=10`
);
return (
<div className="container ... |
import React from "react";
import { useProductContext } from "../Context/Product";
import ConfirmBox from "./ConfirmBox";
function CartList() {
const { productInfo, incriment, dicrement, checkout, confirm, remove } =
useProductContext();
const price = productInfo?.map((price) => price);
const totalPrice = pr... |
const socket = new WebSocket('ws://35.90.15.131:8999');
const configuration = { iceServers: [{ urls: 'stun:stun.stunprotocol.org:3478' }] };
const peerConnection = new RTCPeerConnection(configuration);
const gamepads = {};
const dataChannel = peerConnection.createDataChannel('dataChannel');
document.addEventListener... |
import json
import os
from typing import Optional, Dict
import click
import sys
from commands import Db
from commands.base import DbCommandBase
from ivr_gateway.exceptions import InvalidRoutingConfigException
from ivr_gateway.api.exceptions import MissingInboundRoutingException
from ivr_gateway.models.admin import A... |
# frozen_string_literal: true
##
# Retrieve weather data from OpenWeather API
#
class OpenWeather
HEADERS = { 'Content-type' => 'application/json; charset=UTF-8' }.freeze
URI = URI('https://api.openweathermap.org').freeze
class Error < StandardError; end
attr_reader :location
def initialize(location)
... |
package main
import (
"fmt"
"os"
"time"
"github.com/go-resty/resty/v2"
"github.com/rs/zerolog"
"github.com/urfave/cli/v2"
)
var (
restyClient = resty.New()
logger = zerolog.New(zerolog.ConsoleWriter{
Out: os.Stdout,
TimeFormat: time.RFC3339,
}).With().Timestamp().Logger()
)
func main() {
a... |
/*
* Copyright 2015-2020 OpenCB
*
* 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 ... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Boonchai Security - Main</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"... |
// Copyright 2020 The Dawn 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... |
import React, { useState } from "react";
import "./Mega.css";
// eslint-disable-next-line import/no-anonymous-default-export
export default props => {
function gerarNumero(qtd) {
const numeros = Array(qtd)
.fill(0)
.reduce((nums) => {
const novoNumero = gerarNumero... |
/*
* @lc app=leetcode.cn id=334 lang=java
*
* [334] 递增的三元子序列
*
* https://leetcode.cn/problems/increasing-triplet-subsequence/description/
*
* algorithms
* Medium (43.29%)
* Likes: 610
* Dislikes: 0
* Total Accepted: 103.4K
* Total Submissions: 238.7K
* Testcase Example: '[1,2,3,4,5]'
*
* 给你一个整数数组 ... |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>form 에 대해서 알아봅니다.-1</title>
<style type="text/css">
div#container {
border: solid 0px gray;
width: 30%;
margin: 0 auto;
}
form {
margin-top: 100px;
}
legend {
font-size: 20pt;
}
label {
display: inline-block;
width : 150px;
}
... |
#include <cw/opengl/GlfwInputTranslator.hpp>
#include <stdexcept>
#include <vector>
#include <algorithm>
#include <GLFW/glfw3.h>
#include <cw/Enforce.hpp>
#include <cw/core/UnifiedInputHandler.hpp>
#include <cw/core/Logger.hpp>
#include <cw/opengl/GlfwWindow.hpp>
namespace
{
const std::vector<int> VALID_SCROLL_KEY... |
import axios from "../Config/axiosConfig";
import { asyncGetBills } from "./billActions";
import { asyncGetCustomers } from "./customerActions";
import { asyncGetproducts } from "./productActions";
export const LOG_IN = 'LOG_IN'
export const LOG_OUT = 'LOG_OUT'
export const SET_USER = 'SET_USER'
export const asyncUser... |
import 'package:flutter/material.dart';
class DefaultInput extends StatelessWidget {
final TextEditingController controller;
final String placeholder;
final double? height;
const DefaultInput(
{super.key,
required this.controller,
this.placeholder = "Enter...",
this.height});
@overri... |
package com.javarush.task.task14.task1408;
/*
Куриная фабрика
*/
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class Solution {
public static void main(String[] args) {
Hen hen = HenFactory.getHen(Country.BELARUS);
System.out.println(hen.getDescrip... |
package app.salo.przelewetarte.presentation.theme.ui
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material.MaterialTheme
import androidx.compose.material.darkColors
import androidx.compose.material.lightColors
import androidx.compose.runtime.Composable
import app.salo.przelewetarte.pr... |
// _mixins
// ========
@mixin backImage($image, $divHeight) {
background: url($image) no-repeat 50% 20% ;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-o-trans... |
<!-- -->
<template>
<div class="containerLay">
<h2>Rate 评分</h2>
<p>评分组件</p>
<h3>基础用法</h3>
<div class="demo">
<div class="block">
<span class="demonstration">默认不区分颜色</span>
<el-rate v-model="value1"></el-rate>
</div>
<div class="block">
<span class="demons... |
import { useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { Box, Button, CircularProgress } from '@material-ui/core';
import { PeopleAltOutlined } from '@material-ui/icons';
import AddTeamMember from '../components/AddTeamMember';
import SingleMemberCard from '../components/S... |
import * as React from "react";
import "./index.css";
import Datafeed from "./api";
function getLanguageFromURL() {
const regex = new RegExp("[\\?&]lang=([^&#]*)");
const results = regex.exec(window.location.search);
return results === null ? null : decodeURIComponent(results[1].replace(/\+/g, " "));
}
export c... |
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import sqlite3
from askvista.system_message.prompts import SYSTEM_MESSAGE
from sqlite3 import Error
import streamlit as st
import os
from utils.db_connection import *
#----- Handle uploaded File, if file is .db extension... |
# ThreadPoolExector中的Worker工作者原理
## 1 前言
Java线程池(ThreadPool)是Java中用于管理和调度线程的一种机制。线程池通过重用线程来减少创建和销毁线程的开销,从而提高应用程序的性能。Java线程池的核心组件之一是Worker线程,它负责实际的任务执行。
Worker是线程池内部的工作者,每个Worker内部持有一个线程,addWorker方法创建了一个Worker工作者,并且放入HashSet的容器中,那么这节我们就来看看Worker是如何工作的。
## 2 内部属性
```java
private final class Worker
extends Abstr... |
import {
FormControl,
FormErrorMessage,
FormHelperText,
FormLabel,
Textarea,
TextareaProps,
} from "@chakra-ui/react";
import React from "react";
import { Control, useController } from "react-hook-form";
type Props = {
label: string;
name: string;
control: Control<any>;
helperText?: string;
mask?... |
using HiloGuessing.Domain.Entities;
using HiLoGuessing.Application.Services;
using HiLoGuessing.Application.Services.Interfaces;
using Moq;
using Serilog;
namespace HiLoGuessing.Tests.Application.Services
{
public class HiLoGuessServiceTest
{
[TestFixture]
public class ComparisonServiceTests
... |
#ifndef _COLORS
# define _COLORS
# define BLACK "\033[1;30m"
# define RED "\033[1;31m"
# define GREEN "\033[1;32m"
# define YELLOW "\033[1;33m"
# define BLUE "\033[1;34m"
# define MAGENTA "\033[1;35m"
# define CYAN "\033[1;36m"
# define WHITE "\033[1;37m"
# define NC "\033[0m"
#endif // !_COLORS
// MateriaSource decl... |
#ifndef MONTY_H
#define MONTY_H
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#define STACKMODE 0
#define QUEUEMODE 1
/**
* struct stack_s - doubly linked list representation of a stack or queue
* @n: integer
* @prev: points to the previous element of the stack (or queue)
* @next... |
/*
* Copyright (C) 2021 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... |
import {
Button,
Card,
Box,
Grid,
Typography,
useTheme,
styled,
Avatar,
Divider,
alpha,
ListItem,
ListItemText,
List,
ListItemAvatar
} from '@mui/material';
import SettingsApplicationsOutlinedIcon from '@mui/icons-material/SettingsApplicationsOutlined';
import CarRepairIcon from '@mui/icons-... |
import { useState, useEffect } from "react";
import axios from "axios";
import { GiphyResponse } from "../interfaces/giphy";
async function searchGiphy(query: string): Promise<string[]> {
try {
return await axios
.get<GiphyResponse>("https://api.giphy.com/v1/gifs/search", {
params: {
api_... |
import 'package:bloc_project/core/theme/app_pallete.dart';
import 'package:bloc_project/features/auth/presentation/screens/welcome_screen.dart';
import 'package:flutter/material.dart';
class DrawerWidget extends StatelessWidget {
const DrawerWidget({super.key});
@override
Widget build(BuildContext context) {
... |
import Fsm from '../fsm/fsm.js';
import { IState } from '../interfaces/state.js';
/**
* Lifecycle state machine.
*
* ```typescript
* import { Lifecycle } from '@syster42/core';
* const lifecycle = new Lifecycle();
* lifecycle.onStart = () => {
* console.log('start');
* };
* lifecycle.onStop = () => {
* con... |
#include<iostream>
#include<vector>
int longestSubarray(std::vector<int>& nums)
{
int i = 0, j = 0, ans = 0, zero_count = 0, count = 0;
while(i < nums.size())
{
//if the curr number is 0, increment zero_count
if(nums[i] == 0)
zero_count++;
//if more than 1... |
const mongoose = require('mongoose'); // Erase if already required
// Declare the Schema of the Mongo model
const blogSchema = new mongoose.Schema({
title:{
type: String,
required:true,
},
description:{
type: String,
required:true,
},
category:{
type: String,
required:true,
},
num... |
package com.bob.redwall.tileentity;
import com.bob.redwall.Ref;
import com.bob.redwall.gui.smithing.SlotSmithingFuel;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
im... |
import 'dart:math';
import 'package:carousel_slider/carousel_slider.dart';
import 'package:fin_app/products/cart_view_model.dart';
import 'package:fin_app/products/product_model.dart';
import 'package:fin_app/store/application_state.dart';
import 'package:flutter/material.dart';
import 'package:flutter_redux/flutter_r... |
# Mini-Compiler
This is a small compiler that outputs C code after implementing a dialect of BASIC. It will support basic operations such as:
- Numerical variables
- Basic arithmetic
- If statements
- While loops
- Print
- Labels and goto
- Comments
## Overview

The compiler f... |
namespace CGAL {
/*!
\ingroup PkgSnapRounding2Ref
<span style="display:none">\f$ \def\A{{\cal A}} \f$ \f$ \def\S{{\cal S}} \f$</span>
\tparam Traits must be a model of `SnapRoundingTraits_2`.
\tparam InputIterator must be an iterator with value type `Traits::Segment_2`.
\tparam OutputContainer must be a container wi... |
import React from "react";
import Header from "./Header";
import Footer from "./Footer";
import { useTheme } from "next-themes";
import { useState, useEffect } from "react";
const Layout = ({ children }: { children: React.ReactNode }) => {
const [mounted, setMounted] = useState(false);
const { theme, setTheme } = ... |
package network_test
import (
"context"
"fmt"
"testing"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-a... |
import React, { useState, useEffect } from 'react';
import { Link } from 'react-router-dom';
import { api } from '../services/api';
import '../styles/EmployerDashboard.css'
const EmployerDashboard = () => {
const [employer, setEmployer] = useState(null);
const [jobs, setJobs] = useState([]);
useEffect(() => {
... |
use unicode_segmentation::UnicodeSegmentation;
use super::helpers::{
multi_spaces_regex, new_line_regex,
password_validator::password_validator,
regexes::{email_regex, jwt_regex, name_regex},
};
pub fn format_name(name: &str) -> String {
let mut title = name.trim().to_lowercase();
title = new_line... |
import React, { useState, useRef } from 'react';
import Counter from '../Counter/Counter';
const MainComponent = () => {
const [startValues, setStartValues] = useState([]);
const counterStartInputRef = useRef()
const onFormSubmitHandler = (e) => {
e.preventDefault()
setStartValues(prev =... |
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Elzero</title>
<!-- Main Template file css -->
<link rel="stylesheet" href="css/normlaze.css">
<!-- Render All Element Normally -->
<link rel="stylesheet" href="css/m... |
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import logging
import os
from typing import Any, Dict, List, Optional, Tuple
from loguru import logger
from utils.config_uti... |
/*
Assignment #3: Finding Prime Numbers
Author: Steve Defendre
due date: 10/04/2023
Description: This program takes a range of integers as input from the user and
finds all the prime numbers within that range.
*/
import java.util.Scanner;
public class PrimeNumberFinder {
public static void main(String[] a... |
use cosmwasm_std::{to_binary, Deps};
use crate::{
core::{aliases::ProvQueryResponse, msg::QueryOwnerResponse},
storage,
};
/// Performs the logic for the QueryOwner message and obtains the contract's owner.
///
/// # Arguments
///
/// * `deps` - A non mutable version of the dependencies. The API, Querier, and... |
import API from "./Api";
/**
* Create table reservation with the provided details object using the provided authentication token
* @param {Object} putTableDetails the table reservation details object
* @param {string} token the authentication token
* @returns {Promise<any>} promise that resolves to the updated tab... |
/**
@file Color4.cpp
Color class.
@author Morgan McGuire, http://graphics.cs.williams.edu
@cite Portions by Laura Wollstadt, graphics3d.com
@cite Portions based on Dave Eberly's Magic Software Library at http://www.magic-software.com
@created 2002-06-25
@edited 2009-11-10
*/
#include <stdlib.h>
#include "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.