text stringlengths 184 4.48M |
|---|
/**
* Copyright 2005-2020 Talend
*
* The contents of this file are subject to the terms of one of the following
* open source licenses: Apache 2.0 or or EPL 1.0 (the "Licenses"). You can
* select the license that you prefer but you may not use this file except in
* compliance with one of these Licenses.
*
* Y... |
require 'pry'
class Api::V0::MarketsController < ApplicationController
def index
render json: { data: MarketSerializer.format_markets(Market.all) }
end
def show
begin
render json: { data: MarketSerializer.format_market(Market.find(params[:id])) }
rescue StandardError => e
render json: { ... |
import { useDispatch, useSelector } from 'react-redux';
import { useEffect, useState } from 'react';
import { addPanda } from '../store/PandaRedux';
import { useNavigate } from 'react-router-dom';
import { clearPandaState } from '../store/PandaRedux';
import { CustomForm } from '../components/CustomForm';
import { addr... |
//
// Copyright 2020 gRPC 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... |
//
// SummaryItemTests.swift
// Neds
//
// Created by Wael Saad on 20/3/2024.
// Copyright © 2024 NetTrinity. All rights reserved.
//
@testable import Neds
import XCTest
import SwiftUI
final class SummaryItemTests: XCTestCase {
func testGivenRaceSummary_WhenViewInitialized_ThenExpectedRaceNameDisplayed() {
... |
/**
* @file modbus.h
* @author simakeng (simakeng@outlook.com)
* @brief modbus slave protocol
* @version 0.1
* @date 2023-04-17
*
* @copyright Copyright (c) 2023
*
*/
#include <stdint.h>
#include <libe15-errors.h>
typedef struct
{
uint16_t reg_start_addr;
uint32_t reg_map_len;
error_t (*read_hand... |
import { useEffect, useState } from "react";
import Header from "./Header";
import {
Container,
CssBaseline,
ThemeProvider,
createTheme,
} from "@mui/material";
import { Outlet } from "react-router-dom";
import { ToastContainer } from "react-toastify";
import "react-toastify/ReactToastify.css";
import agent fro... |
import { faker } from '@faker-js/faker';
import { expect } from '@playwright/test';
import { createCustomer, serverRequest, stripeRequest, test, VALID_CARD } from '../helpers';
test.describe('Paying for lessons', () => {
let scheduleLessonResponse;
let completePaymentResponse;
let refundId;
test.beforeAll(as... |
import { useCallback, useEffect, useState } from "react"
import useToastContext from "../../hooks/useToastContext";
import { searchCollections } from "../../services/search";
import CollectionList from "../profile-collection/CollectionList";
const LIMIT = 8;
const CollectionSearchResultDisplay = (props) => {
const ... |
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Pawn.h"
#include "IDisableActor.h"
#include "BasicPawn.generated.h"
UCLASS()
class TOONTANKS_API ABasicPawn : public APawn, public IDisableActor
{
GENERATED_BODY()
public:
/... |
====== HTML & CSS Tutorial ======
Mit dieser Anleitung lernen Sie die Grundlagen von HTML & CSS, damit Sie eigene Webprojekte realisieren können. Wir beginnen **sofort mit einem Projekt**, anstatt zuerst langweilige Theorie abzuhandeln.
Die Theorie wird erklärt, sobald sie für das Projekt benötigt wird. Sie werden da... |
const express = require('express');
const User = require("../models/User");
const Post = require('../models/Post');
const router = express();
//CREATE POST
router.post("/", async (req, res) => {
const newPost = new Post(req.body);
try {
const savedPost = await newPost.save();
res.status(201).j... |
#ifndef _SPINLOCK_H_
#define _SPINLOCK_H_
#include "boost/atomic.hpp"
/*!
@brief SpinLock implementation
@author kwchen
@reference http://stackoverflow.com/questions/10966528/how-to-use-boost-atomic-to-remove-race-condition
*/
class SpinLock
{
private:
boost::atomic<bool> m_bIsLock;
public:
SpinLock ()
: m_... |
import { Box, Button, ButtonGroup, Center, Heading, Text, useColorModeValue, VStack } from '@chakra-ui/react'
import React, { createContext, PropsWithChildren, useContext } from 'react'
import { Helmet } from 'react-helmet-async'
import { Loading } from '../../../common-components/Loading'
import { INITIAL_BG_IMAGE } f... |
package ru.bodikov.otus.domain;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.experimental.FieldDefaults;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.List;
@FieldDefaults(makeFinal = true,level = AccessLevel.PRIVATE)
@Getter
public class Cassette {
CurrencyAndBankn... |
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form ref="queryFormRef" :inline="true" :model="queryParams">
<el-form-item label="岗位名称" prop="name">
<el-input
v-model="queryParams.name"
clearable
placeholder="请输入岗位名称"
@keyup.enter="handleQuery"
/>
... |
"use client"
import {useEffect, useState} from "react";
import {getSingleOffer} from "@/sanity/lib/sanity-utils";
import {Faq, Gallery, OfferHero, Separator, Services} from "@/components";
import Advantages from "@/components/&offer/Advantages";
import HowWeWork from "@/components/&offer/HowWeWork";
import Loader from ... |
"use client";
import {
ArrowLongLeftIcon,
ArrowLongRightIcon,
MagnifyingGlassIcon,
} from "@heroicons/react/20/solid";
import { useRouter } from "next/navigation";
import React, { useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { RootState } from "../../redux/st... |
using AutoMapper;
using Conduit.Application.Interfaces;
using Conduit.Domain.DTOs;
using Conduit.Domain.Entities;
using Conduit.Domain.Exceptions;
using Conduit.Domain.Interfaces;
namespace Conduit.Application.Services
{
public class ProfileService : IProfileService
{
private readonly IUserRepository ... |
import pandas
import time
import json
from qiskit import IBMQ
from qiskit_aer import Aer, AerSimulator
from azure.quantum.qiskit import AzureQuantumProvider
from rsa import *
from order_generic import *
from order_classic import *
from order_quantum import *
from qiskit.providers.fake_provider import FakePrague
from q... |
Describe Data.Base32.Crockford
Before all
let B = vital#vital#new().import('Data.Base32.Crockford')
End
Describe .encode()
It encode string to base32 encoded string.
Assert Equals(B.encode("hello, world!"), 'D1JPRV3F5GG7EVVJDHJ22')
End
It encode string RFC Test Vector 1.
Assert Equals... |
import { ObjectType, Field } from '@nestjs/graphql';
import { Model } from 'objection';
import BaseModel from '../../common/base.model';
import { CommentEntityTypeEnum } from '../comment.enum';
import { User } from '../../user/entities/user.entity';
import { File } from '../../file/entities/file.entity';
@ObjectType()... |
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
import 'package:guard/Employer/Screen/Invite/MyJobList.dart';
import 'package:guard/admin/utils/GlobalVariables.dart';
import 'package:guard/chat/chatpage.dart';
import 'package:guard/users/Screens/EmployeDetail.dart';
class... |
# WDM: Wavelength Division Multiplexing
E' possibile fare **multiplexing**, ovvero mandare **più segnali all'interno della stessa fibra**: ogni segnale avrà una diversa lunghezza d'onda.
Esistono due soluzioni: la prima è detta **dense** (DWDM) dove ci sono molte lunghezze d'onda (più costoso), mentre la seconda è **c... |
import { Card, Title } from "@mantine/core"
import { determineColorPercentUp } from "~/utils/utilities"
import {
CardGroupLayout,
LayoutData,
links as cardGroupLinks,
} from "../CardGroupLayout"
import styles from "./styles.css"
export const links = () => {
return [...cardGroupLinks(), { rel: "stylesheet", hre... |
import fs from 'fs-extra';
import { minify } from 'csso';
import sass from 'sass';
import less from 'less';
async function compileLess(weight: string): Promise<string> {
return (
await less.render(fs.readFileSync('less/' + weight + '.less').toString(), {
paths: ['less'],
filename: weight + '.less',
})
).c... |
<template>
<div>
<v-btn icon depressed color="primary" @click="getRoles"><v-icon>mdi-pencil</v-icon></v-btn>
<v-dialog v-model="addPermModel" width="500">
<v-form v-model="valid" ref="form" lazy-validation>
<v-card>
<v-card-title>
Edit User
<v... |
<?php
namespace Drupal\single_content_sync\Plugin\SingleContentSyncBaseFieldsProcessor;
use Drupal\Core\Entity\FieldableEntityInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\single_content_sync\ContentExporterInterface;
use Drupal\single_content_sync\SingleContentSyncBaseFieldsProcessorP... |
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PayNow QR Info</title>
<meta name="description" content="PayNow QR Code Reader">
<meta name="author" content="SitePoint">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://unpkg.c... |
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
namespace Utility
{
public static class Texture2DExtensions
{
public static void InsertTexture(this Texture2D origin, Texture2D other, int x, int y)
{
origin.SetPixels(x, ... |
<script setup>
const props = defineProps({
modelValue: {
type: String,
required: true,
},
name: {
type: String,
required: true,
default: '',
},
label: {
type: String,
required: true,
default: '',
},
rows: {
type: String,
required: true,
default: '',
},
error... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1 style="color: red;">HTML Basic</h1>
<h2>HTML Documents</h2>
<p>All HTML documents must start with a document type dec... |
import React from "react";
import PropTypes from "prop-types";
import { FaEdit, FaWindowClose } from "react-icons/fa";
import "./style.css";
export default function Tasks({ tasks, handleEditTask, handleDeleteTask }) {
return (
<ul className="tasks">
{tasks.map((task, index) => (
<li key={index}>
... |
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
// create mapping unique is addres and return owner wallel company
contract helloWorld {
struct Company {
string name;
uint age;
uint workers;
}
// worked privazky addreess wallet in to compani
mapping(address =... |
import React from "react";
const UploadFiles = (props) => {
const { uploadedFiles, setUploadedFiles } = props.formState;
//Handling file event
const handleFileEvent = (e) => {
const chosenFiles = Array.prototype.slice.call(e.target.files);
handleFileAdd(chosenFiles);
};
//Add files to state
const ... |
<?php get_header(); ?>
<div class="main">
<div class="content">
<div class="posts">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h2 class="post-title"><?php the_title(); ?></h2>
<div cla... |
class Box< T > {
public T t;
public boolean equalTo( Box< T > other) { return this.t.equals(other.t); }
public Box< T > copy() { return new Box<T>(t); }
public Box(T t) { this.t = t; }
public void put( T t) { this.t = t;}
public T take() { return t; }
public boolean contains( T t) { retu... |
# Copyright (c) 2023 PaddlePaddle Authors. 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 appli... |
package com.compose.codearticle.presentaion.screens.settingScreen.composabels
import android.annotation.SuppressLint
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import andr... |
# With clauses
## Grammar
These clauses use the [unreal time](/topics/parts-of-speech/verbs/conjunctive.md).
## I wish, if only
💡 kéž by, kdyby tak
We can use the verb **wish** or a phrase **if only**. We can use the conjunction **that** after the verb **wish**.
> **I wish** I had more time for my friends. <br/>... |
import SurveyCSS from "./SurveyPage.module.scss";
export default function SurveyPage() {
return (
<div className={SurveyCSS["survey-page"]}>
<div className={SurveyCSS.container}>
<header className={SurveyCSS.header}>
<h1 className={SurveyCSS.title}>Pet Ownership!</h1>
<p classNa... |
Want to customize the various linters Stickler CI uses? This page contains reference documentation on how to customize each of the tools that Stickler offers.
If you're still looking for answers, please tweet us @sticklerci or email us at support@stickler-ci.com.
Stickler CI is configured through a file in your repos... |
# 第五章:攻击后 - 对目标的行动
在现代黑客和系统攻击的世界中,攻击者不太关心利用,而是关心可以利用该访问权限做什么。这是攻击者实现攻击的全部价值的部分。
一旦系统被攻击,攻击者通常执行以下活动:
+ 进行快速评估以表征本地环境(基础设施、连接性、帐户、目标文件的存在以及可以促进进一步攻击的应用程序)
+ 定位并复制或修改感兴趣的目标文件,如数据文件(专有数据和财务信息)
+ 创建额外的帐户并修改系统以支持后期利用活动
+ 尝试通过捕获管理员或系统级凭据来垂直升级用于访问的特权级别
+ 尝试通过受损系统将攻击转移到网络的其余部分来攻击其他数据系统(水平升级)
+ 安装持久后门和隐蔽通道,以... |
// Copyright (c) 2018-2023 Made to Order Software Corp. All Rights Reserved
//
// https://snapwebsites.org/project/snapdev
// contact@m2osw.com
//
// 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 Founda... |
import '@testing-library/jest-dom/extend-expect';
import { render, screen } from '@testing-library/react';
import addDays from 'date-fns/addDays';
import format from 'date-fns/format';
import { colors } from '../../styles/colors';
import Calendar from './Calendar';
describe('Calendar Component', () => {
const startD... |
// Copyright (C) 2023-2024 Free Software Foundation, Inc.
//
// This file is part of the GNU Proc Macro Library. This library 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, or (at your... |
import { RouterModule, Routes } from '@angular/router';
import { AuthenticationGuard } from 'src/app/core/guards/authentication.guard';
import { LayoutComponent } from './layout.component';
import { NgModule } from '@angular/core';
const routes: Routes = [
{
path: 'dashboard',
component: LayoutComponent,
loadC... |
const express = require('express')
const bodyParser = require('body-parser')
const dotenv = require('dotenv')
const cardsController = require('./controllers/cardsController')
const authRoutes = require('./routes/auth')
const { verifyToken } = require('./middleware/authMiddleware')
dotenv.config()
const app = express... |
console.log("Hello geys"); // public private protected / readonly static
abstract class Cars {
static manufactureCountry = "Ukraine";
protected details: string[] = []; // private key gives access only from currrent class but protected gives access from any extended class
constructor(public readonly name: string... |
<template>
<a-layout class="layout">
<a-layout-header>
<img class="logo" src="https://yupi.icu/logo.png"/>
<a-menu
v-model:selectedKeys="selectedKeys"
theme="dark"
mode="horizontal"
:style="{ lineHeight: '64px' }"
@click="toPage"
>
<a-men... |
import {
call,
all,
select,
put,
takeLatest,
takeEvery,
take,
fork,
} from "redux-saga/effects";
import request, { requestWithProgress } from "utils/request";
import { UI_DESIGN_INFO_ENDPOINT, UPLOAD_FILE_ENDPOINT, REMOVE_UPLOADED_FILE_ENDPOINT, JUDGES_COMMENTS_ENDPOINT, UPLOAD_CONTESTANT_PHOTO_ENDPOIN... |
package cz.vse.campuss.model;
/**
* Třída PolozkaHistorie představuje jednu položku historie uložení v systému.
* Obsahuje informace o studentovi, šatně, umístění, stavu uložení a čase změny stavu.
*/
public class PolozkaHistorie {
private final int id;
private final String jmenoStudenta;
private final ... |
import 'package:flutter/material.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:intl/intl.dart';
import '../../../core/utils.dart';
import '../../../core/env.dart';
import '../../../core/theme/app_theme.dart';
part 'transaction.freezed.dart';
part 'transaction.g.dart';
enum Trans... |
##prepare the dataset for training with the use the MNIST dataset
def get_dataset(rank=0, size=1):
from tensorflow import keras
from tensorflow.keras.datasets import mnist
import numpy as np
# Set a random seed for reproducibility
np.random.seed(42)
# Download MNIST dataset
(x_train, y_tra... |
import { useFormContext } from "react-hook-form"
import { HotelFormData } from "./ManageHotelForm"
const DetailsSection = () => {
const {register, formState: {errors}} = useFormContext<HotelFormData>()
return (
<div className="flex flex-col gap-4">
<h1 className="text-3xl font-bold mb-3">Add Hotel</... |
<?xml version="1.0" encoding="UTF-8"?>
<?oxygen RNGSchema="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng" type="xml"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
<fileDesc>
<titleStmt>
<title>Introduction to the resource</title>
</t... |
import { useMutation } from "@apollo/client";
import React, { useContext, useState } from "react";
import { useNavigate } from "react-router-dom";
import styled from "styled-components";
import { AuthContext } from "../../context/userContext";
import {
LOGIN_USER_MUTATION,
REGISTER_USER_MUTATION,
} from "../../mode... |
import react, { useEffect } from "react";
import Card from "@mui/material/Card";
import CardActions from "@mui/material/CardActions";
import CardContent from "@mui/material/CardContent";
import CardMedia from "@mui/material/CardMedia";
import Button from "@mui/material/Button";
import Typography from "@mui/material/Typ... |
<!DOCTYPE html>
<html lang="pt">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Doguito Petshop | Criar conta</title>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400&display=swap" rel="stylesheet">
<link href="... |
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
class Counter extends ChangeNotifier {
int count = 0;
void increase() {
count++;
notifyListeners();
}
void decrease() {
count--;
notifyListeners();
}
void reset() {
count = 0;
notifyL... |
package com.looker.kenko.ui.plans
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.com... |
import React from "react";
import { t } from "ttag";
import cx from "classnames";
import Tooltip from "metabase/components/Tooltip";
import Button from "metabase/components/Button";
export default function QuestionNotebookButton({
className,
question,
isShowingNotebook,
setQueryBuilderMode,
...props
}) {
... |
from django import forms
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from django.utils import timezone
from django.forms.widgets import Select, TextInput
if "pinax.notifications" in settings.INSTALLED_APPS and getattr(settings, 'DJANGO_MESSAGES_NOTIFY', True):
from pinax... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>zx-waterfall demo by capricorncd</title>
<style>
* {
margin: 0;
padding: 0;
}
body {
padding-top: 60px;
}
h2 {
position: fixed;... |
import { Column, DataType, HasMany, Model, Table } from 'sequelize-typescript';
import { DisciplineAcademicPlan } from 'src/core/discipline-academic-plan/domain/entity/discipline-academic-plan.entity';
import { Teacher } from 'src/core/teacher/domain/entity/teacher.entity';
interface IDepartmentCreationAttrs {
id: n... |
from pathlib import Path
from sqlite3 import Connection as SQLite3Connection
from typing import List, Tuple, Union
import pandas as pd
import sqlalchemy
from ichor.core.atoms import Atom, Atoms
from ichor.core.common.str import get_characters
from ichor.core.database.sql.add_to_database import AtomNames, Dataset, Poin... |
<template>
<div class="validate-input-container pb-3">
<input
v-if="tag !== 'textarea'"
type="text"
class="form-control"
:class="{'is-invalid':inputRef.err}"
:value="inputRef.val"
@blur="validateInput"
@input="updateValue"
v-bind="$attrs"
/>
<textarea
... |
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***************************... |
import { useSelector } from "react-redux";
import { Routes, Route } from "react-router-dom";
import "bootstrap/dist/css/bootstrap.min.css";
import "./App.css";
import Header from "./component/products/header";
import Home from "./component/products/home";
import Products from "./component/products/product";
import Con... |
import { NavLink, Form, useRouteLoaderData } from 'react-router-dom';
import classes from './MainNavigation.module.css';
function MainNavigation() {
const token = useRouteLoaderData('root');
return (
<header className={classes.header}>
<nav>
<ul className={classes.list}>
<li>
... |
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:well_shift_app/core/common/app_colors.dart';
import 'package:well_shift_app/core/common/app_localization.dart';
import 'package:well_shift_app/core/raw_data/progress_raw.dart';
class WellbeingPage extends State... |
import os
import imageio
import numpy as np
from PIL import Image
from skimage.metrics import structural_similarity as ssim
from html import escape
def resize_image(input_path, size):
with Image.open(input_path) as img:
img_resized = img.resize(size)
img_resized.save(input_path)
def compare_image... |
<?php
namespace App\Controller;
use App\Repository\PlatRepository;
use App\Repository\CartRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Session\SessionInterface;... |
%>@ingroup maths
%> @file
%> @brief Calculates the stability curve for a set of feature subsets
%>
%> This function is suitable for feature subsets found using Sequential Forward Feature Selection
%>
%> Kuncheva's "consistency" formula is I_c = (r-k^2/nf)/(k-k^2/nf), where r is the number of common elements in the two ... |
import { DesktopDatePicker, LocalizationProvider } from '@mui/lab';
import AdapterDateFns from '@mui/lab/AdapterDateFns';
import {
Autocomplete,
Container,
FormControl,
FormHelperText,
InputLabel,
MenuItem,
Select,
styled,
TextField,
Typography,
} from '@mui/material';
import { EmailValue, Label, Ro... |
<!DOCTYPE html>
<html>
<head>
<title>Portholes</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_pack_tag 'application'... |
% Convert a dicom to a grayscale image with [0 nLevels-1].
%
% fileName: a char vector specifying the full path of a dicom file, or a structure containing meta
% data.
%
% nLevels: an integer specifying the grayscale ([0 nLevels-1]) of the converted grayscale image. If
% nLevels is 256, then I is uint8 ([0 255]);... |
# Copyright 2022-2023 XProbe Inc.
#
# 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 wri... |
#include <math.h>
#include "vectors.hpp"
const float ROUNDING_ERROR_f32 = 0.000001f;
bool floatIsZero(float val) {
return (val + ROUNDING_ERROR_f32 >= 0.0f) && (val - ROUNDING_ERROR_f32 <= 0.0f);
}
bool floatInUnit(float val) {
return (val >= 0.0f) && (val <= 1.0f);
}
bool Vector2D::isZero() {
return fl... |
/* eslint-disable no-unused-vars */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/ban-types */
import {
ComputedGetter,
ComputedOptions,
DefineComponent,
EmitsOptions,
ExtractDefaultPropTypes,
MethodOptions,
SlotsType
} from 'vue'
import {
PublicProps,
R... |
# Python Game Of Life with Pygame
This is a Python implementation of Conway's Game of Life using Pygame. The Game of Life is a cellular automaton devised by the British mathematician John Horton Conway in 1970. It's a zero-player game, meaning its evolution is determined by its initial state, requiring no further inpu... |
// ignore_for_file: constant_identifier_names
import 'dart:convert';
import 'package:equatable/equatable.dart';
import 'package:flutter/foundation.dart';
import 'package:volunteersapp/data/models/authentication/auth_accounts_signin_with_password/EmailInfo.dart';
import 'package:volunteersapp/data/models/authenticatio... |
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:jus_mobile_order_app/Helpers/error.dart';
import 'package:jus_mobile_order_app/Helpers/loading.dart';
import 'package:jus_mobile_order_app/Models/membership_stats_model.dart';
import 'package:jus_mobile_order_ap... |
package controllers
import java.text.SimpleDateFormat
import java.util.Date
import domain.{PkuLog, PkuLogQuery}
import javax.inject.{Inject, _}
import play.api.mvc._
import services.LogService
import utils.JSONUtil
import scala.concurrent.ExecutionContext
/**
* 日志处理
*/
@Singleton
class LogController @Inject()(log... |
/**
* APITable <https://github.com/apitable/apitable>
* Copyright (C) 2022 APITable Ltd. <https://apitable.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of... |
from numpy import loadtxt
import numpy as np
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from keras.regularizers import l2
import tensorflow as tf
import shutil
import os
dataset = loadtxt('data.csv', delimiter=',')
X = dataset[:,0:8]
y = dataset[:,8:10]
class CustomCallback... |
/*******************************************************************************
* Copyright (c) 2013 Christian Wiwie.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* ... |
#include <AFMotor.h>
#include <SoftwareSerial.h>
SoftwareSerial BT_Serial(0, 1); // RX, TX
AF_DCMotor motor1(3);
AF_DCMotor motor2(2);
AF_DCMotor motor3(4);
AF_DCMotor motor4(1);
#define R_S A0 //ir sensor Right
#define L_S A2 //ir sensor Left
int bt_data; // variable to receive data from the serial port
int mod... |
import {
IsString,
IsUrl,
IsNotEmpty,
IsOptional,
IsNumber,
IsPositive,
} from 'class-validator';
export class UpdateMenuDto {
@IsNotEmpty({ message: 'field name must be added' })
@IsString()
name?: string;
@IsOptional()
@IsString()
description?: string;
@IsOptional()
@IsUrl()
imageUrl?... |
// run all this in browser console as node.js doesn't run http request directly
// old method without using fetch api
// const xhr = new XMLHttpRequest(); // new http request object
// // AJAX (asyncronous javascript and XML)
// xhr.onload = function() {
// console.log(xhr.responseText);
// }; // this function wi... |
package smartquizapp.controller;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.validation.Valid;
import org.eclipse.angus.mail.util.MailConnectException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframew... |
import { Component, ViewChild } from '@angular/core';
import { TableComponent } from 'smart-webcomponents-angular/table';
import { DataService } from 'src/app/services/data.service';
@Component({
selector: 'sm-responsive-table',
templateUrl: './responsive-table.component.html',
styleUrls: ['./responsive-table.co... |
//
// JokesView.swift
// Jokes
//
// Created by Graeme Armstrong on 2023-04-14.
//
import Blackbird
import SwiftUI
struct JokesView: View {
// MARK: Stored properties
@Environment(\.blackbirdDatabase) var db: Blackbird.Database?
// 0.0 is invisible, 1.0 is visible
@State var punchlineOpacity =... |
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* See the file COPYING for full copying permissions. *
* ... |
import {
SafeAreaView,
ScrollView,
StyleSheet,
Text,
TouchableOpacity,
View,
} from 'react-native';
import React from 'react';
import {useDispatch, useSelector} from 'react-redux'; // Import hooks from react-redux
import {addUser, deleteUsers} from '../../redux/slices/userSlice'; // Import the addUser actio... |
package lua
import (
"io"
"strings"
"code.linenisgreat.com/zit/src/alfa/errors"
"code.linenisgreat.com/zit/src/alfa/schnittstellen"
"code.linenisgreat.com/zit/src/bravo/pool"
lua "github.com/yuin/gopher-lua"
lua_ast "github.com/yuin/gopher-lua/ast"
lua_parse "github.com/yuin/gopher-lua/parse"
)
type VM struc... |
/*! \mainpage TradingApp
This manual is divided in the following sections:
- \subpage quickstart
- \subpage usersguide
- \subpage developersguide
- \subpage knownissues
- \subpage license
- \subpage copyright
*/
/** \page quickstart Quick Start
- \subpage installation
- \subpage qsivte
*/
/** \page installation... |
package jpabook.jpashop.service;
import jpabook.jpashop.domain.Member;
import jpabook.jpashop.repository.MemberRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotati... |
import { nanoid } from "nanoid"
import React, { useState } from "react";
import Form from "./components/Form";
import FilterButton from "./components/FilterButton";
import Todo from "./components/Todo";
const FILTER_MAP = {
All: () => true,
Active: task => !task.completed,
Completed: task => task.completed
};
co... |
mod iter;
mod prefix;
mod range;
pub use self::iter::{RoIter, RoRevIter, RwIter, RwRevIter};
pub use self::prefix::{RoPrefix, RoRevPrefix, RwPrefix, RwRevPrefix};
pub use self::range::{RoRange, RoRevRange, RwRange, RwRevRange};
#[cfg(test)]
mod tests {
use std::ops;
#[test]
fn prefix_iter_last_with_byte_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.