text stringlengths 184 4.48M |
|---|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<!-- import the d3 library -->
<script type='text/javascript' src='../lib/d3.v5.min.js'></script>
<!-- Style sheet -->
<style>
#chart-container {
width: 70%;
float: left;
position: relative;
... |
const dotenv = require("dotenv");
const playwright = require("playwright");
dotenv.config();
(async () => {
const browser = await playwright.chromium.launch({ headless: true });
console.log("Initiating browser.")
const page = await (await browser.newContext()).newPage();
console.log("Visitting ", process.env... |
/**
* 将通过的百分比与十六进制颜色的R、G或B相加
* @param {string} color 要更改的颜色
* @param {number} amount 改变颜色的量
* @returns {string} 颜色的处理部分
*/
function addLight(color: string, amount: number) {
const cc = parseInt(color, 16) + amount
const c = cc > 255 ? 255 : cc
return c.toString(16).length > 1 ? c.toString(16) : `0${c.... |
require "rails_helper"
RSpec.describe "Posts with authentication", type: :request do
let!(:user) {create(:user)}
let!(:other_user) {create(:user)}
let!(:user_post) {create(:post, user_id: user.id)}
let!(:other_user_post) {create(:post, user_id: other_user.id, published: true )}
let!(:other_user_pos... |
package com.solidPrinciples;
import com.solidPrinciples.dependencyInversion.DependencyInversionTester;
import com.solidPrinciples.interfaceSegregation.InterfaceSegregationTester;
import com.solidPrinciples.liskovSubstitution.LiskovSubstitutionTester;
import com.solidPrinciples.liskovSubstitution.exception.PaymentFaile... |
<!DOCTYPE html>
<html lang="es">
<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">
<script>
/* 4. Escribe un bucle while que:
- Recorra del 1 al 20
- Si el número es divisible por 3 que muestre ... |
import { Component, OnInit, Injector, ViewChild, ElementRef, Renderer2, OnDestroy } from '@angular/core';
import { Location as NgLocation } from '@angular/common';
import { AppComponentBase } from '@shared/common/app-component-base';
import { ActivatedRoute, Router } from '@angular/router';
import { VideoCallServicePro... |
#pragma once
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(vector<vector<int>> triangle) {
vector<vector<int>> temp;
temp.assign(triangle.size(), vector<int>());
int answer = 0;
temp[0].push_back(triangle[0][0]);
for (int y = 1... |
from nicegui import ui
from nicegui.element import Element
class Circle(Element, component='circle.js'):
def __init__(self, x, y, radius, **kwargs):
super().__init__()
self.x = x
self.y = y
self.radius = radius
self.fill = kwargs.get('fill', 'black')
self.stroke =... |
import React, { useEffect, useRef, useState } from 'react';
import { IoSettingsOutline } from "react-icons/io5";
import Post from '../components/Post.jsx';
import CreatePost from '../components/CreatePost.jsx';
import { fetchFeeds, fetchFollowingPosts } from "../services/postService.js";
import TransparencySpinner from... |
# Inpainting canvas
canvas_html = """
<style>
.button {
background-color: #4CAF50;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
</style>
<canvas1 width=%d height=%d>
</canvas1>... |
class Api::V1::UsersController < ApplicationController
before_action :set_user, only: [:show, :update, :destroy]
# GET /users
def index
@users = User.all
render json: UserSerializer.new(@users, include: [:tasks, :assigned_tasks]).serialized_json
end
# GET /users/1
def show
user_json = UserSer... |
%
% This file is part of Pl-man
% Pl-man is a puzzle game inspired in the popular game pacman, and it is mainly aimed
% to teach programming in PROLOG and introductory courses of Artifial Intelligence.
%
% Copyright (C) 2007-2008 Francisco Gallego <ronaldo@cheesetea.com>
% Departamento de Ciencia de la Computación e In... |
/*
* Copyright (c) 2015, Adrian Moser
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditi... |
import { forwardRef, PropsWithChildren, ReactNode } from "react";
// @mui
import { Box } from "@mui/material";
import { useTheme } from "@mui/material/styles";
//
import { StyledLabel } from "./styles";
// ----------------------------------------------------------------------
type TLabelProps = {
color:
| "defa... |
const request = require("supertest");
const app = require("../server.js"); // Import your Express app
const dao = require("../backend/aws.js"); // Import your data access object
// Mock the dao's listFilesFromBucket function
jest.mock("../backend/aws.js", () => {
return {
listFilesFromBucket: jest.fn(),
load... |
<template lang="pug">
card-container.c-modal-review(title="Move To" ref="modalWindow")
template(#controls)
c-button(type="icon" iconL="close" size="small" @click="closeModal()")
template(#content)
.grid-6
c-select(label="Destination" v-model="selectedId" :errors="errors.dir" :data="items" required)
... |
<div class="reg-form">
<h1 mat-dialog-title>New User Registration</h1>
<div mat-dialog-content>
<form #registerForm="ngForm" (submit)="registerDoctor()">
<div>
<mat-form-field style="margin-right:10px">
<mat-label>Firstname</mat-label>
<input matInput type="text" name="firstname" #firstname="n... |
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:html5="http://xmlns.jcp.org/jsf/passthrough"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:... |
/************************************************************************
**
** Copyright (C) 2012 John Schember <john@nachtimwald.com>
** Copyright (C) 2012 Dave Heiland
**
** This file is part of Sigil.
**
** Sigil is free software: you can redistribute it and/or modify
** it under the terms of the GNU General P... |
<!DOCTYPE html>
<html lang="en">
<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>Document</title>
<style>
div {
/* 注意点:width和height属性默认设置的是内容区域的大小 */
width: 380px;
height: 38... |
import React, {useState, useEffect} from "react";
import {useDispatch, useSelector} from "react-redux";
import {Formik, Field, Form, ErrorMessage, useField} from "formik";
import * as Yup from "yup";
import {ADD_CONSULTATION_URL} from "../../../utils/Consts";
import RequestInstance from "../../../utils/RequestInstance"... |
package com.ldnel;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;
import javafx.scene.text.Text;
import java.io.*;
import java.util.ArrayList;
/**
* Created by ldnel_000 on 2015-10-25.
*/
public class Node implements ... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<link rel="stylesheet" href="css/style.css"/>
<title>ログ... |
from datetime import datetime
import logging
import holidays
import pandas as pd
def rename_ptax_columns(df_ptax: pd.DataFrame) -> pd.DataFrame:
expected_columns = {
0: 'dt_cotacao',
1: 'cod_moeda',
2: 'tp_moeda',
3: 'sg_moeda',
4: 'vl_taxa_compra',
5: 'vl_taxa_vend... |
class Admin::ProductsController < Admin::BaseController
before_action :set_product, only: %i[show edit update destroy]
before_action :set_root_categories, only: %i[show new edit]
def index
@title = "Admin - Products"
@products = Product.all
end
def show
@title = "Admin - Product:#{params[:id]}"
... |
require "./common"
require "./novika"
module Novika::Frontend::Nkas
extend self
# Appends information about the tool to *io*.
def help(io)
io << <<-HELP
nkas - Novika image assembler for Novika #{Novika::VERSION}
Syntax:
nkas [switches] [queries] <path/to/output/image.nki>
Switches:
... |
<!DOCTYPE html>
<html lang="nl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/style.css">
<title>Contact</title>
<style>
/*----------- Begin Joeri poging css confirm into maincss-----------------*/
... |
class LivrosController < ApplicationController
before_action :set_livro, only: %i[ show edit update destroy ]
before_action :authenticate_user!
# GET /livros or /livros.json
def index
@livros = Livro.all
@livros_classificados = Livro.includes(:book_reviews).where.not(book_reviews: { rating: nil })
... |
<template>
<li
v-cloak
class="nav-item"
>
<div id="notificationMenu">
<b-button
id="notification-menu-button"
:variant="buttonVariant"
:class="{'is-open': isOpen, 'has-messages': hasMessages}"
class="notification-menu-button"
data-toggle="dropdown"
r... |
import { StatisticItem } from 'components';
import { StatisticsList, StatisticTitle } from './Statistics.styled';
import { FaRegThumbsUp } from 'react-icons/fa';
import { MdPeople, MdOutlineProductionQuantityLimits } from 'react-icons/md';
import { GiTreeDoor } from 'react-icons/gi';
import PropTypes, { shape } from 'p... |
import 'package:expense_tracker/models/transaction.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
class TransactionList extends StatelessWidget {
final List<Transaction> transactions;
final Function deleteTx;
TransactionList(this.transactions,this.deleteTx);
@override
Widge... |
import tkinter as tk
import datetime
nepali_digits = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"]
nepali_months = ["बैशाख", "जेष्ठ", "असार", "श्रावण", "भाद्र", "आश्विन", "कार्तिक", "मंसिर", "पौष", "माघ", "फाल्गुन", "चैत"]
nepali_days_of_week = ["आइतवार", "सोमवार", "मंगलवार", "बुधवार", "बिह... |
#pragma once
template <typename T>
class Stack
{
private:
struct Node
{
T* value;
Node* next;
Node(T* value) {
this->value = value;
this->next = nullptr;
}
};
int size;
Node* head;
public:
Stack() {
this->head = nullptr;
... |
import { CompetitionDatabaseMock } from "./../mocks/CompetitionDatabaseMock";
import { CompetitionBusiness } from "./../../src/business/CompetitionBusiness";
import { IdGeneratorMock } from "./../mocks/IdGeneratorMock";
import { BaseError } from "../../src/errors/BaseError";
describe("Testanto create da CompetitionBusi... |
import "./App.css";
import Header from "./components/Header";
import Home from "./components/Home";
import VideoSection from "./components/VideoSection";
import EventSchedule from "./components/EventSchedule";
import OurSpeaker from "./components/OurSpeaker";
import EventGift from "./components/EventGift";
import { Bro... |
import React, { useEffect, useRef } from "react";
import { connect } from "react-redux";
import ReactPlayer from "react-player/youtube";
import PropTypes from "prop-types";
import {
isPlaying,
currentSong,
setProgress,
setVideoDuration,
setPercentage,
setSeeking,
setArtist,
setTitle,
setSeekKeyboard,
... |
package FS::cust_note_class;
use base qw( FS::class_Common );
use strict;
=head1 NAME
FS::cust_note_class - Object methods for cust_note_class records
=head1 SYNOPSIS
use FS::cust_note_class;
$record = new FS::cust_note_class \%hash;
$record = new FS::cust_note_class { 'column' => 'value' };
$error = $re... |
import React from 'react';
import ReactDOM from 'react-dom';
import PrimeraApp from './PrimeraApp';
import './index.css';
// document hace referencia al documento html: https://developer.mozilla.org/en-US/docs/Web/API/Document
// querySelector sirve para buscar un elemento por id o clase en el html
const divRoot = doc... |
import { useContext, useEffect, useState } from "react";
import { ToastContainer, toast } from 'react-toastify';
import { useNavigate, useLoaderData } from "react-router-dom";
import 'react-toastify/dist/ReactToastify.css';
import './styles.css'
import { handleUpdateUser, handleDeleteUser, handleUpdatePassword, updateU... |
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="ctp" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width... |
import { AfterInsert, AfterRemove, AfterUpdate, AfterLoad, Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
@Entity()
export class User {
@PrimaryGeneratedColumn()
id: string;
@Column()
email: string;
@Column()
password: string;
@AfterInsert()
logInsert() {
console.log("User inserted wit... |
import { createAsyncThunk, createSlice } from "@reduxjs/toolkit";
import { RootState } from "app/store";
import axios from "axios";
import { ApiStatus, API_URL_USER } from "features/Utils";
interface IUpdateTeacherInfoState {
status: ApiStatus;
showModal: boolean;
code: null | string;
}
const initialState: IUpd... |
package com.example.termproject.ui.dashboard;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import a... |
// eslint-disable-next-line @next/next/no-document-import-in-page
import Document, { Html, Head, Main, NextScript, DocumentContext } from 'next/document'
import flush from 'styled-jsx/server';
import React from 'react';
import { ServerStyleSheets } from '@material-ui/core';
class MyDocument extends Document {
stat... |
<script setup lang="ts">
import PureRadio from '@/Components/Pure/PureRadio.vue'
import { BannerWorkshop } from '@/types/BannerWorkshop'
import { useSolidColor } from '@/Composables/useStockList'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import { faCheck } from '@fal'
import { library } from '@for... |
import stringTotime from "jercel/helper/stringTotime";
import { useRouter } from "next/router";
import React from "react";
import Iframe from "react-iframe";
export interface ProjectDetails {
latestDeploymentId: string;
domain: string;
status: string;
createdAt: string;
lastUpdatedAt: string;
gitURL: strin... |
<?php
namespace App\Services;
use App\Jobs\ProcessUrlsJob;
use App\Models\Hotel;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
use Illuminate\Http\Client\Pool;
use Illuminate\Support\Facades\Cache;
class RateService
{
/**
* @param int $rateFrom
* @param int $rateTo
* @re... |
/*
Copyright (C) 2019 3NSoft Inc.
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the h... |
import * as React from 'react'
import 'prismjs/components/prism-jsx'
import 'prismjs/components/prism-tsx'
import 'prismjs/components/prism-css'
import 'prismjs/components/prism-markup'
import {GlobalTheme} from "../ThemeManager";
import {MarkdownBlock, NoCSSControlView} from "./NoCSSControlView";
import {Label} from "... |
import { useEffect } from 'react';
import closeIcon from '../../assets/images/close-icon.svg';
import { OrderProps } from '../../types/Order';
import { formatCurrency } from '../../utils/formatCurrency';
import { ModalBody, ModalOverlay, OrderActions, OrderDetailsContainer } from './styles';
interface OrderModalProps ... |
<script setup lang="ts">
import type { QInput, ValidationRule } from 'quasar';
import { useQuasar } from 'quasar';
import { ref } from 'vue';
import { useAuth } from '~/composable/useAuth';
import { useI18n } from '~/composable/useI18n';
import { useSignInMutation } from '../apis/useSignInMutation';
const { t } = useI... |
"""nanosip - Simply ring a phone."""
import asyncio
import hashlib
import os
import random
import re
import string
from abc import ABC, abstractmethod
from collections.abc import Callable
from typing import Any, NamedTuple, Optional, Union, List
class SIPError(Exception):
"""Raised when some SIP-protocol related... |
A. Service Description:
"itemservice" is a micro-service that provides the following RESTful API:
1. Add a new Item, (assuming the creation date is updated while adding the item)
2. Change the description of an Item
3. Mark an item status as “done” or “not done” (assuming the item status “done” can be marked as “not do... |
{% load static %}
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Na... |
/***************************************************************************************
* File Name : file.h
* CopyRight : 1.0
* ModuleName :
*
* Create Data : 2016/01/06
* Author/Corportation : ZhuoJianhuan
*
* Abstract Description : file管理函数的声明文件
*
*--------------------------------Revis... |
import { Instance, SnapshotOut, types } from 'mobx-state-tree';
/**
* Model description here for TypeScript hints.
*/
export const GlobalModel = types
.model('Global', {
isLoading: types.optional(types.boolean, false),
example: types.optional(types.number, 0)
})
.props({})
.views((self) => ({})) // ... |
<?php
namespace App\Http\Controllers\Backend;
use App\Http\Controllers\Controller;
use App\Http\Requests\StoreCategoryRequest;
use App\Models\Modal;
use App\Models\ProductModel;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
class ProductModelController extends Controller
{
/**
* Displ... |
// Variables
//
// Variables should follow the `$component-state-property-size` formula for
// consistent naming. Ex: $nav-link-disabled-color and $modal-content-box-shadow-xs.
// Tables
//
// Customizes the `.table` component with basic values, each used across all table variations.
// scss-docs-start table-variable... |
package com.example.tictactoe.manager;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.example.tictactoe.enumeration.GameState;
import com.example.tictactoe.model.TicTacToe;
import com.example.tictactoe.model.dto.TicTacToeMessage;
impo... |
import { login, getInfo, logout } from '@/api/user'
import { getToken, setToken, removeToken } from '@/utils/auth'
import router, { resetRouter } from '@/router'
const state = {
token: getToken(),
name: '',
avatar: '',
roles: []
}
const mutations = {
SET_TOKEN: (state, token) => {
state.token = token
... |
@extends('admin.admin_master')
@section('admin')
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<div class="page-content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="card">
<div ... |
package com.example.Diplomna.auth.controllers;
import com.example.Diplomna.auth.response.AuthenticationResponse;
import com.example.Diplomna.auth.response.ErrorResponse;
import com.example.Diplomna.auth.services.AuthenticationService;
import com.example.Diplomna.auth.request.AuthenticationRequest;
import com.example.D... |
---
title: Geyser Command Line Arguments and System Properties
description: Geyser offers a few command line arguments/system properties to allow you to configure Geyser without editing the config files.
---
# Geyser Command Line Arguments and System Properties
Geyser offers a few command line arguments/system proper... |
/*
Copyright 2023.
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 un... |
package edu.ntnu.fullstack.prosjekt.quizzer.mappers.impl;
import edu.ntnu.fullstack.prosjekt.quizzer.domain.dto.QuizDetailsDto;
import edu.ntnu.fullstack.prosjekt.quizzer.domain.dto.UserDto;
import edu.ntnu.fullstack.prosjekt.quizzer.domain.entities.QuizEntity;
import edu.ntnu.fullstack.prosjekt.quizzer.mappers.Mapper... |
package info.freelibrary.ark;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.TestName;
import org.junit.runner.RunWith;
import info.freelibrary.util.Logger;
import info.freelibrary.ark.v... |
# 概要
リモートライトパズルゲームの仕様と設計書です。
# 仕様
## ゲーム概要
webゲーム。プレイヤーはライトパネルを操作し、指定されたパターンを再現するゲームです。カメラがライトパネルを映し出し、プレイヤーは指示された通りにライトを点灯させることを目指します。最後のステージはwebカメラ上に移った実際のLEDライトパネルを操作します。ユーザが仮想のwebゲームから実際のリアルな世界へ転換する感動を体験させることが目的です。
## ゲームデザイン
### 1.1 ステージ構成
ステージ1〜9:通常のWebゲーム。ライトの点灯パターンを再現するパズル。
ステージ10:リアルタイムのリモートライトパズル。ラズベリーパイ... |
package usecase
import (
"context"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
)
func TestExecuteUseCase(t *testing.T) {
mockRateLimitRepository := new(mockRateLimitRepository)
mockRateLimitRepository.On("FindCurrentLimiterByKey", "key_a").Return(&FindCurrentLimite... |
import { BACKEND_API_LINK, API_GET_ALL_POSTS } from "../configs/config";
import Post from "../types/Post";
import React from "react";
import { useState, useEffect } from "react";
import axios from "axios";
const SeePosts: React.FC = () => {
const [posts, setPosts] = useState([]);
useEffect(() => {
co... |
// 199. Binary Tree Right Side View
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode... |
import React, { useState, useEffect } from 'react';
import { AppBar, Drawer, List, ListItem, ListItemButton, ListItemIcon, ListItemText, Toolbar, Typography, Grid, Button } from "@mui/material"
import { useTheme } from "@mui/material/styles";
import LogoutIcon from '@mui/icons-material/Logout';
import RecInovLogo from ... |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
/* woah */
import {TransferUtils} from "../../../utils/TransferUtils.sol";
import {ISharedErrors} from "../../shared/ISharedErrors.sol";
/**
* @title FeeManager
*/
contract FeeManager {
address public immutable feeRecipient;
uint256 public immutable ... |
<?php
/**
Цель: Предоставляет объект-заместитель для контроля доступа к другому объекту.
Характеристики: Применяется для ограничения доступа, ленивой инициализации или кэширования.
**/
interface Subject {
public function request();
}
class RealSubject implements Subject {
public function request() {
... |
import React from "react";
import Navbar from "react-bootstrap/Navbar";
import Nav from "react-bootstrap/Nav";
import NavDropdown from "react-bootstrap/NavDropdown";
import { LinkContainer } from "react-router-bootstrap";
import NavLink from "react-bootstrap/NavLink";
import logo from "./assets/logo.svg";
import "./Hea... |
#define _CRT_SECURE_NO_WARNINGS
#define PROGRAM_FILE "op_test.cl"
#define KERNEL_FUNC "op_test"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef MAC
#include <OpenCL/cl.h>
#else
#include <CL/cl.h>
#endif
/* Find a GPU or CPU associated with the first available platform */
cl_device_id create_device(... |
import { styles } from "../styles/mainCss";
import { Text, View, Image, Pressable, TouchableHighlight, SafeAreaView } from "react-native";
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
import { themeColors } from "../styles/base";
import { useState } from "react";
import Header from... |
import React from 'react';
import LandsStore from '../stores/landsStore'
import LandsActions from '../actions/landsActionCreators'
import Constants from '../constants'
import Utils from '../utils/utils'
import AnalysisScreenLayout from '../components/analysisScreenLayout'
const AnalysisScreenLayoutContainer = React.cr... |
# Description:
# A way to interact with the Google Images API.
#
# Configuration
# HUBOT_GOOGLE_CSE_KEY - Your Google developer API key
# HUBOT_GOOGLE_CSE_ID - The ID of your Custom Search Engine
# HUBOT_MUSTACHIFY_URL - Optional. Allow you to use your own mustachify instance.
# HUBOT_GOOGLE_IMAGES_HEAR - Opt... |
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import expect from '@kbn/expect';
import { FtrProviderContext } fr... |
import React from 'react';
import PropTypes from 'prop-types';
import useLanguage from '../../../../hooks/useLanguage';
import { Link } from 'gatsby-plugin-react-i18next';
import UpArrow from '../../../../svg/arr-up.svg';
import { scroller } from 'react-scroll';
const FooterRight = ({ title, links, navigationData }) =... |
import { applyGravity } from './applyGravity';
import { DeltaTime } from './deltaTime';
import { getAngleBetweenTwoPoints } from './getAngleBetweenTwoPoints';
import { getXFromAngle } from './getXFromAngle';
import { getYFromAngle } from './getYFromAngle';
import { Globals } from './globals';
import { PlayerDTO, Vector... |
if (!require("ggplot2")) install.packages("ggplot2")
if (!require("stringr")) install.packages("stringr")
if (!require("dplyr")) install.packages("dplyr")
if (!require("tidyverse")) install.packages("tidyverse")
library(tidyverse)
library(dplyr)
library(forcats)
# ENVIRONNEMENT -------------------------
source("R/... |
import { Badge, Center, Flex, Heading, Tab, TabList, Tabs, Tag, Text } from "@chakra-ui/react";
import ProblemPlayground from "components/Playground/ProblemPlayground";
import UserPreview from "components/User/UserPreview";
import { useNotify } from "hooks";
import PageLayout from "layouts/PageLayout/PageLayout";
impor... |
require "application_system_test_case"
class PaymentCardsTest < ApplicationSystemTestCase
setup do
@payment_card = payment_cards(:one)
end
test "visiting the index" do
visit payment_cards_url
assert_selector "h1", text: "Payment cards"
end
test "should create payment card" do
visit payment_... |
import axios from 'axios';
import React, { useState } from 'react';
import SignUpView from './SignUpView';
/**
* 회원가입
*
* @author yblee
* @since 2023. 12. 15.
*/
function SignUp() {
const ERROR_MSG = {
registerUser: '[User] 사용자 등록 실패',
};
const [input, setInput] = useState({});
/**
... |
public class Loop_Statements {
public static void main(String[] args) {
// While Loop
int a=1;
while (a<=10) {
System.out.println(a+" Shubham");
a=a+1;
}
System.out.println("While Loop Ended successfully!!");
// Do-while Loop
int i=100... |
import { EmbedBuilder } from 'discord.js'
function lotteryCommand (msg, args, userBalances) {
const ticketPrice = 100
const userBalance = userBalances.get(msg.author.id) || 0
if (!args.length) {
const embed = new EmbedBuilder()
.setColor('#3498DB')
.setTitle('🎟️ ¡Bienvenido a la Gran Lotería! �... |
// Approach 2 : Recursive Method
// TC : O(logN) SC : O(logN)
#include <iostream>
const int MOD = 1000000007;
// Recursive function to calculate the power of a number
long long power(long long N, long long R){
if (N == 0)
return 1;
if (R == 1)
return N % MOD;
long long res = power(N, R ... |
package final_exam.exercise4;
import java.text.Normalizer;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Scanner;
import java.util.regex.Pattern;
public class Management {
private ArrayList<Contact> contactList;
public Management() {
contactList = new ArrayList<>();
}
... |
/*
* Copyright 2023 Google LLC
*
* 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 ... |
import { createSlice } from "@reduxjs/toolkit";
import { RootState } from "../../store";
import { User, Post } from "../../tipos/types";
import { john, mike } from "../../mockData";
type PostBookmarkedAction = { payload: Post };
const initialState: { currentUser: User } = { currentUser: john };
export const userSl... |
/*******************************************************************************
* Copyright (c) 2016 Stefan Reichert
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* ht... |
// Function.length retorna o total de argumentos da função. Function.name retorna uma string com o nome da função.
function somar(n1, n2) {
return n1 + n2;
}
somar.length; // 2
somar.name; // 'somar'
// --------------------------------------------------------------------------------------------------------------... |
import {Priority} from '@prisma/client';
import React from 'react';
import {RoundedSquareBackground} from './RoundedSquareBackground';
import {priorityColors} from '../../utils/priorityColors';
import {MenuItem, Select} from '@mui/material';
import {objectKeys} from '~/utils/objectKeys';
import emotionStyled from '@emo... |
package com.dicoding.todoapp.data
import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import com.dicoding.todoapp.R
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withContext
import org.json.JSON... |
import React from "react";
import { useEffect } from "react";
import ReactPlayer from "react-player";
import { useLocation } from "react-router-dom";
import { useResultContext } from "../../contexts/ResultContextProvider";
import { Loading } from "../Loading";
import {
ImagesWrapper,
ImageWrapper,
PlayerWrapper,
... |
from apps.hitmen.mixins import (
AdminAndManagersPermissionMixin,
AutheticatedPermissionMixin,
)
from apps.hits.forms import HitAddForm, HitAddBulkForm, HitUpdateForm
from apps.hits.models import Hits
from django.views.generic import DetailView, ListView, UpdateView
from django.views.generic.edit import FormVie... |
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using NetCoreSample.Classes;
using NetCoreSample.Interfaces;
using NetCoreSample.Mode... |
var chalk = require('chalk');
var util = require('util');
function NestedReporter(extendBaseReporter, formatError, config, options) {
var self = this;
extendBaseReporter(self);
// Allow ourselves to call superclass methods.
self._super = {
specFailure: self.specFailure.bind(self)
};
options = option... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.