text stringlengths 184 4.48M |
|---|
# Objetivo
Crear un SDK en Go llamado 'goqemu' para interactuar programáticamente con el emulador QEMU, principalmente desde Windows pero compatible con Linux y macOS. El SDK debe proporcionar una API clara y tipada para gestionar máquinas virtuales, enfocándose en casos de uso de pruebas de configuración y despliegue.... |
import * as React from "react"
import classNames from "classnames"
import { useTranslation } from "next-i18next"
import { signIn } from "next-auth/react"
import { useRouter } from "next/router"
import Link from "next/link"
interface FormLoginProps extends React.HTMLProps<HTMLFormElement> { }
interface FormStatus {
... |
<template>
<VForm @submit.prevent="submitForm()" class="my-4" v-model="isFormValid">
<VRow class="mb-3">
<VAlert v-if="submitError != ''" type="error">{{ submitError }}</VAlert>
</VRow>
<VRow class="d-flex justify-center">
<VCol cols="10" class="my-1 align-center">
... |
import React, { useEffect, useLayoutEffect, useRef, useState } from "react";
import "./App.css";
import data from "./imgData";
// Component
import Alpaca from "./component/Alpaca";
import Loading from "./component/Loading";
import Customize from "./component/Customize";
import DownloadRandom from "./component/Downloa... |
import React from "react";
import {
Navigate,
Route,
HashRouter as Router,
Routes,
} from "react-router-dom";
import RootLayout from "./Layouts/RootLayout";
import { ErrorPage } from "./components/ErrorPage/ErrorPage";
import { LullabiesInAnimation } from "./components/LullabiesInAnimation/LullabiesInAnimation"... |
Regularization, in mathematics and statistics and particularly in the fields of machine learning and inverse problems, refers to a process of introducing additional information in order to solve an ill-posed problem or to prevent overfitting.
In general, a regularization term is introduced to a general loss function:
... |
"""
utility functions to optimize a trained transformers model through:
1. serialization (ONNX or TorchScript tracing)
2. dynamic quantization (PyTorch/TorchScript or ONNX Runtime)
3. pruning random heads
Note: pruning random heads is only intended to be used an an experimental method to
measure the impact of pruning ... |
import pandas as pd
import pandas_gbq
import plotly.graph_objs as go
import plotly.figure_factory as ff
import matplotlib.pyplot as plt
import seaborn as sns
import plotly.express as px
import streamlit as st
from default import default_style
default_style()
st.write("""
# Distribuição de ocorrências POP
... |
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
<meta charset="ISO-8859-1">
<title>Spring Boot With Spring Security Registration and Login</title>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bo... |
import React, { useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import './Style/Main.css';
import Header from './Components/Header.js';
import axios from 'axios';
export default function App() {
const navigate = useNavigate();
const [isLoggedIn, setIsLoggedIn] = useState(false);... |
import streamlit as st
import numpy as np
import pandas as pd
st.set_page_config(
page_title = "Aplikasi Input Output"
)
st.title("Aplikasi Input Output")
with st.container():
st.write("Analisis Input-Ouput (I-O) adalah suatu model matematis untuk menganalisis keterkaitan antar sektor dalam suatu perekonomia... |
<!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>
<link href = "dom.css" type="text/css" rel="stylesheet">
<script src="dom.js"></scri... |
@demo @debug
Feature: Demo scenarios - For UI Testing
Should demonstrate main principles of framework
# Demonstarting UI Scenario with table verification and using DATA Provider
Scenario Outline: Create a new Exercise with <exerciseDescription> for <clientName>
Given User navigates to "http://loca... |
import {Action, ActionCreator, ThunkAction} from "@reduxjs/toolkit";
import Personaje from "../types/personaje.types";
import { IRootState } from "../store/store";
import { buscarPersonajeAPI } from "../services/personaje.services";
interface buscarPersonajeParams {
info:{
count:number,
next: strin... |
import {
HStack,
Heading,
Icon,
IconButton,
VStack,
Text,
Select,
CheckIcon,
FlatList,
useToast,
} from 'native-base'
import { Feather } from '@expo/vector-icons'
import { ProductCard } from '@components/ProductCard'
import { Loading } from '@components/Loading'
import { useCallback, useState } f... |
import Nerv from "nervjs";
import Taro from "@tarojs/taro-h5";
import { View, PickerView, PickerViewColumn } from '@tarojs/components';
import PropTypes from 'prop-types';
import './index.less';
export default class DatePicker extends Taro.Component {
state = {
pickVal: [],
range: {
years: [],
m... |
import { HamburgerIcon, StarIcon } from "@chakra-ui/icons";
import {
Avatar,
Box,
Button,
ButtonGroup,
Center,
Container,
Flex,
Grid,
GridItem,
HStack,
IconButton,
Menu,
MenuButton,
MenuItem,
MenuList,
Text,
useBreakpointValue,
useColorModeValue,
} from "@chakra-ui/react";
import { ... |
// @ts-nocheck
import { Suspense } from "react";
import { Routes } from "@blitzjs/next";
import Head from "next/head";
import Link from "next/link";
import { useRouter } from "next/router";
import { useQuery, useMutation } from "@blitzjs/rpc";
import { useParam } from "@blitzjs/next";
import { showNotification } from '... |
import { Component, Input, OnInit } from '@angular/core';
import { CardInfo } from 'src/app/interfaces/cardInfo.interface';
import { Router } from '@angular/router';
import { Store } from '@ngrx/store';
import { AppState } from 'src/app/store/app.state';
import * as CardsActions from '../../store/cards/cards.actions';
... |
import { useCallback, useState } from "react";
import { AudioUserCommand } from "../../context/contextTypes/voiceCommand.types";
import { useLogoutVoiceHandler } from "./genericHanlders/useLogoutVoiceHandler";
import { useNavigateBackVoiceHandler } from "./genericHanlders/useNavigateBackVoiceHandler";
import { userLogi... |
import { XMarkMini } from "@medusajs/icons"
import {
Alert,
Button,
Checkbox,
Heading,
Hint,
IconButton,
Input,
Label,
Text,
clx,
} from "@medusajs/ui"
import {
Controller,
FieldArrayWithId,
UseFormReturn,
useFieldArray,
useWatch,
} from "react-hook-form"
import { useTranslation } from "re... |
//
// ViewController.swift
// delight_labs_assignment
//
// Created by 장준모 on 2/21/24.
//
import UIKit
import RxSwift
import RxCocoa
import RealmSwift
import SwiftUI
import SnapKit
class ActivityViewController: UIViewController {
// MARK: Variables
let scrollView = UIScrollView()
let contentView ... |
# Copyright 2021 Northern.tech AS
# This file is part of CFEngine 3 - written and maintained by Northern.tech AS.
# 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; version 3.
# This progr... |
<?php
/*
* The MIT License
*
* Copyright 2021 zozlak.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, m... |
import * as Yup from "yup";
import { useState } from "react";
import RouterLink from "next/link";
import useTranslation from "next-translate/useTranslation";
import { useFormik, Form, FormikProvider } from "formik";
import RemoveRedEyeRoundedIcon from "@mui/icons-material/RemoveRedEyeRounded";
import VisibilityOffRound... |
package ex02_api;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import org.json.JSONArray;
import org.json.JSONObject;
public class Ex03_Naver_Search {
public static void main(String[] args) {
/*
*... |
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<!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">
<head runat="server">
<title></title>
</head>
<body... |
import * as vscode from 'vscode'
import { Dojo } from './dojo'
export function activate(context: vscode.ExtensionContext) {
console.log('Activating extension "DOJO"')
const session = new Dojo()
const startDojoCommand = vscode.commands.registerCommand('coding-dojo.start-coding-dojo', async () => {
try {
awai... |
import matplotlib.pyplot as plt
import numpy as np
import math
import random
class BisectionMethod:
def find_root(self, func, a = -1_000_000, b = 1_000_000, x_tolerance=1e-5, y_tolerance=1e-5, max_iterations=100000):
if func(a) * func(b) >= 0:
raise ValueError("The function must have different ... |
class User < ApplicationRecord
has_many :event, dependent: :destroy
has_many :training, dependent: :destroy
before_save :downcase_email
validates :name, presence: true, length: { maximum: 50 }
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z\d\-]+)*\.[a-z]+\z/i
validates :email,
presence: tr... |
import { mix } from '../math/MathNode.js';
import { Fn } from '../tsl/TSLCore.js';
/** @module ColorSpaceFunctions **/
/**
* Converts the given color value from sRGB to linear-sRGB color space.
*
* @method
* @param {Node<vec3>} color - The sRGB color.
* @return {Node<vec3>} The linear-sRGB color.
*/
export cons... |
### Figure 5 - Phototrophy:Heterotrophy ratio plots ###
### This script will allow you to calculate and plot phototrophy:heterotrophy ratios from a list of phototrophy-associated and heterotrophy-associated KO terms that are pre-defined ###
### Last Updated: November 10, 2023 ###
# Load libraries
library(tidyverse)
li... |
//{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
vector<vector<int>> rotateMatrix(int k, vector<vector<int>> mat) {
// code here
int n = mat.size();
int m = ... |
import { Injectable, NotFoundException } from '@nestjs/common';
import { CreatePacienteDto } from './dto/create-paciente.dto';
import { UpdatePacienteDto } from './dto/update-paciente.dto';
import { Like, Repository } from 'typeorm';
import { Paciente } from './entities/paciente.entity';
import { InjectRepository } fro... |
use std::thread;
use std::sync::mpsc::channel;
fn send_receive() {
// create channel
let (sender, receiver) = channel();
// thread to send data
let sending_thread = thread::spawn(move || {
sender.send("important data")
.expect("Could not send data")
});
// thread to receiv... |
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix = "form" uri = "http://www.springframework.org/tags/form" %>
<c:set var = 'root' value = "${pageContext.request.contextPath}/"/>
<!DOCTYP... |
import qrcode
from PIL import Image
import gradio as gr
def resize_for_condition_image(input_image: Image.Image, resolution: int):
input_image = input_image.convert("RGB")
W, H = input_image.size
k = float(resolution) / min(H, W)
H *= k
W *= k
H = int(round(H / 64.0)) * 64
W = int(round(W /... |
/**
* Merge sort: Use a pivot and move the items either to left or right of the pivot, continue doing so innrecurrsive way
* Time Complexity o(nlog n) worst case o(n^2)
* space complexity o (log(n)) *
*
*/
const numbers = [99, 44, 6, 2, 1, 5, 63, 87, 283, 4];
function quickSort(arr) {
//base case if the array ... |
export type TagTier = 'Baseline' | 'Gold' | 'Diamond' | 'Cosmic';
export type FabricSpecialty =
| 'Linen'
| 'Cotton'
| 'Silk'
| 'Wool'
| 'Denim'
| 'Cashmere'
| 'Tweed/Hemp'
| 'Recycled Materials';
export type ClothingType =
| 'Shirts'
| 'Pants'
| 'Dresses'
| 'Jackets'
| 'Wedding Wear'
| ... |
import 'package:flutter/material.dart';
class QRResult extends StatelessWidget {
final String code;
final Function() closeScreen;
const QRResult({Key? key, required this.closeScreen, required this.code})
: super(key: key);
@override
Widget build(BuildContext context) {
// Parse QR Code Data
f... |
<template>
<div>
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="card card-primary">
<div class="card-header">
<div class="d-flex justify-content-between">
... |
sealed trait MyStream[+A] {
def foldRight[B](z: => B)(f: (A, => B) => B): B = this match {
case MyStream.MyConst(h, t) => f(h(), t().foldRight(z)(f))
case _ => z
}
def toList: List[A] = this match {
case MyStream.MyConst(h, t) => h() :: t().toList
case _ => List()
}
}
object MyStream {
case o... |
<?php
/**
* @author Bloomreach
* @copyright Copyright (c) Bloomreach (https://www.bloomreach.com/)
*/
declare(strict_types=1);
namespace Bloomreach\EngagementConnector\Model\InitialExport\Action\Validator;
use Bloomreach\EngagementConnector\Api\Data\InitialExportStatusInterface;
use Bloomreach\EngagementConnector\... |
package com.skbr.binarytree.bfs.traversal;
import java.util.LinkedList;
import java.util.Queue;
import com.skbr.binarytree.BinaryTree.Node;
import com.skbr.binarytree.BinaryTreeFactory;
public class LevelOrderTraversalSeperateLineOuput {
private static void levelOrderTraversalUsingTwoQueue(Node root) {
if(ro... |
import React from 'react'
const lists = ['BMV', 'TOYOTA', 'HONDA']
const fetchApi = () => {
return new Promise((resolve) => {
setTimeout(() => {
resolve(lists)
}, 1000)
})
}
export default class Clock extends React.Component {
constructor(props) {
super(props)
this.state = {
time: {... |
import { Component, OnInit, ElementRef, ViewChild } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { Router, ActivatedRoute } from '@angular/router';
import { AuthService } from 'src/app/core/auth/auth.service';
import { PlatformDetectorService } from 'src/app/core/pla... |
{% load static %}
<!doctype html>
<html lang="en">
<head>
{% block meta %}
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Support for older IE browsers, eliminates html validation errors -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, ini... |
package biz.belcorp.salesforce.modules.creditinquiry.core.domain.usecases
import biz.belcorp.salesforce.core.domain.entities.session.Sesion
import biz.belcorp.salesforce.core.domain.executor.PostExecutionThread
import biz.belcorp.salesforce.core.domain.executor.ThreadExecutor
import biz.belcorp.salesforce.core.domain.... |
# python -m nuitka --include-package=pygame,websockets,pyperclip --nofollow-import-to=numpy,pygame.tests,pygame.examples --include-data-files=res/*=res/ --windows-icon-from-ico=res/green_tile.png --linux-icon=res/green_tile.png --standalone --onefile --disable-console --report=gui_client.report.txt gui_client.py
from _... |
import React from "react";
import { useUpdateUser } from "@/hooks/api/users/useUpdateUser";
import IconButton from "../shared/IconButton";
import { IoBanOutline } from "react-icons/io5";
import Modal from "../shared/Modal";
import Button from "../shared/Button";
import { successToast } from "@/toasts/toasts";
import us... |
import React, { useEffect } from 'react';
import { useForm } from 'react-hook-form';
import * as yup from 'yup';
import { yupResolver } from '@hookform/resolvers/yup';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';... |
import { useDispatch, useSelector } from 'react-redux';
import { deleteContact, fetchContacts } from '../../redux/operations';
import { useEffect } from 'react';
export const ContactList = () => {
const dispatch = useDispatch();
// Отримуємо частини стану
const items = useSelector(state => state.user.contacts.i... |
# Import necessary libraries
import streamlit as st
from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.chains import ConversationalRetrievalChain
from langchain.prompts import ChatPromptTemplate
from langchain.vectorstores import Chroma
from langchain.chat_models import ChatOpenAI
from langchain.pr... |
"use client";
import { useUserNFTs } from "@/hooks/useUserNFTs";
import {
copyToCLipboard,
decodeText,
getProfileGradientStyle,
shortedAccountAddress,
validateAccountAddress,
} from "@/lib/utils";
import { Copy, Loader, RefreshCcw, ShieldX } from "lucide-react";
import { useParams } from "next/navigation";
i... |
import 'dart:io';
import 'dart:math' as MATH;
import 'package:digital_government/core/general_models/education_orders_model.dart';
import 'package:digital_government/core/general_models/profile_model.dart';
import 'package:digital_government/core/general_models/transactions_model.dart';
import 'package:digital_governme... |
"use client";
import React, { useEffect, useState } from "react";
import axios from "axios";
interface Order {
_id: string;
userId: string;
addressId: string;
totalAmount: number;
orderId: string;
orderDate: string;
status: string;
}
interface Address {
_id: string;
userId: string;... |
import React, { useEffect, useState } from "react";
import { Disclosure, DisclosureButton, DisclosurePanel, Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/react';
import { Bars3Icon, BellIcon, XMarkIcon } from '@heroicons/react/24/outline';
import { Link } from 'react-router-dom';
const user = {
name: '... |
const express = require('express');
const http = require('http');
const { Kafka } = require('kafkajs');
const socketIO = require('socket.io');
const bodyParser = require('body-parser');
require('dotenv').config();
const app = express();
const server = http.createServer(app);
const io = socketIO(server);
const port = ... |
import React, { useEffect } from 'react';
import DatePicker from 'react-datepicker';
import Select from 'react-select';
import { differenceInMinutes } from 'date-fns';
import { Ingredient, ingredientOptions } from '../../data/ingredients';
import type { FeedingEntry, ActivityEntry, SleepEntry, BowelEntry, IngredientWit... |
<!--
@Name:导出PDF头部的任务表格信息
@Author:陆欢
@date:2021/02/19
@Remark:
@Copyright:西安精雕软件科技有限公司
-->
<template>
<q-table
wrap-cells
bordered
hide-bottom
row-key="id"
:data="taskItemList"
:columns="columns"
separator="cell"
class="q-mb-md my-sticky-header-table"
flat
:rows-per-page-option... |
#!/bin/bash
#
# This file is part of vbackup.
#
# vbackup 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.
#
# vbackup is distributed in... |
pragma solidity ^0.8.10;
import "./base.t.sol";
import "../../interfaces/IHookERC721Vault.sol";
import "@openzeppelin/contracts/proxy/beacon/IBeacon.sol";
contract HookVaultStorageTest is HookProtocolTest {
uint32 tokenStartIndex = 300;
address vaultProxy;
uint256 initTokenId;
function setUp() public {
... |
<div
fxLayout="column"
fxFill
class="w-320">
<div
fxFlex="none"
fxLayout="column"
*ngIf="false"
>
<mat-list class="">
<mat-list-item
class="c-pointer"
(click)="dialogService.login()">
<h3 matLine>SIGN IN</h3>
</mat-list-item>
</mat-list>
</div>
... |
import { AccountRecord } from '../record/AccountRecord';
import { BaseTable } from './BaseTable';
export class AccountTable extends BaseTable {
public static readonly instance = new AccountTable();
private readonly TABLE_NAME = 'accounts';
private readonly ACCOUNT_EMAIL = 'accountEmail';
private re... |
# Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
require 'rails_helper'
RSpec.describe Gql::Queries::Account::Avatar::List, type: :graphql do
context 'when fetching avatar' do
let(:query) do
<<~QUERY
query accountAvatarList {
accountAvatarList {
id
... |
import React from 'react';
import { Link } from 'react-router-dom';
import { connect } from 'react-redux';
import { userActions } from '../_actions';
class HomePage extends React.Component {
componentDidMount() {
this.props.dispatch(userActions.getAll());
// console.log(this.props);
}
ha... |
import List from '@mui/material/List';
import ListItemText from '@mui/material/ListItemText';
import { ListItemButton } from '@mui/material';
import { useState, useRef } from "react";
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
import ArrowDropUpIcon from '@mui/icons-material/ArrowDropUp';
import... |
\section{@Posix/File@: File and Directory Manipulation}
This module provides some simple functions for manipulating directories and
files.
##import "Std/Bool"
##import "Std/Int"
##import "Std/List"
##import "Std/String"
##import "Posix/Fd"
##import "Posix/Perm"
##import "Posix/Proc"
##val [
\subsection{Types}
#*#D... |
(function (odd) {
var utils = odd.utils,
Browser = odd.Browser,
events = odd.events,
EventDispatcher = events.EventDispatcher,
Event = events.Event,
IOEvent = events.IOEvent,
IO = odd.IO,
Mode = IO.Mode,
Credentials = IO.Credentials,
Cache = IO... |
package com.invoice.contratista.service
import com.invoice.contratista.data.source.local.UserLogged
import com.invoice.contratista.data.source.web.models.SingRequest
import com.invoice.contratista.data.source.web.models.Token
import com.invoice.contratista.data.source.web.models.UpdateTokenRequest
import com.invoice.c... |
from django.urls import path, include
from rest_framework import routers
from . import views
router = routers.DefaultRouter()
router.register(r'users', views.UserViewSet)
router.register(r'groups', views.GroupViewSet)
router.register(r'students', views.StudentViewSet)
urlpatterns = [
path('', include(router.urls... |
import { createSlice } from "@reduxjs/toolkit";
// Initial state
const initialState = {
posts: [],
postDetails: null,
searchResults: [], // Menambahkan state untuk hasil pencarian
};
// Define the reducers
const postSlicer = createSlice({
name: "post",
initialState,
reducers: {
setPosts: (state, actio... |
import request from 'supertest';
import App from '@/app';
import { StatusCodes } from 'http-status-codes';
import { prismaMock } from './prismaMock';
import { Request, Response, NextFunction } from 'express';
import {
loginInput,
user,
registerInput,
post,
reaction,
comment,
profile,
follow,
} from './d... |
import gcalc
import gleeunit/should
/// Test that 1! = 1
pub fn factorial_1_test() {
gcalc.factorial(1.0)
|> should.equal(Ok(1.0))
}
/// Test that 2! = 2
pub fn factorial_2_test() {
gcalc.factorial(2.0)
|> should.equal(Ok(2.0))
}
/// Test that 3! = 6
pub fn factorial_3_test() {
gcalc.factorial(3.0)
|> sh... |
import VeeValidate from 'vee-validate'
import Vue from 'vue'
import VueRecaptcha from 'vue-recaptcha'
import {
City,
CityApiRespone,
State,
StateApiRespone,
StateCityQueryParams
} from '../../interfaces/state-city'
import {
ApiResponse,
GetProfileRequest,
UpdateProfileRequest,
URC_Co... |
using Microsoft.EntityFrameworkCore;
using ModulsDB;
namespace Music_Catalog.Data
{
public class Seed
{
public static async Task SeedData(ApplicationContext context)
{
// Инициализация данных для артистов
if (!context.Artists.Any())
{
var ar... |
package project;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class CSVReader {
public static void main(String[] args) {
String coursesFilePath = "src/Courses.csv";
String classroomsFilePath = "src/C... |
#include<iostream>
#include<list>
#include<queue>
#include<vector>
using namespace std;
//undirected graph
class Graph{
int V;
//unweighted graph
list<int>* li;
public:
Graph(int V){
this->V=V;
// unweighted graph
li=new list<int>[V];
}
//uw graph
void addEdge(... |
package gitlab
import (
"encoding/json"
"fmt"
"io"
"net/http"
"google.golang.org/protobuf/encoding/protojson"
"github.com/pluralsh/kuberentes-agent/pkg/tool/errz"
"github.com/pluralsh/kuberentes-agent/pkg/tool/httpz"
)
type ResponseHandlerStruct struct {
AcceptHeader string
HandleFunc func(*http.Response... |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
/*
* 연속된 구간의 합이기 때문에 누적합 방법으로 문제를 풀이해야 한다.
* 배열의 연속 구간의 합은 sum[j]−sum[i]로 구할 수 있는데, 이 합의 M으로 나눈 나머지가 0인 순서쌍을 구해야 한다.
*
* (sum[j]−sum[i]) % M = 0 이 되고, 모듈러 연산은 분배가 가능하기 때문에 sum[j] % M − sum[i] % M = 0
*... |
/*
* Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... |
// src/components/Planet.js
import React, { useEffect, useState } from 'react';
import axios from 'axios';
const Planet = () => {
const [planets, setPlanets] = useState([]);
const [viewMode, setViewMode] = useState('list');
useEffect(() => {
fetchPlanets();
}, []);
const fetchPlanets = async () => {
... |
package dorin_roman.app.kongfujava.ui.components
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.width
import androidx.compo... |
using AutoMapper;
using shoe_shop_be.DTO;
using shoe_shop_be.Entities;
using shoe_shop_be.Errors;
using shoe_shop_be.Interfaces.IRepositories;
using shoe_shop_be.Interfaces.IServices;
using shoe_shop_be.Repositories;
namespace shoe_shop_be.Services
{
public class ProductService : IProductService
{
pri... |
import React, { useEffect, useState } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { Button } from 'react-bootstrap';
import Questions from './Questions.jsx';
import SearchBar from './SearchBar.jsx';
import QuestionForm from './QuestionForm.jsx';
import getQuestions from '../../actions/Q... |
// eslint-disable-next-line no-extra-semi
;(function(){
var encodingType = {
'crockford': {
// Crockford
'alphabet': '0123456789abcdefghjkmnpqrstvwxyz',
'alias':{ 'o': 0, 'i': 1, 'l': 1}
},
'rfc4648': {
// RFC4648
'alphabet': 'abcdefghijklmnopqrstuvwxyz234567',
'alias': {'8': 'b', '0': '... |
/* # Genesis Sample Child Theme ( GeneSass )
Theme Name: GeneSass
Description: This is a GeneSass sample theme created for the Genesis Framework.
Author: Ron Willemse
Author URI: https://www.ronwillemse.nl/
Template: genesis
Template Version: 2.2.2
Tags: sass, black, orange, white, one-column, two-columns, three-column... |
<div ng-controller="TasksCtrl" id="tasks-container">
<div class="tasks task0" ng-if="showAnnouncement">
<div class="survey-box">
<h4 style="font-weight: 400;">{{announcement_description}}</h4>
<div bind-html-compile="announcement_html" >
</div>
<button ng-cli... |
#include "order.h"
#include "process_handler.h"
#include "validate_handler.h"
#include "ship_handler.h"
int main(int argc, char *argv[]) {
// create handler
OrderHandler *validate_handler = new ValidateHandler();
OrderHandler *process_handler = new ProcessHandler();
OrderHandler *ship_handler = new Shi... |
import React, { useState, useEffect } from "react";
import {
Table,
TableBody,
TableContainer,
TableHead,
TableRow,
Paper,
TextField,
Button,
Box,
} from "@mui/material";
import axios from "axios";
import Header from "../../components/Header";
import { StyledTableCell, StyledTableRow } from "../../com... |
//package tests;
//
//import io.qameta.allure.*;
//import org.testng.Assert;
//import org.testng.annotations.Test;
//import pages.HomePage;
//import pages.MnemonicCardPracticePage;
//import utils.runner.ProjectProperties;
//import tests.helpers.TestData;
//
//import static com.microsoft.playwright.assertions.Playwright... |
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ContactListComponent } from './pages/contact-list/contact-list.component';
import { ContactFormComponent } from './pages/contact-form/contact-form.component';
import { ContactDetailsComponent } from './pages/conta... |
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<!DOCTYPE html>
<html>
<link href="webjars/bootstrap/3.3.6/css/bootstrap.min.css"
rel="stylesheet">
<head>
<title>RemindU Sign ... |
import { Discount } from './discount';
import { JsonExpressionParser, JsonExpressionScanner } from './json-expression';
export class Alert {
id: string;
readonly conditions: string[];
readonly conditionsEvaluationContext: 'EVERY' | 'SOME';
readonly notificationChannelIds: string[];
private readonly... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
img {
width:100%;
height:100%;
}
... |
library(devtools)
library(sp)
detach("package:MatchIt", unload=TRUE)
load_all("~/git/matchit/R")
#library(devtools)
#install_github("itpir/matchit")
library(MatchIt)
library(ncf)
# # for genetic
# library(rgenoud)
library(Matching)
# # for cem
library(cem)
library(Zelig)
# # for demo/analysis.R
# # install Rgraphviz... |
import { MigrationInterface, QueryRunner, Table } from 'typeorm';
export class CreateTableCarts1657536175410 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(new Table({
name: 'Carts',
columns: [
... |
import React, { useState } from 'react';
import {
AppBar,
Badge,
InputBase,
Toolbar,
Typography,
styled,
} from '@mui/material';
import MenuIcon from '@mui/icons-material/Menu';
import NotificationsIcon from '@mui/icons-material/Notifications';
import Avatar from '@mui/material/Avatar';
import Menu from '@m... |
# frozen_string_literal: true
module Validations
# User Validations
module User
extend ActiveSupport::Concern
included do
validates :role, inclusion: { in: %w[Admin Doctor], message: '%<value>s is not a valid role' }
validates_format_of :username, with: /^[a-zA-Z0-9_.]*$/, multiline: true
... |
import React from "react";
import useSWR from "swr";
import currency from "../pages/currency/[currencyCode]";
const fetchCurrency = (currencyCode) =>
fetch(
`https://api.ratesapi.io/api/latest?base=${currencyCode}`
).then((response) => response.json());
function rates({ currencyCode }) {
const { data, error ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.