text
stringlengths
184
4.48M
package com.yanxiuhair.framework.aspectj; import java.util.Objects; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.reflect.MethodSignature; import org.slf4j.Logger; i...
<?php namespace App\Http\Controllers; use App\Models\Trains; use App\Models\User; use Illuminate\Http\Request; use Illuminate\Validation\Rule; class UserController extends Controller { //Showing Register Form public function register(){ return view('users.form')->with("form","register"); } //...
package com.learn.jvm.jdk8; import java.util.Random; import java.util.concurrent.CountDownLatch; /** * @author yds * @title: CountDownLatch * @description: TODO * @date 2021/3/8 15:07 */ public class CountDownLatchTest { public static void main(String[] args) throws InterruptedException { CountDownLa...
// @ts-ignore import { InfernActionsTypes , BaseThunkType} from './redux-store.ts'; // @ts-ignore import { secutiryAPI } from './../api/security-api.ts'; // @ts-ignore import { authAPI } from './../api/auth-api.ts'; import { FormAction, stopSubmit } from 'redux-form'; // @ts-ignore import { ResultCodesEnum, ResultCodeF...
import { Commands, Container } from "@swipechain/core-cli"; import { Networks } from "@swipechain/crypto"; import Joi from "joi"; import { File, Git, NPM, Source } from "../source-providers"; /** * @export * @class Command * @extends {Commands.Command} */ @Container.injectable() export class Command extends Comma...
import 'package:bordered_text/bordered_text.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:netflix_clone/application/bloc/home_bloc.dart'; import 'package:netflix_clone/core/colors/colors.dart'; // import 'package...
import Text from './components/Text'; import './styles/App.css'; import Button from './components/Button'; import Input from './components/Input'; import {useState} from 'react'; function App() { //State for name const [name, setName] = useState(''); //State for age const [age, setAge] = use...
install.packages("readxl") library(readxl) estimation <- read_excel("BBBCData.xlsx", sheet = "Estimation Sample") log_reg = glm(Choice ~ Gender + Amt_purchased + Frequency + Last_Purchase + First_purchase + P_Child + P_Youth + P_Cook + P_DIY + P_Art, data = estimation, ...
package academy.user import academy.user.role.UserRole import org.apache.commons.lang3.StringUtils import org.springframework.security.core.GrantedAuthority import org.springframework.security.core.authority.SimpleGrantedAuthority class AcademyUser { String name String surname String email Date cr...
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
(ns dujour.migrations (:require [clojure.java.jdbc :as jdbc] [clojure.java.jdbc.sql :as sql] [dujour.db :refer :all] [ragtime.core :refer :all] [ragtime.sql.database :refer :all] )) (defn clear-database! [database] (let [ddl-drop-tables ["DROP T...
import { ReactNode } from "react"; import { Color } from "../types/props"; export default function Button({ label, name, color = 'indigo', loading = false, onClick }: { label: string | ReactNode, name: string, color?: Color, loading?: boolean, onClick: () => void }) { const colors = { indigo: 'text-slate-1...
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "openzeppelin/contract...
package com.mca.application.service; import com.mca.application.services.SagaVideoGameService; import com.mca.infrastructure.adapters.out.persistence.SagaVideoGamePersistenceAdapter; import com.mca.infrastructure.adapters.out.persistence.entities.SagaEntity; import com.mca.infrastructure.model.Saga; import org.junit.j...
//* libraries import { useState } from "react"; import { Typography, Button, Box, Rating, useMediaQuery } from "@mui/material"; import PropTypes from "prop-types"; //* styles import { productItemStyles as styles } from "./productItem.styles"; export const ProductItem = ({ imageUrl, installments, listPrice, pri...
from passlib.context import CryptContext from sqlalchemy import Boolean, Column, Integer, String, select from sqlalchemy.orm import Session, relationship from app.db.session import Base from .profile import Profile from app.helper.exception import ( EmailConflictException, PasswordInvalidException, UserNo...
library(shiny) library(reticulate) library(png) # Activate the Python environment use_python("~/miniconda3/envs/r-reticulate/bin/python") # Define the paths to the Python scripts map_path <- "map.py" migrate_path <- "migrate.py" agri_path <- "agri.py" clear_path <- "clear.py" weather_api <- "weatherapi.py" # Define ...
'use client' import React, { useState } from 'react'; const ThemeContext = React.createContext() const ThemeProvider = ({ children }) => { const [theme, setTheme] = useState('light') const toggleTheme = () => { setTheme((theme) => { // if (theme === 'light') { // return 'dar...
/** * * This file is part of Disco. * * Disco is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Disco is distributed ...
import { useState } from 'react' import { Alert } from 'react-native' import { useNavigation } from '@react-navigation/native' import firestore from '@react-native-firebase/firestore' import { VStack } from 'native-base' import { Header } from '../components/Header' import { Input } from '../components/Input' import {...
/** * @param {number} k */ var MyCircularQueue = function(k) { this.queue = []; this.maxSize = k; this.currentSize = 0; this.front = 0; this.rear = -1; }; /** * @param {number} value * @return {boolean} */ MyCircularQueue.prototype.enQueue = function(value) { if (this.currentSize >= this....
import { EthereumAuthProvider, useViewerConnection } from "@self.id/framework"; // A simple button to initiate the connection flow. A Provider must be present at a higher level // in the component tree for the `useViewerConnection()` hook to work. function ConnectButton() { const [connection, connect, disconnect] ...
/* * Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" * which accompanies this distribution, and is available * at the URL "http://www.eclipse.org/legal/epl...
//! # Utility Functions for Kernel Operations //! //! This module provides various utility functions essential for kernel operations, //! including string manipulation, reading real-time clock data from CMOS, and performing hex dumps. //! These functions are for handling shell input, displaying system time, and debuggi...
/* * Copyright (C) 2008 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicab...
package com.kate.listeners; import java.sql.Connection; import java.sql.SQLException; import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import javax.servlet.annotation.WebListener; import com.kate.util.DBConnectionManager; /*AppContextListene...
import React from "react"; import Slider from "react-slick"; import "slick-carousel/slick/slick.css"; import "slick-carousel/slick/slick-theme.css"; import styled from "styled-components"; import LoginModal from "../login/login"; const HeroCarouselContainer = styled.div` position: relative; width: 100%; max-widt...
package hylo import scala.collection.mutable /** An array of bit values represented as Booleans, where `true` indicates that the bit is on. */ final class BitArray private ( private var _bits: HyArray[Int], private var _count: Int ) { /** Returns `true` iff `this` is empty. */ def isEmpty: Boolean = ...
import { Button, cn, IconButton } from '@stump/components' import { ArrowLeft, ArrowRight, DotsThree } from 'phosphor-react' import { useMemo } from 'react' import { useWindowSize } from 'rooks' import { usePagination } from '../../hooks/usePagination' import PagePopoverForm from '../PagePopoverForm' import { Paginati...
import {EventEmitter} from 'events'; export const eventEmiter = new EventEmitter(); export enum CallType { call = 'call', // 调用 callBack = 'callBack', // 回调 } declare global { interface Window { ReactNativeWebView: any } } export const defaultChannelName = 'ReactNativeWebView'; // 默认渠道名称 export interface M...
import { Repository, SelectQueryBuilder } from 'typeorm'; import BaseService from '../../core/base-service'; import Goods from '../../model/entity/goods'; import GoodsTag from '../../model/entity/goods-tag'; import { GoodsQuery, GoodsResult } from '../../common/QueryInterface'; export default class GoodsService extend...
import numpy import theano import theano.tensor as T import argparse import mnist """HYPERPARAMS""" parser = argparse.ArgumentParser() parser.add_argument("--batch_size", type = int, default = 600, help = 'Size of the minibatch') parser.add_argument("--n_iter", type = int, default = 50000) parser.add_argument("--init...
using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Windows.Forms; using Gsharp; using System.Threading; using System.IO; namespace Geo_Wall_E { public partial class Work : Form { public Work() { InitializeComponent(); } ...
package adivinanzadenumero_ej5; import java.util.InputMismatchException; import java.util.Random; import java.util.Scanner; public class AdivinanzaDeNumero_Ej5 { public static void main(String[] args) { /* Escribir un programa en Java que juegue con el usuario a adivinar un número. La computadora...
------------------------------------------------------------------------------- --- ANSIFILTER MANUAL - Version 1.4 ------------------------- August 2010 --- ------------------------------------------------------------------------------- OSI Certified Open Source Software -------------------------------------------...
// // DatePickerField.swift // // // Created by Irshad Ahmad on 06/05/22. // // // 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...
<template> <div :class="className" :style="{height:height,width:width}"/> </template> <script> import echarts from 'echarts' require('echarts/theme/macarons') // echarts theme import { debounce } from '@/utils' const animationDuration = 6000 export default { props: { className: { type: String, de...
Use Case: High Performance Computing software for MPI (Message Passing Interface) applications Code details and examples: MVAPICH2 is an MPI library designed for high-performance computing. Here is an example of running a simple MPI application using MVAPICH2: 1. Sample MPI application (hello.c): ```c #include <stdio...
import React, { useState } from 'react'; import { Tilt } from 'react-tilt'; import { motion, spring } from 'framer-motion'; import { styles } from '../styles'; import { github, web } from '../assets'; import { SectionWrapper } from '../hoc'; import { projects } from '../constants'; import { fadeIn, textVariant } from...
Availability:Public Title:Struct Variables in Blueprints Crumbs: %ROOT%, Engine, Engine/Blueprints, Engine/Blueprints/Scripting Description: Blueprint struct variables allow you to store different data types that contain related information together. version: 4.12 skilllevel:Intermediate Parent:Engine/Blueprints/Script...
from bs4 import BeautifulSoup, NavigableString import urllib.request import sys import re import os class WebnovelDownloader(object): # Get list of chapter urls def get_chapter_urls(self) -> list[str]: return [] def extract_chapter_title(self, chapter_soup) -> str: return "" def extract_chapte...
import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App from './App'; import reportWebVitals from './reportWebVitals'; import {createStore, applyMiddleware } from 'redux'; import thunk from 'redux-thunk'; import allReducers from './reducers' import {Provider} from 'react-redux' imp...
import React, { useState } from "react"; import { ToastContainer, toast } from "react-toastify"; import "react-toastify/dist/ReactToastify.css"; const Login = () => { const [username, setUsername] = useState(""); const [password, setPassword] = useState(""); const handleLogin = () => { if (!username || !pas...
<template> <a-card title="项目" :bordered="false" size="medium" style="overflow: hidden"> <a-card-grid :style="{ width: '33.33%' }" v-for="(item, index) in list" :key="item.name" class="card-grid-item"> <a-card :bordered="false" hoverable :class="'animated-fade-up-' + index"> <div class="head"> ...
import {useState} from 'react' import { StyleSheet, Text, View, StatusBar, TextInput, Platform, Pressable,ScrollView, ActivityIndicator, Alert, Keyboard } from "react-native"; import{MaterialIcons} from '@expo/vector-icons' import Slider from '@react-native-community/slider' const StatusBarHeight = StatusBar.currentHe...
<!DOCTYPE html> <html lang="en" xmlns:th="http://www.thymeleaf.org"> <head> <meta charset="UTF-8"> <title>Explorer</title> <link th:href="@{styles/main.css}" rel="stylesheet" /> </head> <body> <!--Надпись текущий каталог--> <p th:if="${not explorer.isDisk}" th:text="'Текущий каталог: ' + ${explorer....
import React, { FC, useContext } from 'react' import Modal from '@/components/01_atoms/Modal' import DotPulse from '@/components/01_atoms/DotPulse' import { Button } from '@mui/material' import Container from '@mui/material/Container' import { ContainerProps, WithChildren } from 'types' import * as styles from './style...
import React from "react"; import './style.css'; import Title, { TitleSize } from "../../UI/title/title"; import Switch from "../switch/switch"; import Button, { buttonsFunction, buttonsTypes } from "../../UI/button/Button"; function OrderModal ({transports}) { return ( <div className="order-modal"> ...
# Index Syntax Move provides syntax attributes to allow you to define operations that look and feel like native move code, lowering these operations into your user-provided definitions. Our first syntax method, `index`, allows you to define a group of operations that can be used as custom index accessors for your dat...
import { beforeEach, describe, expect, test, vi } from 'vitest' import { fireEvent, render } from '@testing-library/vue' import { setActivePinia, createPinia } from 'pinia' import { waitPerfectly } from '../setup' import Form from '~/pages/formScript.vue' vi.useFakeTimers() const mockPush = vi.fn() vi.mock('vue-rout...
# Copyright (C) 2020 Greenbone Networks GmbH # Some text descriptions might be excerpted from (a) referenced # source(s), and are Copyright (C) by the respective right holder(s). # # SPDX-License-Identifier: GPL-2.0-or-later # # This program is free software; you can redistribute it and/or # modify it under the terms o...
<?php /** * This file is part of the PINAX framework. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * Class pinax_components_LoginBox */ class pinax_components_LoginBox extends pinax_components_Component { var $_error = NUL...
import React, { PropsWithChildren, useState, ChangeEvent, forwardRef, useImperativeHandle, useRef, } from 'react'; import clsx from 'clsx'; import ExpansionPanel from '@material-ui/core/ExpansionPanel'; import Typography from '@material-ui/core/Typography/Typography'; import ExpansionPanelSummary from '@mat...
import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import {Routes, RouterModule} from '@angular/router'; import { AppComponent } from './app.component'; import { HeroesListComponent } from './heroes-list/heroes-list.component'; import { AlexisPoluxComponent } from './alexis-polux...
import { FC } from "react" import { useState } from "react" import { Box, Button, FormControl, FormLabel, Input, NumberDecrementStepper, NumberIncrementStepper, NumberInput, NumberInputField, NumberInputStepper, Textarea, Switch, } from "@chakra-ui/react" import { useWorkspace } from "../context...
<script> // NOTE! For the first iteration, we are simply copying the implementation of Assignees // It will soon be overhauled in Issue https://gitlab.com/gitlab-org/gitlab/-/issues/233736 import { __, sprintf } from '~/locale'; import ReviewerAvatarLink from './reviewer_avatar_link.vue'; const DEFAULT_RENDER_COUNT = ...
<!doctype html> <html lang="ko"> <head> <meta charset="utf-8"> <title>css3</title> <style> body { font:15px "나눔고딕"; color:#777; } #box1 { position:absolute; left:50px; top:50px; width:200px;height:200px; background:#FCC} #box2 { position: absolute; left: 150px; top: 120px; width: 200px; height: 200px; background:#F6...
public with sharing class LDC_LocationService { @TestVisible private Decimal lat {get; set;} @TestVisible private Decimal lng {get; set;} public LDC_LocationService(Id sObjectId) { if (sObjectId != null) { getLatLngFromObject(sObjectId); } else { //throw new Exceptio...
```markdown # Compliance Seeker Compliance Seeker is a web application designed to test websites for cross-border data transfer compliance. The application checks if websites transfer personal data outside of the EU without adequate safeguards, and looks for instances where data is sent to countries without an adequat...
/* * Copyright (c) 2020-2021 Huawei Device Co., Ltd. * 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...
<template> <q-card> <q-card-section v-if="achievements.length === 0" class="column items-center"> <div class="text-h6">Achievements</div> <div class="text-subtitle2">Your achievements will be displayed here</div> </q-card-section> <q-card-section v-else class="column items-center" horizontal> <q-card-...
#!/usr/bin/python3 """Defines unittests for models/amenity.py.""" import unittest import os from datetime import datetime from time import sleep from models.amenity import Amenity class TestAmenityMethods(unittest.TestCase): """Test cases for the Amenity class.""" @classmethod def setUpClass(cls): ...
import { TestBed } from '@angular/core/testing'; import { HttpService } from './http.service'; import { UserService } from './user.service'; import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { environment } from 'src/environments/environment'; import { User } from '.....
import { Injectable } from '@angular/core'; import { Camera, CameraResultType, CameraSource, Photo } from '@capacitor/camera'; import { Filesystem, Directory } from '@capacitor/filesystem'; import { Storage } from '@capacitor/storage'; import { Platform } from '@ionic/angular'; import { Capacitor } from '@capacitor/cor...
# Test Yourself (Multipart) 5.2 # Let's return to the example involving SAT scores where we took independent # simple random samples of 5 students who took the in school SAT prep course, # 5 students who had private SAT prep instruction, # and 5 students who did not take any SAT prep course. # Their SAT scores on t...
import React, { FC } from "react"; import DatePicker from "react-datepicker"; import Select from "react-select"; import { Input, Label, Row, Col, Button } from "reactstrap"; import { Formik } from "formik"; import * as yup from "yup"; import { DefaultOption, Task } from "../../../interfaces/task"; import { CustomDateP...
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */ /** * Language Select Dropdown */ import React, { Component } from "react"; import PropTypes from "prop-types"; import { connect, useSelector } from "react-redux"; import { DropdownToggle, DropdownMenu, Dropdown } from "reactstrap"; import { Scrollb...
package com.example.alleywayalliancelms.service; import com.example.alleywayalliancelms.exception.BookNotFoundException; import com.example.alleywayalliancelms.model.Book; import com.example.alleywayalliancelms.model.PatronAccount; import com.example.alleywayalliancelms.model.Role; import com.example.alleywayalliancel...
# Petals Chat A chatbot [web app](https://chat.petals.dev) + HTTP and WebSocket endpoints for LLM inference with the [Petals](https://petals.dev) client ## Interactive Chat <div align="center"> <img src="https://i.imgur.com/QVTzc6u.png" width="600px"> </div> You can try it out [here](https://chat.petals.dev) or run...
import { useContext } from "react"; import { Link, useHistory } from "react-router-dom"; import AuthContext from "../../store of browser provider/auth-context"; import classes from "./MainNavigation.module.css"; const MainNavigation = () => { const authCtx = useContext(AuthContext); const history = useHistory(); ...
/* tslint:disable max-line-length */ import { TestBed, getTestBed } from '@angular/core/testing'; import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { TestPaperUserService } from 'app/entities/test-paper-user/test-paper-user.service'; import { TestPaperUser } from 'app...
import { Global, Module } from '@nestjs/common' import { GraphQLModule } from '@nestjs/graphql' import { join } from 'path' import { UserModule } from './user/user.module' import { TypeOrmModule } from '@nestjs/typeorm' import { User } from './user/user' import { Policy } from './policy/policy' import { Index } from '....
import 'package:flutter/material.dart'; class ResultWidget extends StatelessWidget implements PreferredSizeWidget { final bool? won; final Function() onRestart; const ResultWidget({ required this.won, required this.onRestart, super.key, }); Color _getColor() { switch (won) { case null...
import { useEffect, useState } from "react" import { Spinner } from "react-bootstrap" import { useParams } from "react-router-dom" import { pedirDatos } from "../../mock/pedirDatos" import { ItemDetail } from "../ItemDetail/ItemDetail" export const ItemDetailContainer = () => { const [item, setItem] = useState(nu...
import React from 'react'; import { FaGithub, FaLinkedin } from 'react-icons/fa'; import { HiOutlineMail } from 'react-icons/hi'; import { AiFillTwitterCircle } from 'react-icons/ai'; function SocialConnections() { const socials = [ { id: 1, child: ( <> ...
package com.example.spring_batchstudy.validatoedParam; import lombok.extern.slf4j.Slf4j; import org.springframework.batch.core.Job; import org.springframework.batch.core.Step; import org.springframework.batch.core.configuration.annotation.JobScope; import org.springframework.batch.core.job.builder.JobBuilder; import ...
 function getFormattedFileSize(fileSize: number): string { let prefix: number; let suffix: string; const KILOBYTE_SIZE = 1000; const MEGABYTE_SIZE = 1000 * 1000; const GIGABYTE_SIZE = 1000 * 1000 * 1000; if (fileSize < KILOBYTE_SIZE) { prefix = fileSize; suffix = 'bytes'; ...
import { QueryClient, useMutation } from '@tanstack/react-query'; import { ToastContents } from '@/components/atoms'; import { User } from '@/types/users'; import { unfollowUser } from '../../api/user'; export type UseUnfollowMutationProps = { queryClient: QueryClient; authUser?: Pick<User, 'id'> & Partial<User>;...
#include "main.h" /** * _strlen - function that returns the length of a string. * * @s: pointer to an string * Return: int */ int _strlen(char *s) { int len = 0; while (*s != '\0') { len++; s++; } return (len); }
import React, { useRef, useState, useEffect } from "react"; import { Canvas } from "@react-three/fiber"; import { Environment } from "@react-three/drei"; import { Suspense } from "react"; import Loader from "./Loader"; import { Model as Marble } from "./3d/Marble"; import { Sparkles } from "@react-three/drei"; import ...
import SwiftUI struct HubsSection: View { @Environment(\.managedObjectContext) private var moc let trip: Trip @State var showHubAddition = false @State var hubDetail: Hub? = nil @FetchRequest private var hubs: FetchedResults<Hub> init(trip: Trip) { self.trip = trip _hubs = F...
package com.athimue.data.network.dto.searchArtist import com.athimue.data.network.dto.album.* import com.athimue.domain.model.Artist import com.google.gson.annotations.SerializedName data class SearchArtistDto( @SerializedName("id") val id: Long, @SerializedName("name") val name: String, @SerializedName("...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <link rel="stylesheet" href="css/reset.css"> <style> .nav { width: 1000px; } .nav .gnb { font-size: 0; } .nav .gnb li {display: inline-block; } .nav .gnb li a { display: blo...
import React, { useState } from 'react'; import VaultProIcon from '@mui/icons-material/Brightness5Outlined'; import WithdrawIcon from '@mui/icons-material/CreditCardRounded'; import CurrencyExchangeRoundedIcon from '@mui/icons-material/CurrencyExchangeRounded'; import DepositIcon from '@mui/icons-material/SavingsOutli...
import { useContext, useEffect, useState } from 'react' import { useDispatch, useSelector } from 'react-redux' import range from 'lodash/range' import isEmpty from 'lodash/isEmpty' import useMediaQuery from '@mui/material/useMediaQuery' import CircularProgress from '@mui/material/CircularProgress' import Typography fro...
using System.Security.Claims; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using MovieList.Data; using MovieList.Models; namespace MovieList.Controllers { [Authorize (Roles = "User")] public class ListController : Controller { privat...
#!/usr/bin/env python3 import os import re import shutil import sys # There are three different file type modules: # filemagic: ubuntu 16.04 # filetype: windows # magic: ubuntu 18.04 # so try them all, and use whichever one is installed. mime_module = None try: import filetype mime_module = 'filetype' except...
class TasksController < ApplicationController def index @tasks = Task.all end def show @task = Task.find(params[:id]) end def new @task = Task.new end def create @task = Task.new(set_task) @task.save redirect_to tasks_path(@task) end def edit @task = Task.find(params[:i...
from ev_comm.model.battery_state import BatteryState from ev_comm.model.charging_state import ChargingState from ev_comm.model.environment_state import EnvironmentState from ev_comm.model.position_state import PositionState from datetime import datetime class CarState: def load_from_psacc_response(self, response)...
import ch from 'chalk'; import exists from 'command-exists-promise'; import { spawn } from 'node:child_process'; import { EventEmitter } from 'node:events'; /* * Automatically find and open one of NeoVim, Vim, or Vi, the hardest editors to close */ class Vim extends EventEmitter { vim; editor; construct...
import os from "os"; import fs from "fs"; import url from "url"; import path from "path"; import BuildVitePressTemplate from "./vitepress-template-builder.js"; import { Console } from "@mekstuff/logreport"; import { DocDocsConfiguration } from "../configuration.js"; /** * Returns the `.dcodocs` root path. `./~/.doc...
<?php /** * Custom template tags for this theme * * Eventually, some of the functionality here could be replaced by core features. * * @package klean_blog */ /** * Auto add more links. * * @package klean_blog * @since 1.0 */ function klean_blog_content_more() { /* translators: link read more. */ $text =...
import opuslib import torch import numpy as np class OpusCodec(): """ Runs Opus compression with the same parameters used on each of the robots """ def __init__(self, channels, sr, frame_width=0.02) -> None: self.channels = channels # Initialize encoder self.encoder = ...
year_slider <- function(ns, ...) { shiny::sliderInput( ns("year"), "Jahr", min = min(.GlobalEnv$df_base$year), max = max(.GlobalEnv$df_base$year), value = ..., step = 1, round = TRUE, sep = "" ) } canton_selector <- function(ns) { shiny::selectInput( ns("canton_selection"), ...
<script lang="ts"> import type { Post } from '$lib/@types/Posts'; import { locale, t } from '$lib/i18n'; import { createEventDispatcher } from 'svelte'; import SvelteExMarkdown from 'svelte-exmarkdown'; export let post: Post; export let preview = false; const dispatch = createEventDispatcher(); function tagC...
#include <Servo.h> // Arduino pin assignment #define PIN_POTENTIOMETER 3 // Potentiometer at Pin A3 #define PIN_IR 0 #define PIN_LED 9 #define PIN_SERVO 10 #define _DUTY_MIN 553 // servo full clock-wise position (0 degree) #define _DUTY_NEU 1476 // servo neutral position (90 degree) #define _DUTY_MAX 2399 // servo ful...
# For this challenge, write a smart contract that uses view, pure, and payable functions. Ensure that the functions are accessible within the contract and derived contracts as well. pragma solidity ^0.8.0; contract FunctionExample { function viewFunction() public view returns (uint256) { // Function imple...
import { get } from "lodash"; import { MANUFACTURER } from "src/constants"; import { CategoryFilterState } from "src/state/categoryFiltersState"; import { SearchFilterState } from "src/state/searchFilterState"; import { FilterOperator, Watch } from "src/types"; import { normalizeString } from "src/utils/normalizeString...
import streamlit as st import pickle import string import nltk from nltk.corpus import stopwords from nltk.stem.porter import PorterStemmer ps = PorterStemmer() def transform_text(text): text = text.lower() text = nltk.word_tokenize(text) y = [] for word in text: if word.isalnum(): ...
# AverageProbabilitiesMetric *Back to [[SimpleMetrics]] page.* ## AverageProbabilitiesMetric [[include:simple_metric_AverageProbabilitiesMetric_type]] ### General description A metric for averaging multiple `PerResidueProbabilitiesMetrics`. ### Details Like other `PerResidueProbabilitiesMetrics` the probabilities ca...