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 |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 438