text
stringlengths
6
571k
labels
stringclasses
154 values
/* * Copyright (c) 2000 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of sourc...
C
#ifndef STATIC_GRAPH_HPP #define STATIC_GRAPH_HPP #include "util/graph_traits.hpp" #include "util/integer_range.hpp" #include "util/percent.hpp" #include "util/permutation.hpp" #include "util/typedefs.hpp" #include "util/vector_view.hpp" #include "storage/shared_memory_ownership.hpp" #include "storage/tar_fwd.hpp" #...
C++
from BDall import * from MetodosBD import basedatos from random import randrange import time from datetime import date print("bienvenido a los Tacos de perro : 7 C/U") option= int(input("Ver Menu: 1 \nHacer Pedido: 2 \nMostrar Pedido: 3 \nCancelar Pedido: 4 \n")) cont = 0 db = basedatos() today=date.today() while cont...
Python
require 'spec_helper' describe 'apt::hold' do let :facts do { :osfamily => 'Debian', :lsbdistid => 'Debian', :lsbrelease => 'wheezy', } end let :title do 'vim' end let :default_params do { :version => '1.1.1', } end describe 'default params' do let :params do default_pa...
Ruby
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * User Engine Model * * @author(s) Tyler Diaz * @version 1.0 * @copyright Tyler Diaz - August 6, 2010 * @last_update: May 2, 2011 by Tyler Diaz **/ class User_engine extends CI_Model { var $update_queue = array(); function __con...
PHP
/* * FINBOURNE Identity Service API * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 0.0.1547 * Contact: info@finbourne.com * Generated by: https://github.com/openapitools/openapi-generator.git */ using Syst...
C#
#!/bin/bash # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh # # Automation script to create specs to build cc-shim set -e source ../versions.txt source ../scripts/pkglib.sh SCRIPT_NAME=$0 SCRIPT_DIR=$(dirname $0) PKG_NAME="cc-shim" VERSION=$cc_shim_version...
Shell
import {DOCUMENT} from '@angular/common'; import {ElementRef, Inject, Injectable} from '@angular/core'; import {getElementPoint} from '@taiga-ui/addon-editor/utils'; import {TuiDestroyService, typedFromEvent} from '@taiga-ui/cdk'; import {TuiPoint} from '@taiga-ui/core'; import {Observable} from 'rxjs'; import {map, st...
TypeScript
type BuildPowersOf2LengthArrays< N extends number, R extends never[][] > = R[0][N] extends never ? R : BuildPowersOf2LengthArrays<N, [[...R[0], ...R[0]], ...R]>; type ConcatLargestUntilDone< N extends number, R extends never[][], B extends never[] > = B["length"] extends N ? B : [...R[0], ...B][N] ex...
TypeScript
in vec2 fTexCoord; layout(binding = 0) uniform sampler2D diffuseTexture; #ifdef BILATERAL layout(binding = 1) uniform sampler2D depthTexture; #endif uniform vec2 blurDirection; uniform float offset[80]; uniform float weight[80]; uniform int kernelSize; #ifdef BLUR_RGB out vec3 color; #endif #ifdef BLUR_RG out vec...
GLSL
<div class="jarviswidget jarviswidget-color-darken" id="wid-id-audit" data-widget-editbutton="false" data-widget-deletebutton="false"> <header> <span class="widget-icon"> <i class="fa fa-history"></i> </span> <h2>Audit Trail</h2> </header> <!-- widget div--> <div> <!-- widget...
PHP
from django.http import HttpResponse from django.template import RequestContext, loader from photologue.models import Gallery def index(request): template = loader.get_template('under_construction.html') context = RequestContext(request) return HttpResponse(template.render(context)) def gallery(request...
Python
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; class KeywordsController extends Controller { public function index() { if (\Auth::check()) { // 認証済みの場合 // 認証済みユーザを取得 $user = \Auth::user(); // ユーザのキーワードの一覧を取得 $keywo...
PHP
export {DateCustomBase as DateCustom} from "../classesBase/DateCustomBase.js";
TypeScript
package mobi import ( "bytes" "encoding/binary" ) func (w *MobiWriter) chapterIsDeep() bool { for _, node := range w.chapters { if node.SubChapterCount() > 0 { return true } } return false } func (w *MobiWriter) writeINDX_1() { buf := new(bytes.Buffer) // Tagx tagx := mobiTagx{} if w.chapterIsDeep() ...
Go
import {Map} from "immutable"; import {validateSchema} from "../../validateSchema/index"; import {createValidatorErrors} from "@ui-schema/ui-schema/ValidityReporter/ValidatorErrors"; export const ERROR_ADDITIONAL_PROPERTIES = 'additional-properties'; /** * Return false when valid and string for an error * * @param...
JavaScript
using FinCleaner.Model; namespace FinCleaner.Rules; public interface IRule { IEnumerable<Transaction> Apply(Transaction transaction); }
C#
# coding:utf-8 from PyQt5.QtCore import QThread, pyqtSignal, Qt from PyQt5.QtWidgets import * from PyQt5 import QtGui import sys import itchat from itchat.content import * import datetime import time import os import top.api import requests import json import re from urllib.request import urlretrieve import traceback ...
Python
" Vim syntax file " Language: sqlj " Maintainer: Andreas Fischbach <afisch@altavista.com> " This file is based on sql.vim && java.vim (thanx) " with a handful of additional sql words and still " a subset of whatever standard " Last change: 31th Dec 2001 " au BufNewFile,BufRead *.sqlj so $VIM/syntax/sqlj.vim " quit...
Vim Script
// // SBGetUnitList.m // SimplyBookMobile // // Created by Michail Grebionkin on 29.07.15. // Copyright (c) 2015 Capitan. All rights reserved. // #import "SBGetUnitListRequest.h" #import "SBRequestOperation_Private.h" #import "SBPerformer.h" @interface SBGetUnitListResultProcessor : SBResultProcessor @end @imp...
Objective-C
<?php declare(strict_types = 1); /** * Jyxo PHP Library * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file license.txt. * It is also available through the world-wide-web at this URL: * https://github.com/jyxo/php/blob/master/license.txt */ names...
PHP
//----------------------------------------------------------------------------- // Copyright : (c) Chris Moore, 2020 // License : MIT //----------------------------------------------------------------------------- [assembly: PartId(PartId.Workers)] namespace Z0.Parts { public sealed partial class Workers :...
C#
/* * (C) Copyright 2020 Radix DLT Ltd * * Radix DLT Ltd licenses this file to you 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 req...
Java
//DEPRECATED if (false) { if (localStorage.getItem(LOCAL_STORAGE_TAG + "2x-mode") === "true") { localStorage.setItem(LOCAL_STORAGE_TAG + "2x-mode", "false") alert("2X mode disabled") } else { localStorage.setItem(LOCAL_STORAGE_TAG + "2x-mode", "true") alert("2X mode enabled") } window.location...
JavaScript
package daggerok; import io.vavr.Tuple; import io.vavr.collection.HashMap; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import java.util.Map; import java.util.function.Function; @SpringBootA...
Java
package containers; import net.mindview.util.Countries; import java.util.ArrayList; import java.util.Collections; import java.util.LinkedList; import java.util.List; /** * Created by IntelliJ IDEA. * User: deko * Date: 1/21/12 * Time: 1:31 AM * To change this template use File | Settings | File Templates. */ ...
Java
#!/usr/bin/env python3 """ Used for doing misc testing """ # rubiks cube libraries from rubikscubennnsolver import RubiksCube, configure_logging from rubikscubennnsolver.RubiksCubeNNNOdd import solved_171717 configure_logging() cube = RubiksCube(solved_171717, "URFDLB") cube.randomize(count=2000) cube.print_cube("pl...
Python
/* * Hibernate, Relational Persistence for Idiomatic Java * * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. */ /* * Hibernate, Relational Persistence for Idiomatic Java * * License: GNU Less...
Java
namespace RingCentral { public partial class SubscriptionInfo { // Internal identifier of a subscription public string @id { get; set; } // Canonical URI of a subscription public string @uri { get; set; } // Collection of API resources (message-store/presence/detailed pre...
C#
const newQuote = document.querySelector('#new-quote'); const quote = document.querySelector('#text'); const author = document.querySelector('#author'); let quoteObject; //add quote when page loads window.onload = getQuote; // //change quote when button is clicked // setTimeout('getQuote()', 5000); //function to get...
JavaScript
/* * @lc app=leetcode id=489 lang=java * * [489] Robot Room Cleaner * * https://leetcode.com/problems/robot-room-cleaner/description/ * * algorithms * Hard (71.82%) * Total Accepted: 66.1K * Total Submissions: 92K * Testcase Example: '[[1,1,1,1,1,0,1,1],[1,1,1,1,1,0,1,1],[1,0,1,1,1,1,1,1],[0,0,0,1,0,0,0,...
Java
"""Supervisr DNS Migration views""" from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from django.shortcuts import redirect, reverse from django.utils.translation import ugettext as _ from supervisr.core.models import (Domain, ProviderInstance, ...
Python
/** * @param.username * @param.password */ const request = require('request'); function getSt(swc, options){ return new Promise(resolve=>{ var option = { url : 'https://weibo.cn/', headers : { 'cookie' : 'SUB=' + options.sub } } request(option, function(err, res, body){ var stSource = body.subs...
JavaScript
import { Component, OnInit } from '@angular/core'; import { stubTrue } from 'lodash'; import { ExploreService, API, ExploreAPI } from '../explore.service'; import { Router } from '@angular/router'; import { TransferState, makeStateKey } from '@angular/platform-browser'; const STATE_KEY_HOME = makeStateKey('home'); @C...
TypeScript
# -*- coding: utf-8 -*- # @Time : 2020/12/23 01:59:33 # @Author : ddvv # @Site : https://ddvvmmzz.github.io # @File : __init__.py # @Software: Visual Studio Code from mmpi import processing signatures = [] # Don't include machinery here as its data structure is different from the # other plugins - of wh...
Python
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import * as React from 'react'; import formatMessage from 'format-message'; import { Dropdown, IDropdownOption } from '@fluentui/react/lib/Dropdown'; import { Icon } from '@fluentui/react/lib/Icon'; import { Stack } from '@fluentui/react/lib/St...
TSX
const User = require("../models/User"); class UsersDb { constructor(userObject) { ({ userName: this.userName, email: this.email, password: this.password } = userObject); } findByUserName() { return new Promise((resolve, reject) => { User.findOne({ userName: this.userName }).t...
JavaScript
<?php /* +--------------------------------------------------------------------------+ | Zephir | | Copyright (c) 2013-present Zephir Team (https://zephir-lang.com/) | | ...
PHP
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerHealthController : MonoBehaviour,IHealthUI { [SerializeField,Range(0,100)] float _health; [SerializeField] bool _immortalMode; [SerializeField] GameObject _particles; // Start is called before the first f...
C#
<?php require_once('SPIL/Loader.php'); class SPIL_DataMapper_FormUrlEncoded_Test extends PHPUnit_Framework_TestCase { function testInput() { $mapper = new SPIL_DataMapper_FormUrlEncoded(); $actual = $mapper->input('a=b&c=d'); $expected = array('a'=>'b', 'c'=>'d'); $this->assert...
PHP
import airService from '@/api/air.service'; /** * Fetch content * @param {*} commit - commit mutations * @param {*} offset - number of rows at the beginning which have to be omit * @param {*} methodName - name of AIR service method */ export default function(commit, offset, methodName) { airService[methodName]...
JavaScript
Friend Class TestSignatureHelpSource Implements ISignatureHelpSource
Visual Basic
import React from 'react'; import moment from 'moment'; export interface PickerProps { value?: moment.Moment; prefixCls: string; } export default function createPicker(TheCalendar: any): React.ClassicComponentClass<{ prefixCls: string; }>;
TypeScript
function validateUsr(username) { return /^[0-9a-z_]{4,16}$/.test(username) }
JavaScript
<?php /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * Description of asistente_controller * * @author equipo1 */ class AsistenteController extends AppController { //put your code here function asistente1() {//personales Load::model('prove...
PHP
// // SKChangePasswordViewController.swift // 365KEY_swift // // Created by 牟松 on 2016/12/14. // Copyright © 2016年 DoNews. All rights reserved. // import UIKit class SKChangePasswordViewController: UIViewController { var navBar: UINavigationBar? var navItem: UINavigationItem? var titleName:...
Swift
RUN apt-get install -y php7.4
Twig
require 'net/http' require 'chef/rest' require 'chef/config' require 'chef/data_bag' require 'chef/encrypted_data_bag_item' bagname = 'nmdproxy' appname = 'upstream' environment = ARGV[4] server = /^([^.]*)/.match(ARGV[5]).to_s sitename = ARGV[6] action = ARGV[7] puts environment puts server puts sitename puts actio...
Ruby
#ifndef PRIOQ_H #define PRIOQ_H #include "datetime.h" #include "gen_alloc.h" struct prioq_elt { datetime_sec dt; unsigned long id; } ; GEN_ALLOC_typedef(prioq,struct prioq_elt,p,len,a) extern int prioq_insert(); extern int prioq_min(); extern void prioq_delmin(); #endif
C
package blcs.lwb.lwbtool.utils; import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.Matrix; import android.widget.ImageView; import com.google.zxing.BarcodeFormat; import com.google.zxing.BinaryBitmap; import com.google.zxing.DecodeHintType; import com.g...
Java
/* * Copyright (c) 2014, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #include <a...
C++
package dao import ( "context" "go-common/app/service/main/relation/model" xtime "go-common/library/time" "time" "testing" "github.com/smartystreets/goconvey/convey" ) func TestDaotagsKey(t *testing.T) { var ( mid = int64(0) ) convey.Convey("tagsKey", t, func(ctx convey.C) { p1 := tagsKey(mid) ctx.Co...
Go
package cn.forgeeks.mybatis.test.dao; import cn.forgeeks.mybatis.test.pojo.Teacher; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.InsertProvider; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Result; im...
Java
import { createResponse, ConvoyrResponse } from '@convoyr/core'; import { isServerError } from './is-server-error'; describe.each<[ConvoyrResponse, boolean]>([ [ createResponse({ status: 500, statusText: 'Internal Server Error', }), true, ], [ createResponse({ status: 200, ...
TypeScript
var ZenPen = (function() { 'use strict'; /** * Add trim function to strings * * @return string */ String.prototype.trim = function(){ return this.replace(/^\s+|\s+$/g, ''); }; /** * Get text from DOM nodes * * @param object el DOM node element * @return string */ functi...
JavaScript
package raft import ( "sync" "github.com/sidecus/raft/pkg/util" ) const targetAny = int(^uint(0) >> 1) type replicationReq struct { targetID int reqwg *sync.WaitGroup } // batchReplicator processes incoming requests (best effort) while at the same time tries to batch them for better efficency. // For each r...
Go
import React from "react" import { TextAreaField } from "@kaizen/draft-form" import { withDesign } from "storybook-addon-designs" import { figmaEmbed } from "../../../storybook/helpers" import { CATEGORIES, SUB_CATEGORIES } from "../../../storybook/constants" import { StoryWrapper } from "../../../storybook/components/...
TypeScript
#!/bin/bash if [ "$(uname)" = "Linux" ] then sudo apt-get install libtool autoconf fi sh ./autogen.sh ./configure make sudo make install
Shell
FROM alpine MAINTAINER Coneyware # docker run -it --rm -e PORT=6080 -e VNC_HOST=xxxx -p 6080:6080 coneyware/novnc # # タイムゾーン設定 # apk add tzdata # cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime # ※ タイムゾーン必要な分だけコピーしたら、あとは消す # ENV PORT=6080 \ VNC_HOST=localhost \ VNC_PORT=5900 RUN set -x \ && apk update \ &&...
Dockerfile
#pragma once #include "graphics/graphics.h" namespace gl3d { class Mesh { public: gl::Drawable drawable; }; }
C
#include "stdio.h" #include "stdlib.h" int sum; int and; int b[2]; void foo () { sum = b[0] + b[1]; and = b[0] & b[1]; } int main (int argc, char* argv[]) { char* ep; if (argc != 3) { printf("invalid number of arguments, takes 2 numbers\n"); return -1; } for (int i=...
C
<?php /* @var $this \yii\web\View */ /* @var $content string */ use yii\helpers\Html; use yii\bootstrap\Nav; use yii\bootstrap\NavBar; use yii\widgets\Breadcrumbs; use app\assets\AppAsset; use app\staticcontent\Navbar as CustomNavBar; AppAsset::register($this); $navbar = new CustomNavBar(); //\app\components\HelperF...
PHP
package tech.aurora.bfadmin.model; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.Serializable; import java.util.Collections; import java.util.Comparator; import java.util.List; @Data @AllArgsConstructor @...
Java
chapter \<open>Generated by Lem from \<open>sorting.lem\<close>.\<close> theory "Lem_sorting" imports Main "Lem_bool" "Lem_basic_classes" "Lem_maybe" "Lem_list" "Lem_num" "Lem" "HOL-Combinatorics.List_Permutation" begin \<comment> \<open>\<open>open import Bool Basic_classes Maybe List Num\<clos...
Isabelle
import numpy def generate_random_parameters(parameter_search_space): if type(parameter_search_space) == dict: generated_params = {} for param in parameter_search_space: _generate_random_value_given_search_space(parameter_search_space, generated_params, param) return generated...
Python
import tasks import json import urllib from credentials import access_credentials from data_layer import locator_factory, ResourceLocator from typing import Generic, TypeVar, Dict, Optional T = TypeVar(tasks.FetchReportTask) class CredentialsProvider(Generic[T]): task: T def __init__(self, task: T): self.tas...
Python
/** * Package for multifromoneton. * * @author Mishin Yura (mishin.inbox@gmail.com) * @since 26.10.2018 */ package multifromoneton;
Java
%YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!74 &7400000 AnimationClip: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: Pet_begin_eating serializedVersion: 7 m_Legacy: 0 m_Compressed: 0 m_UseHighQualityCurve: 1 m_Rotat...
Unity3D Asset
package cim4j; import java.util.List; import java.util.Map; import java.util.HashMap; import cim4j.PowerSystemStabilizerDynamics; import java.lang.ArrayIndexOutOfBoundsException; import java.lang.IllegalArgumentException; import cim4j.Simple_Float; import cim4j.Boolean; import cim4j.Seconds; import cim4j.PU; /* I...
Java
import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { HttpErrorResponse } from '@angular/common/http'; import { Router } from '@angular/router'; import { ToastrService } from 'ngx-toastr'; import { Observable } from 'rxjs'; impo...
TypeScript
import React from 'react'; import { lookpath } from 'lookpath'; import fs from 'fs'; import { remote } from 'electron'; import path from 'path'; import log from 'electron-log'; import { execFile } from 'child_process'; import { XTerm } from 'xterm-for-react'; import { FitAddon } from 'xterm-addon-fit'; import { spawn }...
TypeScript
from .models import Product, Order from rest_framework import serializers class ProductSerializer(serializers.ModelSerializer): class Meta: model = Product fields = ['id', 'title', 'price', 'stock', 'description', 'created_at', 'updated_at'] class OrderSerializer(serializers.ModelSerializer): ...
Python
# Copyright 2021 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 in writing, ...
Python
% Genereate set of linear constraints used in z-udpate step % for s, v only function [Al, bl] = genQPLinearConstraints_sv(A, b) N = size(A, 1); d = size(A, 2); C = [A -A*ones(d,1)]; Al = [eye(N) -C]; %Al = [Al; [-eye(N) zeros(N, N) zeros(N,d+1)]]; %Al = [Al; eye(N+d+1)]; %bl =...
MATLAB
#!/bin/sh gofmt -w ./pkg/**/*.go goimports -local github.com/wenerme/uo -w . golangci-lint -E bodyclose,misspell,gocyclo,dupl,gofmt,golint,unconvert,goimports,depguard,gocritic,funlen,interfacer run --fix
Shell
// // ViewController.m // KVO本质 // // Created by 刘光强 on 2020/2/3. // Copyright © 2020 guangqiang.liu. All rights reserved. // #import "ViewController.h" #import "Person.h" @interface ViewController () @property (nonatomic, strong) Person *person1; @property (nonatomic, strong) Person *person2; @end @implementat...
Objective-C
 /* Автор: Stanislav Zhelnio (https://twitter.com/zhelnio) * Тип МК: ATmega88, Flash 8 Kbytes, SRAM 1 Kbytes, EEPROM 512 bytes. * Тактовая частота: F_CPU 16000000 MHz * Дата: 07.01.2014 * Версия ПО: Atmel Studio 6 (Version: 6.1.2730 - Service Pack 2) * FUSES: ...
C
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { localization } from "@responsible-ai/localization"; import { DefaultButton, IStackTokens, Stack } from "office-ui-fabric-react"; import React from "react"; import { ErrorCohortStats } from "../CohortStats"; import { ErrorCohort } from...
TypeScript
<?php namespace App\Http\Controllers\ECommerce\Domains; use App\Dorcas\Hub\Utilities\DomainManager\HostingManager; use App\Dorcas\Hub\Utilities\DomainManager\ResellerClubClient; use App\Dorcas\Hub\Utilities\DomainManager\Upperlink; use App\Dorcas\Hub\Utilities\UiResponse\UiResponse; use App\Http\Controllers\ECommerce...
PHP
import os import numpy as np import networkx as nx """ testgraphs.py functions to load an interesting collection of real-world graphs. TODO: download some other types of graphs (as edgelists) from SNAP. Write a quick dataloader for them too. These aren't in a common format so I can't write an automatic bulk download...
Python
using UnityEngine; using System; public class ResponseLoginEventArgs : ExtendedEventArgs { public short status { get; set; } public long user_id { get; set; } public string username { get; set; } public string email { get; set; } public int gamesPlayed { get; set; } public int gamesWon { get;...
C#
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = _default; function _default() { return function ({ addUtilities, variants }) { addUtilities({ '.list-inside': { 'list-style-position': 'inside' }, '.list-outside': { 'list...
JavaScript
l = [10,20,30,40] print(l) s, e = 1, 4 print(l[s:e]) print(l.index(30, s, e))
Python
/*========================================================================= Program: Visualization Toolkit Module: vtkDateToNumeric.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software i...
C
from django.utils.timezone import timezone from django.db import models # Create your models here. from users.models import MyUser class Tweet(models.Model): content = models.CharField(max_length=285) created = models.DateTimeField(auto_now_add=True) user = models.ForeignKey(MyUser, on_delete=models.CASC...
Python
@extends('production.master') @section('content') Homepage @endsection
PHP
from pathlib import Path from fhir.resources.codesystem import CodeSystem from oops_fhir.utils import CodeSystemConcept __all__ = ["MedicationKnowledgeStatusCodes"] _resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json")) class MedicationKnowledgeStatusCodes: """ Medication knowledge statu...
Python
import React from 'react' import { HeaderButton } from 'react-navigation-header-buttons' import { Ionicons } from '@expo/vector-icons' import { Platform } from 'react-native' import Colors from '../constants/Colors' const HeaderIcon= props => { return ( <HeaderButton {...props} IconComponent={Ionico...
JavaScript
/* * 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 ...
Java
using System; namespace Umbraco.Core { /// <summary> /// Represents the result of an operation attempt /// </summary> /// <typeparam name="T"></typeparam> /// <remarks></remarks> [Serializable] public struct Attempt<T> { private readonly bool _success; private readonly T _result; private readonly Excepti...
C#
(* problem 1*) type btree = Empty | Node of int * btree * btree let rec mirror : btree -> btree = fun t -> match t with |Node(i,x,y) -> Node(i, mirror y, mirror x) |_ -> Empty
OCaml
<template> <div class="toolbox"> <!-- Tooolbox Draggable Area for gates --> <draggable :list="gates" :group="{ name: 'gates', pull: 'clone', put: false }" :clone="cloneGate" > <transition-group type="transition" name="flip-list" class="toolbox-gates-area"> <!--------------...
Vue
#[macro_use] extern crate syn; use proc_macro::TokenStream; use std::str::FromStr; /// This attribute macro generates the boilerplate required to call into the /// contract-specific logic from the entry-points to the Wasm module. /// /// It should be added to the contract's init, handle, migrate and query implementat...
Rust
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Windows.Security.Cryptography; using Windows.Security.Cryptography.Core; using Windows.Storage.Streams; namespace BackTask { static class ApiHelper { //九幽反馈 public const string JyAppkey = @"1afd8ae4b933...
C#
#![deny(warnings)] use std::env; fn main() { println!("cargo:rerun-if-changed=build.rs"); if let Some(channel) = version_check::Channel::read() { if channel.supports_features() { println!("cargo:rustc-cfg=feature=\"specialize\""); println!("cargo:rustc-cfg=feature=\"stdsimd\"")...
Rust
CREATE TABLE IF NOT EXISTS CarryoverApportionments ( CarryoverApportionmentsId INTEGER NOT NULL UNIQUE, BudgetAccount TEXT(80) NULL DEFAULT NS, TreasuryAccount TEXT(80) NULL DEFAULT NS, BFY TEXT(80) NULL DEFAULT NS, EFY TEXT(80) NULL DEFAULT NS, Grouping TEXT(80) NULL DEFAULT NS, Description...
SQL
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SimpleWeather.OpenWeather.OneCall { public class AirPollutionRootobject { public Coord coord { get; set; } public List[] list { get; set; } } public class Coor...
C#
/********************************************************************************** * $URL$ * $Id$ *********************************************************************************** * * Copyright (c) 2008, 2009, 2010, 2011, 2013 Etudes, Inc. * * Portions completed before September 1, 2008 * Copyright (c) 2007,...
Java
(module FX2-040S-1.27DS (layer F.Cu) (tedit 5CC186A6) (fp_text reference REF** (at 0 5.715) (layer F.SilkS) (effects (font (size 1 1) (thickness 0.15))) ) (fp_text value FX2-040S-1.27DS (at 0 -11.049) (layer F.Fab) (effects (font (size 1 1) (thickness 0.15))) ) (fp_line (start -17.725 -11.405) (end 17...
KiCad Layout
import pytest import ubelt as ub def test_chunk_errors(): with pytest.raises(ValueError): ub.chunks(range(9)) with pytest.raises(ValueError): ub.chunks(range(9), chunksize=2, nchunks=2) with pytest.raises(ValueError): len(ub.chunks((_ for _ in range(2)), nchunks=2)) def test_ch...
Python