text stringlengths 0 26.7k | image imagewidth (px) 16 768 | language stringclasses 32
values |
|---|---|---|
```cpp
#include<cstdio>
#include <algorithm>
using namespace std;
int v[1001],w[1001];
int N,W,i,j;
int dp[101][10001];
int main(){
scanf("%d %d",&N,&W);
for(j = 0; j < W; j++)dp[0][j] = 0;
for(i = 1;i <= N;i++){
scanf("%d %d",&v[i - 1],&w[i - 1]);
for(j = 0;j <= W;j++){
if(j - ... | C++ | |
```javascript
import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import Helmet from 'react-helmet';
import { getShowEditPost } from '../../../App/AppReducer';
import { fetchPost, editPostRequest } from '../../PostActions';
import { toggleEditPost } from '../../../App/AppActions';
import { ... | JS | |
```python
""" metdata constants """
from enum import Enum
DWD_FOLDER_MAIN = "./dwd_data"
DWD_FOLDER_STATION_DATA = "station_data"
DWD_FOLDER_RADOLAN = "radolan"
DWD_FILE_STATION_DATA = "dwd_station_data"
DWD_FILE_RADOLAN = "radolan"
STATION_ID_REGEX = r"(?<!\d)\d{5}(?!\d)"
RADOLAN_HISTORICAL_DT_REGEX = r"(?<!\d)\d{... | Python | |
```ruby
# Jekyll Plugin - Insane Vk-video Embed
#
# Author: Sergey Melnikov - https://github.com/MelnikovSergey
# Description: description will be later =)
module Jekyll
class Vk < Liquid::Tag
@vk_video_params = nil
VIDEO_URL = /[0-9]+.+/
def initialize(tag_name, markup, tokens)
super
if m... | Ruby | |
```javascript
$.ajax({
url: "/api/categories/",
type: "GET",
contentType: "application/json; charset=utf-8"
}).then(function (response) {
var dataToReturn = [];
for (var i = 0; i < response.length; i++) {
var tagToTransform = response[i];
var newTag = {
id: tagToTransform... | JS | |
```rust
let levels = match std::env::var("LOG").ok() {
Some(level) => level,
None => match level {
"off" => "off".to_string(),
_ => [
format!("vector={}", level),
format!("codec={}", level),
format!("file_source={}", level),
... | Rust | |
```csharp
using System;
using System.Linq;
namespace B
{
class Program
{
static void Main(string[] args)
{
string input = Console.ReadLine();
long N = Convert.ToInt64(input);
long SN = 0;
foreach (char c in input)
{
SN ... | C# | |
```javascript
import { connect } from "react-redux";
import { OwnTAO } from "./OwnTAO";
const mapStateToProps = (state) => {
return {
pastEventsRetrieved: state.globalReducer.pastEventsRetrieved,
nameId: state.nameReducer.nameId,
ownTAOs: state.nameReducer.taos,
taosNeedApproval: state.nameReducer.taosNeedApp... | JS | |
```rust
extern crate xvmath;
use xvmath::*;
fn debranch(a : vec, b : vec, c : vec) -> vec {
(c & a) | c.andnot(b)
}
fn main() {
let a = vec::newss(3.);
let b = vec::newss(2.);
println!("{:?}", debranch(a, b, a.lt(b)));
}
``` | Rust | |
```html
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (clo... | HTML | |
```java
// --------------------------------------------------------------------------------
// Copyright 2002-2021 Echo Three, 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
//
// ... | Java | |
```ruby
C = readlines.map{|l| l.split.map(&:to_i)}
require 'matrix'
a = Array.new(9){Array.new(9, 0)}
b = Array.new(9, 0)
C.flatten.each_with_index do |c, i|
x, y = i.divmod(3)
y += 3
a[i][x] = 1
a[i][y] = 1
b[i] = c
end
m = Matrix[*a]
em = m.hstack(Matrix.column_vector(b))
puts m.rank == em.rank ? 'Yes' : '... | Ruby | |
```xml
<object>
<name>spot</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>1186</xmin>
<ymin>553</ymin>
<xmax>1289</xmax>
<ymax>917</ymax>
</bndbox>
</object>
<object>
<name>spot</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<... | XML | |
```java
/*
* Copyright 2015 herd contributors
*
* 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 agree... | Java | |
```java
/*
* 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")... | Java | |
```javascript
import Component from '@ember/component';
import layout from '../templates/components/mdc-data-table-cell';
import CellMixin from '../mixins/cell';
export default Component.extend (CellMixin, {
layout,
tagName: 'td',
classNames: ['mdc-data-table__cell'],
classNameBindings: ['checkbox:mdc-data-... | JS | |
```cpp
// Copyright 2015 The Emscripten Authors. All rights reserved.
// Emscripten is available under two separate licenses, the MIT license and the
// University of Illinois/NCSA Open Source License. Both these licenses can be
// found in the LICENSE file.
#include <assert.h>
#include <stdio.h>
#include <pthread.h... | C++ | |
```cpp
#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int mod = 1e9 + 7;
int main() {
int n, m; cin >> n >> m;
vector<bool> broken(m, false);
for (int i=0; i<m; ++i) {
int num; cin >> num;
broken[num] = true;
}
vector<long long> dp(n + 10, 0);
dp[0] = 1... | C++ | |
```java
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int[] arrH = new int[N];
for(int i = 0; i < N; i++) {
arrH[i] = sc.nextInt();
}
int... | Java | |
```cpp
#include<iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
if (a < b) cout << a << endl;
else cout << a-1 << endl;
}
``` | C++ | |
```java
import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.HashSet;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
sc.nextLine();
String S = sc.nextLine();
String[] arare = S.split(" ", ... | Java | |
```bash
#!/bin/sh
set -e
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY"
XCASSET_FILES=()
case "${TARGETED_DEVICE_FAMILY}" in
1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
... | Sh | |
```typescript
import React from 'react';
import './flag.scss';
import {FlagType} from "../../model";
interface ItemFlag {
flag: FlagType;
}
export default function Flag({ item, short = false }: { item: ItemFlag; short?: boolean }) {
const ucFirst = (s: string) => s.charAt(0).toUpperCase() + s.slice(1);
if (ite... | TS | |
```c
#include <stdio.h>
int main(void){
int a, b, c;
scanf("%d %d %d", &a, &b, &c);
if(a==b && b==c && c==a %% a%2==0 %% b%2==0 && c%2==0){
printf("-1\n");
return 0;
}
int ans=0;
while(a%2==0 && b%2==0 && c%2==0){
int _a=a, _b=b, _c=c;
a=_b/2+_c/2;
b=_a/2+... | C | |
```scala
import scala.concurrent.Await
import scala.concurrent.duration._
object WsClient extends LazyLogging {
val timeout: FiniteDuration = 60 seconds
implicit val bodyWrites: BodyWritable[JsValue] =
BodyWritable(a => InMemoryBody(ByteString.fromArrayUnsafe(Json.toBytes(a))), "application/json")
private v... | Scala | |
```lisp
(PRIMES::Q*2^S
(7 6 (:REWRITE DEFAULT-<-1))
(6 6 (:REWRITE DEFAULT-<-2))
(6 2 (:REWRITE RTL::ODDP-ODD-PRIME))
(4 4 (:TYPE-PRESCRIPTION RTL::PRIMEP))
(2 2 (:REWRITE EVENP-WHEN-NOT-ACL2-NUMBERP-CHEAP))
(2 2 (:REWRITE DEFAULT-+-2))
(2 2 (:REWRITE DEFAULT-+-1))
(2 2 (:REWRITE DEFAULT-*-2))
(2 2 (:REWRITE D... | Lisp | |
```
#include "UpsampleLayer.h"
namespace nvinfer1
{
__device__ int translate_idx(int ii, int d1, int d2, int d3, int scale_factor) {
int x, y, z, w;
w = ii % d3;
ii = ii/d3;
z = ii % d2;
ii = ii/d2;
y = ii % d1;
ii = ii/d1;
x = ii;
w = w/scale_factor;
z = z/scale_factor;
d... | PlainText | |
```go
/**
* @Author: fanpengfei
* @Description:
* @File: hello_test.go
* @Version: 1.0.0
* @Date: 2020/5/25 13:25
*/
package main
import "testing"
func Test_hello(t *testing.T) {
type args struct {
name string
}
tests := []struct {
name string
args args
}{
// TODO: Add test cases.
{"test1", args... | Go | |
```php
<!-- {{ Session::get('login')['usuario_email']}} -->
<!-- <div>
<?= var_dump(Session::get('login')) ?>
</div> -->
<!-- Componente NAVBAR -->
<x-nav />
<!-- FIN Componente NAVBAR -->
<div class="container mt-5">
<div class="row">
<div class="col-md-12">
</div>
<div class="col-md... | PHP | |
```python
Example::
>>> # model is an instance of torch.nn.Module
>>> import apex
>>> sync_bn_model = apex.parallel.convert_syncbn_model(model)
'''
mod = module
if isinstance(module, torch.nn.modules.batchnorm._BatchNorm):
mod = SyncBatchNorm(module.num_features, module.eps,... | Python | |
```
#include "../../cuda.h"
#include "../../symbols/NaN.cuh"
__inline__ __device__ int findNextPowerOfTwo(int input) {
return (int)powf(2.0, ceilf(log2f((float)input)));
}
__device__ int findMaximum(int thisIndex, float thisValue, int nextPowerOfTwo) {
for (int offset = nextPowerOfTwo / 2; offset > 0; offse... | PlainText | |
```java
package net.minecraft.network.play.client;
import java.io.IOException;
import net.minecraft.network.Packet;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.INetHandlerPlayServer;
public class C0FPacketConfirmTransaction implements Packet<INetHandlerPlayServer>
{
private int wi... | Java | |
```kotlin
fun testInsertFqnForJavaClass() = doTest(2, "SortedSet", "<E> (java.util)", '\n')
fun testTabInsertAtTheFileEnd() = doTest(0, "vvvvv", null, '\t')
fun testTabInsertBeforeBraces() = doTest(0, "vvvvv", null, '\t')
fun testTabInsertBeforeBrackets() = doTest(0, "vvvvv", null, '\t')
fun testTab... | Kotlin | |
```python
N=int(input())
v=list(map(float,input().strip().split()))
v.sort()
ans=v[0]
for n in range(1,N):
ans=(ans+v[n])/2
print(ans)
``` | Python | |
```sql
-- selectB.test
--
-- execsql {
-- SELECT c FROM t1
-- EXCEPT
``` | SQL | |
```csharp
using System;
using System.Net;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.DependencyInjection;
using Stl.Serialization;
namespace Stl.Fusion.Server
{
public class JsonifyErrorsAttribute : ExceptionFilterAttribute
{... | C# | |
```php
<?php
if(isset($_GET['excluir'])){
$idExcluir = (int)$_GET['excluir'];
Panel::deletar('tb_site.servicos', $idExcluir);
Panel::redirect(INCLUDE_PATH_PANEL.'lista-servicos');
}else if(isset($_GET['order']) && isset($_GET['id'])){
Panel::orderItem('tb_site.servicos', $_GET['... | PHP | |
```ruby
class CreateTravels < ActiveRecord::Migration
def change
create_table :travels do |t|
t.string :name
t.string :description
t.string :recommendation
t.integer :distance
t.integer :user_id
end
end
end
``` | Ruby | |
```javascript
function Main(N) {
var M = 0;
for(var i = 1;i<10;i++){
if(Number.isInteger(N / i)){
if((N/i)< 10){
M++;
}
}
}
if(M < 0 && N<=81){
console.log("Yes");
}else{
console.log("No");
}
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
``` | JS | |
```ruby
context "after_authentication" do
it "should be a wrapper to after_set_user behavior" do
RAM.after_authentication{|u,a,o| a.env['warden.spec.hook.baz'] = "run baz"}
RAM.after_authentication{|u,a,o| a.env['warden.spec.hook.paz'] = "run paz"}
RAM.after_authentication{|u,a,o| o[:event... | Ruby | |
```scala
package test.scala.collection
import org.junit.Test
import org.junit.Assert._
import org.junit.Ignore
import scala.collection.compat.immutable.LazyList
import scala.collection.compat._
import scala.collection.mutable.{Builder, ListBuffer}
import scala.util.Try
class LazyListTest {
@Test
def t6727_and_t... | Scala | |
```html
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>Test Runner</title>
<meta charset="UTF-8">
<script src="../../webcomponentsjs/webcomponents.min.js"></script>
<link rel="import" href="tests.htm... | HTML | |
```xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2013 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/... | XML | |
```scala
"< Back"
)
)
)
.build
}
``` | Scala | |
```
.section {
margin-bottom: 2rem;
margin-top: 2rem;
position: relative;
}
@media (min-width: 768px) {
.section {
margin-bottom: 3rem;
margin-top: 3rem;
}
}
@media (min-width: 1280px) {
.section {
margin-bottom: 5rem;
margin-top: 5rem;
}
}
``` | PlainText | |
```sql
-- boundary3.test
--
-- db eval {
-- SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r
-- WHERE t2.a=66
-- ORDER BY t1.rowid
-- }
SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r
WHERE t2.a=66
ORDER BY t1.rowid
``` | SQL | |
```java
/*****************************************************************************
* Copyright (c) PicoContainer Organization. All rights reserved. *
* ------------------------------------------------------------------------- *
* The software in this package is published under the terms of the BSD ... | Java | |
```c
/**************************************************************************/
/* */
/* Copyright (c) 1996-2014 by Express Logic Inc. */
/* */
/* ... | C | |
```scala
/**
* Copyright 2018 eShares, Inc. dba Carta, Inc.
* 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
* https://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable l... | Scala | |
```rust
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LI... | Rust | |
```
var
i,x,s,min:longint;
begin
min:=233;
s:=0;
for i:=1 to 5 do
begin
read(x);
if (x-1) mod 10+1<min then
min:=(x-1) mod 10+1;
inc(s,x+9-(x-1) mod 10);
end;
writeln(s-10+min);
end.
``` | PlainText | |
```python
S = input()
c = 0
if S == "RRS" or S == "SRR":
print("2")
elif S == "RRR":
print("3")
elif S == "RSR" or S == "RSS" or S == "SSR":
print("1")
else:
print("0")
``` | Python | |
```scala
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package org.scalajs.testsuite.scalali... | Scala | |
```python
import time
import os
import subprocess
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common import utils
chrome_options = Options()
chrome_options.add_argument("nwapp=" + os.path.dirname(os.path.abspath(__file__)))
testdir = os.path.dirname(os... | Python | |
```typescript
import IconTop from './arrowTop.svg';
import { styled } from '@mui/material/styles';
import Button from '@mui/material/Button';
interface ButtonDetailsProps {
name: string;
onClick: React.MouseEventHandler<HTMLButtonElement>;
isButtonUp: boolean;
}
const ButtonDetails = ({
onClick,
name,
isB... | TS | |
```python
N = int(input())
dt, dx, dy = 0, 0, 0
avilable = True
for i in range(N):
t, x, y = map(int, input().split())
if abs(x-dx)+abs(y-dy) > t-dt or (abs(x-dx)+abs(y-dy)) % 2 != (t-dt) % 2:
avilable = False
if avilable:
print('Yes')
else:
print('No')
``` | Python | |
```python
N, K = map(int, input().split())
A = list(map(int, input().split()))
cnt = [0]*N
town = 1
for i in range(K):
if cnt[town-1] ==1:
break
cnt[town-1] += 1
town = A[town-1]
ans1 = sum(cnt)
import copy
town2 = copy.deepcopy(town)
cnt2 = [0]*N
for i in range(K):
if cnt2[town2-1] ==1:
... | Python | |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
https... | XML | |
```python
def solve(H, A_B):
max_a = 0
for a_b in A_B:
if a_b[0] > max_a:
max_a = a_b[0]
A_B.sort(key=lambda o: o[1], reverse=True)
total_dmg = 0
nage_count = 0
for a_b in filter(lambda o: o[1] > max_a, A_B):
total_dmg += a_b[1]
nage_count+= 1
if tota... | Python | |
```php
return [
'(3rd party defined)' => '',
'(Session)' => '',
'(Twitter)' => '',
'A token used for the auto login feature' => '',
'A token used to avoid CSRF vulnerability' => '',
'Cookie ID (Name)' => '',
'Cookies' => '',
'descriptions' => '',
'Expires' => '',
'I agree' => '',... | PHP | |
```python
import os
import subprocess as sp
MAJOR = 0
MINOR = 1
MICRO = 0
ISRELEASED = False
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
# Return the git revision as a string
# taken from numpy/numpy
def git_version():
def _minimal_ext_cmd(cmd):
# construct minimal environment
env = {}
fo... | Python | |
```python
L = []
i = 0
while True:
x, y = list(map(int, input().split(' ')))
if x == 0 and y == 0:
break
if x < y:
L.append([x, y])
else:
L.append([y, x])
for n in L:
print(*n)
``` | Python | |
```php
@extends('layouts/backend/backend')
@section('title', $title)
@section('content')
<!--breadcrumbs start-->
<div id="breadcrumbs-wrapper">
<!-- Search for small screen -->
<div class="header-search-wrapper grey hide-on-large-only">
<i class="mdi-action-search active"></i>
<input type="text" name="Search" ... | PHP | |
```csharp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace test
{
class Program
{
static void Main(string[] args)
{
string s = Console.ReadLine();
string[] sArray = s.Split(' ');
List<int> list = new List<int>();... | C# | |
```ruby
#
# Cookbook Name:: ruby-bundle-el-captain-fixes
# Recipe:: eventmachine
#
# Copyright 2015, Marcin Nowicki
#
# 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, incl... | Ruby | |
```
/* Copyright (c) 2014-present, 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.
*/
#import "A... | PlainText | |
```java
* Copyright 2012-2022 the original author or authors.
*/
package org.assertj.core.api.booleanarray;
import static org.assertj.core.api.Assertions.catchThrowable;
import static org.assertj.core.api.BDDAssertions.then;
import static org.assertj.core.error.ShouldNotBeNull.shouldNotBeNull;
import static org.asser... | Java | |
```sql
---------------------------------------------
---------------- PROCEDURES -----------------
---------------------------------------------
---------- #Problem: "Hanoi Towers" ---------
CREATE PROCEDURE dbo.ShowTowers
AS
BEGIN
WITH SevenNumbers(Num) AS
(
SELECT 1
UNION ALL
SELECT Num + 1
FROM SevenNumber... | SQL | |
```c
/*
**
** File: fm2612.c -- software implementation of Yamaha YM2612 FM sound generator
** Split from fm.c to keep 2612 fixes from infecting other OPN chips
**
** Copyright Jarek Burczynski (bujar at mame dot net)
** Copyright Tatsuyuki Satoh , MultiArcadeMachineEmulator development
**
** Version 1.5 (Genesis Plus ... | C | |
```cpp
#include <algorithm>
#include <stdexcept>
#include <iostream>
class division_by_zero: public std::exception {};
class wrong_operation: public std::exception {};
template <typename T>
class Calculator
{
private:
std::string results;
int number = 0;
T get_next();
T get_value()
{
T... | C++ | |
```rust
#[doc = "Reader of register CS33"]
pub type R = crate::R<u32, super::CS33>;
#[doc = "Writer for register CS33"]
pub type W = crate::W<u32, super::CS33>;
#[doc = "Register CS33 `reset()`'s with value 0"]
impl crate::ResetValue for super::CS33 {
type Type = u32;
#[inline(always)]
fn reset_value() -> S... | Rust | |
```sql
--------------------------------------------------------------------------------
-- --
-- This procedure will move possible values to solved values when there is --
-- only one possible location for a value in this block. ... | SQL | |
```ruby
n,q=gets.split.map &:to_i
s=gets.chomp.chars.each_cons(2).map{|x| x=1 if (x==["A","C"])}
x=[]
y=[]
ans=[]
q.times do |i|
x[i],y[i]=gets.split.map &:to_i
ans[i]=s.slice(x[i]-1..y[i]-2).sum
end
q.times do |j|
puts ans[i]
end
``` | Ruby | |
```php
<!-- Fixed size after header-->
<div class="content">
<!-- Always on top. Fixed position, fixed width, relative to content width-->
<div class="navigation-left">
<div class="navigation-header1"><a href="../../index.php">Home</a></div>
<br>
<?php echo ... | PHP | |
```cpp
#ifndef UTILITY_HPP_
# define UTILITY_HPP_
template <typename Aspect>
struct AspectIsLast
{
typedef char yes[1];
typedef char no[2];
template <typename C>
static yes& test(typename C::Super *);
template <typename>
static no& test(...);
static const bool result = sizeof(test<Aspect>(0)) == sizeo... | C++ | |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.demeter.cloud.model.mapper.EnrollInfoMapper">
<resultMap id="BaseResultMap" type="com.demeter.cloud.model.entity.EnrollInfo">
<id column=... | XML | |
```php
<?php
namespace App\Http\Controllers;
use App\Http\Requests\ImpersonationRequest;
use App\Models\User;
class ImpersonationController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('admin... | PHP | |
```java
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should hav... | Java | |
```cpp
#include <bits/stdc++.h>
using namespace std;
typedef long long int LL;
typedef unsigned long long int ULL;
typedef pair<int, int> PII;
typedef map<int, int> MII;
const int SZ = 112345;
const int MOD = 1e9 + 7;
int h, n, a[SZ];
int main() {
cin >> h >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
... | C++ | |
```go
// Copyright © 2018 Jeff Coffler <jeff@taltos.com>
//
// 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 applic... | Go | |
```python
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
n,m,L=map(int,input().split())
A=[[INF]*n for _ in range(n)]
for _ in range(m):
a,b,c=map(int,input().split())
if(c>L): continue
a-=1; b-=1
... | Python | |
```go
package main
import (
"os"
"github.com/boltdb/bolt"
)
// Set sets the value for a given key in a bucket.
func Set(path, name, key, value string) {
if _, err := os.Stat(path); os.IsNotExist(err) {
fatal(err)
return
}
db, err := bolt.Open(path, 0600)
if err != nil {
fatal(err)
return
}
defer db.... | Go | |
```python
# -*- coding: utf-8 -*-
# Author: TDC Team
# License: MIT
import warnings
warnings.filterwarnings("ignore")
import sys
from ..utils import print_sys
from . import bi_pred_dataset, multi_pred_dataset
from ..metadata import dataset_names
class DTI(bi_pred_dataset.DataLoader):
"""Data loader class to loa... | Python | |
```
.gdfvaddheader {font-weight: bold; padding: 5px;}
.gdfvaddtable {border: 1px #CCCCCC solid; padding: 7px; margin: 5px; width: 100%;}
.gdfvaddleft {padding: 3px;}
.gdfvaddright {padding: 3px;}
.gdfavaddlink {margin-top: 20px; font-size: 10px;}
.gdfavaddlink A {text-decoration: none;}
.gdfavlink {margin: 5px; width:... | PlainText | |
```rust
use std::collections::HashMap;
use std::cell::RefCell;
use std::default::Default;
use std::collections::BTreeMap;
use serde_json as json;
use std::io;
use std::fs;
use std::mem;
use std::thread::sleep;
use crate::client;
// ##############
// UTILITIES ###
// ############
/// Identifies the an OAuth2 authoriz... | Rust | |
```python
N = int(input())
SP = [input().split() for i in range(N)]
SP = [[sp[0], int(sp[1]), i+1]for i, sp in enumerate(SP)]
SP = sorted(SP, reverse=True, key=lambda x: x[1])
SP = sorted(SP, key=lambda x: x[0])
for s, p, i in SP:
print(i)
``` | Python | |
```go
// Copyright (c) 2017 Uber Technologies, Inc.
//
// 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, modify,... | Go | |
```cpp
cin >> arr[i];
if(arr[i]%2){
odd++;
if(odd_i_1<0) odd_i_1 = i+1;
else odd_i_2 = i+1;
}
else{
even++;
even_i = i+1;
}
}
if(even || odd>1){
if(even){
cout << 1 << endl;
cout << even_i << endl;
}
else{
cout << 2 << endl;
cout << odd_i_1 << " " << odd_i_2 ... | C++ | |
```go
return true, nil
}
}
if resp.NextPage == 0 {
break
}
nextPage = resp.NextPage
}
return false, nil
}
// PullIsMergeable returns true if the pull request is mergeable.
func (g *GithubClient) PullIsMergeable(repo models.Repo, pull models.PullRequest) (bool, error) {
githubPR, err := g.GetPullReques... | Go | |
```java
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.android_webview;
import android.net.ParseException;
import android.util.Log;
import org.chromium.base.JNINamespace;
imp... | Java | |
```python
k=int(input())
s=str(input())
if k<len(s):
print(s[0:k]+"...")
else:
print(s)
``` | Python | |
```sql
CREATE TABLE #Codesets (
codeset_id int NOT NULL,
concept_id bigint NOT NULL
)
;
INSERT INTO #Codesets (codeset_id, concept_id)
SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (45571465,35207716,... | SQL | |
```sql
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE... | SQL | |
```
jobs (incl. supersource/sink ): 102
RESOURCES
- renewable : 4 R
- nonrenewable : 2 N
- doubly constrained : 0 D
************************************************************************
PRECEDENCE RELATIONS:
jobnr. #modes #successors successors
1 1 10 2 3 4 5 6 7 9 10 12 1... | PlainText | |
```html
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">xsysmon.c File Reference</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 c... | HTML | |
```yaml
name: Bounty
api: [3.0.0]
main: Infernus101\Main
version: 2.0.1
author: Infernus101
description: Bounty plugin
commands:
bounty:
description: "Bounty help"
``` | YAML | |
```python
n=int(input())
k=2
a=list(map(int, input().split()))
if n<3:
print(abs(a[0]-a[-1]))
exit()
c=[0]*n
c[-1]=0
mini=1000000
for i in reversed(range(n-k, n-1)):
# print(i)
c[i]=abs(a[i]-a[n-1])
mini=min(mini, c[i])
for i in reversed(range(n-k)):
c[i]=min([c[t]+abs(a[i]-a[t]) for t in ... | Python | |
```cpp
#include <bits/stdc++.h>
using namespace std;
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
typedef long long LL;
int main(){
int n,m;
while(1){
cin >> n >> m;
if(n==0) return 0;
vector<int> a(n);
for(int i=0;i<n;i++){
cin >> a[i];
}
int ans=0;
for... | C++ | |
```python
# gather input pixel values from nn corner indexes
idx_nn = ibatch + ix_nn + num_row_major[0] * iy_nn + num_row_major[1] * iz_nn
output = tf.gather(tf.reshape(im, [-1, channels]), idx_nn)
if padding_mode == "zero":
output = output * valid
elif padding_mode == "value":
... | Python | |
```
// ###
// ###
// ### Practical Course: GPU Programming in Computer Vision
// ###
// ###
// ### Technical University Munich, Computer Vision Group
// ### Winter Semester 2013/2014, March 3 - April 4
// ###
// ###
// ### Evgeny Strekalovskiy, Maria Klodt, Jan Stuehmer, Mohamed Souiai
// ###
// ###
// ###
... | PlainText |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 59