language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 2,165 | 2.015625 | 2 | [] | no_license | package com.example.trang.note.activity;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerVie... |
Python | UTF-8 | 2,314 | 2.640625 | 3 | [] | no_license | import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.optim as optim
import numpy as np
import torch.nn.functional as F
class WordEmb(nn.Module):
def __init__(self,
voc_size,
emb_size,
hidden_size,
device,
... |
PHP | UTF-8 | 10,334 | 2.65625 | 3 | [] | no_license | <?php
//nombre de la sesion, inicio de la sesión y conexion con la base de datos
include ("sis/nombre_sesion.php");
//verifico si la sesión está creada y si no lo está lo envio al logueo
if (!isset($_SESSION['correo']))
{
header("location:logueo.php");
}
?>
<?php
//variables de la sesion
include ("sis/variables_s... |
Markdown | UTF-8 | 4,629 | 2.859375 | 3 | [] | no_license | # 2313 软件工程实习
```cpp
//freopen("D:\\input.txt","r",stdin);
//ios::sync_with_stdio(false);
#include<bits/stdc++.h>
using namespace std;
#define MAXN 1005
#define MAXK 30
struct Stu{
int grade,finalGrade;
char group;
};
Stu stus[MAXN];
int groupGrades[MAXK][MAXK];
int groupFinalGrades[MAXK];
int n,k;
bool cmp(const S... |
JavaScript | UTF-8 | 890 | 3.890625 | 4 | [] | no_license | //Object Destructuring
const person = {
name: 'Hari',
age: 23,
location: {
city: 'Atlanta',
temp: 55
}
};
const {name: firstName = 'Anonymous', age} = person;
console.log(`${firstName} is ${age}.`);
const {temp: temperature, city: cityName} = person.location;
console.log(`It's ${temp... |
Ruby | UTF-8 | 2,119 | 3.734375 | 4 | [] | no_license | require 'mathn.rb'
#сплайны
#сама функция f(x)
def f(x)
x**2 - Math::log10(x + 2)
end
#производная f(x)
def df(x)
2*x - 1/(x + 2)/Math::log(10)
end
$a = 0.5
$b = 1.0
x1 = 0.53
x2 = 0.52
x3 = 0.97
x4 = 0.73
$h = ($b - $a)/10
#Табличные значения
$xi = Array.new(11){|i| $a + $h * i}
$fi = Array.new(11){|i| f($xi[i])... |
PHP | UTF-8 | 296 | 2.703125 | 3 | [] | no_license | <?php
namespace testonaut\Selenese\Command;
use testonaut\Selenese\Command;
// title()
class Title extends Command {
public function runWebDriver(\WebDriver $session) {
$title = $session->getTitle();
return $this->commandResult(true, true, 'Got page title: "' . $title . '"');
}
}
|
Java | UTF-8 | 584 | 2.109375 | 2 | [] | no_license | package com.shop.biz;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "productList")
@XmlAccessorType(XmlAccessType.FIELD)
pub... |
TypeScript | UTF-8 | 502 | 2.59375 | 3 | [
"MIT"
] | permissive | import {
IsAlphanumeric,
IsAscii,
IsNotEmpty,
IsOptional,
IsString,
MaxLength,
MinLength,
} from 'class-validator';
import { IsObjectID } from 'util/CustomClassValidators';
export default class CreatePostsDto {
@IsString()
@IsAscii()
@MinLength(5)
@MaxLength(100)
title: ... |
C++ | UTF-8 | 1,123 | 3.03125 | 3 | [] | no_license | /*
this functions show why cloning is the rigth way to modify the value/vector withoiut changeing
the original value/vector DO NOT COPY , COLNE IT*/
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
List change_negatives_to_zero(NumericVector the_original) {
// Set the copy to the original
NumericV... |
PHP | UTF-8 | 795 | 2.59375 | 3 | [] | no_license | <?php
chdir(__DIR__);
include_once("baseModel.php");
class EditorModel extends BaseModel
{
protected $tableName = "documents";
protected $primary = 'DocumentID';
protected $fillable = [
'DocumentName', 'Alias', 'Tags', 'Text', 'UserID', 'LastUpdate'
];
protected $fieldMap = [
'd... |
Python | UTF-8 | 719 | 4.125 | 4 | [
"MIT"
] | permissive | from time import sleep
def contador(i, f, p):
if p == 0:
if i > f:
p = -1
else:
p = 1
print(f'{"-=" * 25} \nContagem de {i} a {f} de {p} em {p}:')
for c in range(i, f, p):
print(f'{c} ', end='')
sleep(1)
print()
return 'Fim'
print(f'{"-=" *... |
Python | UTF-8 | 8,924 | 2.78125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
# SPDX-FileCopyrightText: Christian Amsüss and the aiocoap contributors
#
# SPDX-License-Identifier: MIT
"""This script does not do anything really CoAP-related, but is a testing tool
for multicast messages.
It binds to multicast addresses of different scopes (ff02::1:2, ff05::1:5) on different... |
Python | UTF-8 | 869 | 2.640625 | 3 | [] | no_license | import pandas as pd
import os
import glob
from settings.general import TAGS
def glue_by_tags(data_path='data/', tags=[]):
df = pd.DataFrame(
columns=['text', 'hashtags', 'datetime', 'likes', 'owner',
'owner_followers',
'owner_number_posts'])
if len(tags) > 0:
... |
C# | UTF-8 | 2,136 | 3.203125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace ConsoleApp
{
public class Test_05
{
//https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators
... |
Java | UTF-8 | 2,467 | 2.0625 | 2 | [
"MIT"
] | permissive | package com.reactnativenavigation.viewcontrollers.common;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.TimeInterpolator;
import android.content.Context;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.v... |
Python | UTF-8 | 1,302 | 3.703125 | 4 | [] | no_license | class Automovel:
def __init__(self, cap_dep, quant_comb, consumo):
self.capacidade = cap_dep
self.quantidade = quant_comb
self.consumo = consumo
def devolve_combustivel(self):
return f'Quantidade de combustível: {self.quantidade}'
def devolve_automonia(self):
re... |
Java | UTF-8 | 540 | 2.9375 | 3 | [] | no_license | package xtraprograms;
import java.util.Scanner;
public class P20 {
public static void main(String[] args) {
int n,t=1;
Scanner read=new Scanner(System.in);
System.out.println("Enter any no");
n=read.nextInt();
for(int i=1;i<=n;i++)
{
for(int a=1;a<=n-i;a++)
{
System.out.print(" ");
}
... |
C++ | UTF-8 | 370 | 2.703125 | 3 | [] | no_license | #ifndef ARTICLE_H
#define ARTICLE_H
#include <string>
using namespace std;
class Article{
public:
Article(string title = "", string author = "", string text = "", int id = -1);
string getText();
string getTitle();
string getAuthor();
int getID();
private:
string title;
strin... |
C++ | UTF-8 | 594 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main()
{
string s;
cout << "vvedite stroky";
getline(cin, s);
int d = s.size();
int pov = 1;
int l = d;
int o = 0;
int mass[d];
for (int i = 0; i < d - 1; i++){
for (int k = i + 1; k <= d; k++){
if (s[i] == s[k])... |
PHP | UTF-8 | 591 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
namespace Test\Assignment02\Solution3;
use Assignment02\Solution3\AccessLevel;
class AccessLevelTest extends \PHPUnit_Framework_TestCase
{
/**
* @test
*/
public function it_can_be_a_high_access_level()
{
$level = AccessLevel::high();
$this->assertTrue($level->isHigh());
... |
Markdown | UTF-8 | 577 | 3.046875 | 3 | [
"MIT"
] | permissive | ---
title: "Regular Expressions: Find One or More Criminals in a Hunt"
certificate: "Javascript Algorithms and Data Structures"
order: 0
---
Certificate: *Javascript Algorithms and Data Structures*
#### { Instructions }
Write a greedy regex that finds one or more criminals within a group of other people. A criminal is... |
C# | UTF-8 | 390 | 2.609375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
namespace FP_Exercise
{
public class BigRig : IVehicle
{
public BigRig()
{
}
public void Drive()
{
Console.WriteLine("The BigRig is now moving along to make your delivery on time.");
... |
Java | UTF-8 | 11,788 | 1.820313 | 2 | [] | no_license | package com.herenit.mobilenurse.mvp.orders;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;... |
C# | UTF-8 | 1,482 | 2.65625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Login.AllUserControl
{
public partial class UC_Remove : UserControl
{
function fn = new function();
String query;
... |
Java | UTF-8 | 3,095 | 2.390625 | 2 | [] | no_license | package com.example.mrwing.chess;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class Nam... |
Markdown | UTF-8 | 10,762 | 3.171875 | 3 | [] | no_license | component : 일반적인 자바스크립트 파일
virtual dom : 내용이 변경되면 돔을 싹 다 바꾸는 것이 아니라 변경된 돔만 바꿈
- 설치
node.js 설치 후
원하는 경로에 가서
npx create-react-app my-app
### jsx 작성 규칙
- 하나의 root element를 가짐
- 모든 element는 closer 필요
- 각 태그는 두번 사용 할 수 없지만 태그 안에 태그를 넣을 순 있다.
- App.js
```js
import React, {Component} from 'react';
i... |
Java | UTF-8 | 432 | 2.71875 | 3 | [] | no_license | import java.util.ArrayList;
public class Test {
public static void main(String[] args) {
Sculpture sul = new Sculpture();
Circular c = new Circular(1,1 );
Square s = new Square(0, 1);
ArrayList<Shape> sss = new ArrayList<>();
sss.add(c);
sss.add(s);
sul.stor... |
Go | UTF-8 | 1,574 | 2.875 | 3 | [
"Apache-2.0"
] | permissive | package harness
import (
"fmt"
"reflect"
"github.com/kylelemons/godebug/pretty"
promdata "github.com/prometheus/client_model/go"
)
// FindPromMetric is a helper to take the metrics scraped from oplogtoredis, and get a particular
// metric partition
func FindPromMetric(metrics map[string]*promdata.MetricFamily, ... |
Python | UTF-8 | 6,909 | 2.5625 | 3 | [
"MIT"
] | permissive | from __future__ import division
import abc
import sys
import matplotlib.pyplot as plt
import scipy.optimize as opt
from matplotlib import patches
import numpy as np
import numpy.random as rand
import numpy.linalg as linalg
def pretty_fig(n):
plt.figure(n, figsize=(8, 8))
plt.rc('text', usetex=True)
plt.r... |
PHP | UTF-8 | 1,054 | 2.53125 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
use yii\db\Migration;
/**
* Handles the creation of table `units`.
*/
class m171009_032042_create_subdivision_table extends Migration
{
/**
* @inheritdoc
*/
public function up()
{
$this->createTable('subdivision', [
'id' => $this->primaryKey(),
'name' => $... |
Markdown | UTF-8 | 1,337 | 2.75 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: pointer_default attribute
description: The \ pointer\_default\ attribute specifies the default pointer attribute for all pointers except top-level pointers that appear in parameter lists.
ms.assetid: a6e83034-8adb-483d-8d1e-432a1aed22c6
keywords:
- pointer_default attribute MIDL
topic_type:
- apiref
api_name... |
Markdown | UTF-8 | 2,181 | 2.875 | 3 | [
"Apache-2.0"
] | permissive | ### Docker in Higher Education
For quite some time now we have been receiving daily requests from students all over the world, asking for our help learning Docker, using Docker and teaching their peers how to use Docker. We love their enthusiasm, so we decided it was time to reach out to the student community and give... |
Markdown | UTF-8 | 5,720 | 3.078125 | 3 | [] | no_license | ---
title: "Activity Monitoring"
author: "Rolando Mendoza"
date: "October 18, 2015"
output: html_document
---
The purpose of this document is to analyze the data collected from a personal activity
monitoring device such as Fitbit, Nike Fuelband, etc. The data came from an anonymous
individual and it collected the numb... |
Java | UTF-8 | 282 | 2.921875 | 3 | [] | no_license | package geometry;
public class Vector{
public final double dx,dy;
public Vector(double dx, double dy){
this.dx = dx;
this.dy = dy;
}
public static Vector composing(Vector v1, Vector v2){
return new Vector(v1.dx+v2.dx, v1.dy+v2.dy);
}
} |
Markdown | UTF-8 | 5,928 | 2.640625 | 3 | [] | no_license | # SpringSecurity注销登录
当启用WebSecurityConfigurerAdapter的时候,logout支持会自动启用
logoutUrl() 访问那个地址会触发登出逻辑。**默认情况下CROS是开启的,另外必须是POST方法**
logoutSuccessUrl() 当登出成功之后,会被重定向到的地址
logoutSuccessHandler()指定登出成功后的处理,如果指定了这个,那么`logoutSuccessUrl`就不会生效。
addLogoutHandler 添加登出时的Handler,在访问logout地址时会执行,内部是一个立碑,`SecurityContextLogoutHand... |
Python | UTF-8 | 762 | 3.40625 | 3 | [] | no_license | class Tree:
def __init__(self):
pass
def BinaryTree(self,r):
return [r,[],[]]
def insertLeft(self,root,newBranch):
t = root.pop(1)
if len(t) > 1:
root.insert(1,[newBranch,t,[]])
else:
root.insert(1,[newBranch,[],[]])
return root
... |
C++ | UTF-8 | 482 | 3.296875 | 3 | [] | no_license | //tsimple example of how to use std::array<T,N>
//
//
#include<array>
#include<iostream>
int main() {
std::array<int,10> arr, other_arr;
arr.fill(5);
arr[3]=3;
for(auto& el:arr) std::cout << el << ' ';
std::cout << '\n';
for(auto& el:other_arr) std::cout << el << ' ';
std::cout << '\n... |
Java | UTF-8 | 13,035 | 1.96875 | 2 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Interfaz;
import base_de_datos.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOExcepti... |
C# | UTF-8 | 1,457 | 2.65625 | 3 | [
"MIT"
] | permissive | using System;
using Microsoft.Extensions.CommandLineUtils;
using Microsoft.Extensions.Logging;
namespace Company.ConsoleApplication1
{
public class Application
{
private readonly IRootCommand[] _rootCommands;
private readonly ILogger _logger;
public Application(IRootCommand[... |
C++ | UTF-8 | 298 | 2.859375 | 3 | [] | no_license | //
// Created by sumesh on 1/8/2016.
//
#include <iostream>
using namespace std;
struct s{
int a;
char c;
int b;
};
int main(){
cout<< sizeof(s)<<endl;
static_assert(sizeof(s) == sizeof(int)+ sizeof(char) + sizeof(int), "unexpected paddding in struct s");
}
|
Python | UTF-8 | 1,697 | 2.546875 | 3 | [] | no_license | import numpy as np
import torch
import torch.nn.functional as F
from torch.autograd import Variable
# from geotnf.point_tnf import normalize_axis, unnormalize_axis
def read_flo_file(filename, verbose=False):
"""
Read from .flo optical flow file (Middlebury format)
:param flow_file: name of the flow file
... |
Java | UTF-8 | 4,427 | 2.078125 | 2 | [] | no_license | package com.example.testmoodle.util;
import java.util.ArrayList;
import org.json.JSONException;
import org.json.JSONObject;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;
public class Course implements Parcelable {
private int id;
private String shortName;
private String fulltNa... |
Markdown | UTF-8 | 5,727 | 2.921875 | 3 | [] | no_license | ### Set up:
1. Insert some mock data into database.
2. Log in as 'user3' with password '123'.
3. Click 'Resource Status' on the Main Menu.
### Test for Resource in use:
* Run the following query against the database and confirm the output match the displayed information in the form. The `deploy_schedule_id` will be us... |
C# | UTF-8 | 14,508 | 2.984375 | 3 | [
"MIT"
] | permissive | using BrowserInterop.Extensions;
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Threading.Tasks;
namespace BrowserInterop
{
/// <summary>
/// Give access to window.console API https://developer.mozilla.... |
Java | UTF-8 | 3,400 | 2 | 2 | [
"Apache-2.0"
] | permissive | /*
* TopStack (c) Copyright 2012-2013 Transcend Computing, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... |
Python | UTF-8 | 5,017 | 2.625 | 3 | [] | no_license | """Original code: https://www.kaggle.com/sergemsu/kalman-faces
"""
import pathlib
import math
import os
import logging
import itertools
from multiprocessing import Pool
import configargparse
import pandas as pd
import numpy as np
from tqdm import tqdm
from scipy import interpolate
from matplotlib import pyplot as plt
... |
Java | UTF-8 | 1,151 | 2.328125 | 2 | [] | no_license | package io.chuumong.booksearch.ui.adapter;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import javax.inject.Inject;
import io.chuumong.booksearch.ui.fragment.FragmentHolder;
import io.chuumong.booksearch.ui.fragment.SearchF... |
Java | UTF-8 | 1,153 | 2.328125 | 2 | [] | no_license | package com.kolibree.sdkws.data.model;
import androidx.annotation.Keep;
import com.google.gson.JsonObject;
/** Created by mdaniel on 11/11/2015. */
@Keep
public final class BrushPass {
private static final String FIELD_PASSE_DATETIME = "pass_datetime";
private static final String FIELD_PASSE_EFFECTIVE_TIME = "ef... |
JavaScript | UTF-8 | 334 | 2.515625 | 3 | [] | no_license |
let loggerObj = { };
const logHandler = {
get: function(obj, prop) {
return prop in loggerObj ? loggerObj[prop] : () => {};
}
}
let loggerProxy = new Proxy(loggerObj, logHandler);
export function setLogger(logger) {
loggerObj = logger;
}
export function getLogger() {
return l... |
Java | UTF-8 | 8,894 | 2.21875 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | package org.broadinstitute.hellbender.tools.walkers;
import htsjdk.variant.variantcontext.*;
import org.broadinstitute.hellbender.GATKBaseTest;
import org.broadinstitute.hellbender.testutils.VariantContextTestUtils;
import org.broadinstitute.hellbender.utils.variant.GATKVCFConstants;
import org.broadinstitute.hellbend... |
C# | UTF-8 | 842 | 2.609375 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PowerUp : MonoBehaviour{
protected Player player;
[SerializeField] protected float despawnTimer;
[SerializeField] protected bool willDespawnAfterTimer;
public PowerUp() {
willDespawnAfterTimer = false;... |
TypeScript | UTF-8 | 2,715 | 2.78125 | 3 | [] | no_license | import * as PIXI from 'pixi.js';
import { GameConfig } from '../models/game-config';
import { IsometricStack } from '../models/isometric-stack';
import { Tile } from '../models/tile';
import { isoToIndex } from '../utils/iso-to-index';
export interface CoordsUpdate {
cartesianIndicatorText: string;
tileIndicatorTe... |
Java | UTF-8 | 2,478 | 2.3125 | 2 | [] | no_license | package org.khandora.mit.controller;
import lombok.RequiredArgsConstructor;
import org.khandora.mit.dto.TaskDto;
import org.khandora.mit.model.Task;
import org.khandora.mit.model.User;
import org.khandora.mit.repository.TaskRepository;
import org.khandora.mit.repository.UserRepository;
import org.modelmapper.ModelMapp... |
C++ | UTF-8 | 5,429 | 3.09375 | 3 | [] | no_license | #include "postfix.h"
#include "stack.h"
string TPostfix::ToPostfix()
{
TStack<char> STACK(MaxStackSize); //создаем стэк
int L = infix.length(); //размер инф
string OPERATIONS = "+-*/()"; //используемые операции
for (int i = 0; i < L; i++) //проходимся по infix
{
for (int k = 0; k < 6; k++) // есл... |
Java | UTF-8 | 2,766 | 2.4375 | 2 | [] | no_license | package com.example.hw_1;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.GridLayoutManager;
impor... |
C++ | UTF-8 | 2,367 | 3.3125 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <tuple>
#include <vector>
#include <cmath>
#include <string>
#include <iomanip>
using namespace std;
/*
основная идея:
если у нас есть две точки a, b, причем a <= b, и:
a) искомое число x находится ближе к a, то можно утвержать, что x принадлежит (-∞, (b - a... |
Java | UTF-8 | 4,422 | 3.25 | 3 | [] | no_license | package com.ww.JavaSerializable03;
import java.io.Serializable;
/**
* @author: Sun
* @create: 2019-11-07 18:35
* @version: v1.0
*/
public class JavaSerializable03 implements Serializable {
/**
*《手册》第9页“OOP规约”部分有一段关于序列化的约定
*【强制】当序列化类新增属性时,请不要修改serialVersionUID字段,以避免反序列失败;如果完全不兼容升级,
* 避免反序列化混乱,那... |
Swift | UTF-8 | 7,221 | 3.03125 | 3 | [] | no_license | //
// ComplicationController.swift
// TendApp WatchKit Extension
//
// Created by Mateus Augusto M Ferreira on 16/06/20.
// Copyright © 2020 Mateus Augusto M Ferreira. All rights reserved.
//
import ClockKit
/// Classe ComplicationController.
class ComplicationController: NSObject, CLKComplicationDataSource {
... |
Java | UTF-8 | 795 | 2.25 | 2 | [] | no_license | package bzh.terrevirtuelle.navisu.api.option;
/**
* NaVisu
*
* @author tibus
* @param <V>
* @param <T>
* @date 15/02/2014 17:22
*/
public abstract class OptionsPanelCtrl<V extends OptionsPanel, T> {
protected ModelChangedEvents<T> modelChangedListener;
public abstract void load(V view, T model);
... |
PHP | UTF-8 | 813 | 2.515625 | 3 | [] | no_license | <?php
/*
Plugin Name: Ordain ᚨ
Description: 検索結果を日付降順に変更する簡易なプラグイン。
Version: 0.0.1
Author: アルム=バンド
*/
/**
* ordainAnsuz (ᚨ) : 検索結果を日付降順に変更する
*/
class ordainAnsuz
{
/**
* __construct : コンストラクタ
*
*/
public function __construct() {
add_filter(
'posts_search_orderby',
... |
Markdown | UTF-8 | 4,375 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | # Watson Hands On Labs - 📷 Image Analysis
The labs cover several [Watson Services][wdc_services] that are available on [IBM Bluemix][bluemix] to build a simple image analysis application. Throughout the workshop, we will navigate through Bluemix, Bluemix Devops Services, Github, and the source code of our applicati... |
Java | UTF-8 | 15,559 | 1.5625 | 2 | [] | no_license | /*******************************************************************************
* Copyright (c) 2012 Curtis Larson (QuackWare).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is av... |
JavaScript | UTF-8 | 12,166 | 2.546875 | 3 | [] | no_license | import React, { Component } from 'react';
import Board from '../board/board.js';
import Chat from '../chat/chat.js';
import { easyBot, mediumBot, hardBot } from '../../bots/bots.js';
import { checkWin } from '../../utils/gameLogic.js';
import './game.css';
import SocketContext from '../socket-context.js'
import Dropdow... |
Java | UTF-8 | 843 | 1.625 | 2 | [] | no_license | package com.google.android.gms.internal.ads;
import android.text.TextUtils;
import androidx.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
@ParametersAreNonnullByDefault
/* compiled from: com.google.android.gms:play-services-ads@@19.5.0 */
public final class zzabk {
public static void... |
TypeScript | UTF-8 | 265 | 3.28125 | 3 | [] | no_license | export class Person {
public name: string;
public age: number | null;
public comment: string;
constructor(name: string, age: number | null, comment: string) {
this.name = name;
this.age = age;
this.comment = comment;
}
}
|
C# | WINDOWS-1252 | 1,788 | 2.90625 | 3 | [] | no_license | //==============================================================
// Forex Strategy Builder
// Copyright Miroslav Popov. All rights reserved.
//==============================================================
// THIS CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT ... |
Java | UTF-8 | 3,297 | 1.539063 | 2 | [] | no_license | package p004o;
import android.graphics.LightingColorFilter;
import android.support.p000v4.view.ViewCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import andro... |
Python | UTF-8 | 3,594 | 2.71875 | 3 | [] | no_license | import requests
from io import BytesIO
from PIL import Image, ImageDraw
import cognitive_face as CF
import urllib
import urllib.request as ur
import cv2
import numpy as np
import matplotlib.pyplot as plt
KEY = '6a294681f0f640f3a8b60b1c7de8ea85' # Replace with a valid subscription key (keeping the quotes in place).
CF... |
JavaScript | UTF-8 | 916 | 2.90625 | 3 | [] | no_license | // 回调
// 事件监听
// promise
// yield function*
// async await
import path from 'path'
import events from 'events'
import util from '../../common/utils/index.js'
const Async = Object.create(null)
// #事件监听
Async.eventDemo = () => {
const obj = new events.EventEmitter()
obj.addListener("look", function(){
console.log(... |
JavaScript | UTF-8 | 2,673 | 2.953125 | 3 | [] | no_license | /* global fetch, WebSocket, location */
(() => {
const messages = document.querySelector('#messages')
const msgBox = document.querySelector('.msgBox')
const elStatus = document.querySelector('#status')
const elTyping = document.querySelector('#typing')
const inputContainer = document.querySelector('#inputCont... |
Markdown | UTF-8 | 1,028 | 2.53125 | 3 | [
"BSD-2-Clause"
] | permissive | # NoBrew Powerline install
## Steps
### Get this package to your computer
Get the Mac native development toaols necessary for the rest to work:
```xcode-select --install
```
Press "install" on the dialog box.
See more details [here](http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/)
### Fonts
Inst... |
Java | UTF-8 | 5,762 | 2.53125 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package preguntasrepuestas;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.i... |
C++ | UTF-8 | 3,981 | 3.5 | 4 | [] | no_license | /* \author Aaron Brown */
// Quiz on implementing kd tree
#ifndef kdtree3D_h
#define kdtree3D_h
#include <iostream>
#include <string>
#include <vector>
// Structure to represent node of kd tree
template<typename PointT>
struct PtNode
{
PointT point;
int id;
PtNode<PointT>* left;
PtNode<PointT>* right;
// func... |
Python | UTF-8 | 533 | 2.8125 | 3 | [] | no_license | from collections import defaultdict
lines = open('input.txt').read().splitlines()
kids = defaultdict(dict)
for l in lines:
words = l.split(' ')
outer = tuple(words[:2])
inner = [words[4+i:4+3+i] for i in range(0, len(words)-4, 4)]
for i in inner:
count = i[0]
if count != 'no':
... |
PHP | UTF-8 | 5,246 | 2.953125 | 3 | [] | no_license | <?php
class StudentsController extends AppController{
// La vue index sert de page d'accueil
public function index() {
// On test si des paramètres sont passés dans $_POST
if(!empty($this->data)){
// Test des paramètres si ils sont suffisant pour modifier un élève
if(is_string($this->data['Student']['i... |
Python | UTF-8 | 514 | 3.953125 | 4 | [] | no_license | def num_beers(n):
while n > 0:
print (str(n) + " bottles of beer on the wall")
print (str(n) + " bottles of beer")
print ("Take one down pass it around")
print (str(n - 1)+" bottles of beer on the wall!")
num_beers(n - 1)
return
else:
print ("No bottles of... |
Python | UTF-8 | 286 | 3.984375 | 4 | [] | no_license | #usr/bin/python3
a = 5
b = 3
c = 4.0
# Penjumlahan
d = a + b
print("Penjumlahan a + b adalah", d)
# Pengurangan
d = a - b
print("Pengurangan a - b adalah", d)
# Perkalian
d = a * c
print("Perkalian a * c adalah", d)
# Pembagian
d = a / b
print("Pembagian a / b adalah", d)
|
Java | UTF-8 | 5,973 | 2.71875 | 3 | [] | no_license | /**
* Used to create XML file with list of questions and their properties
* for QuestionsViewer needs.
* @author Oloieri Lilian
*
*/
import java.io.File;
import java.io.IOException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigura... |
Java | UTF-8 | 193 | 1.890625 | 2 | [] | no_license | package com.codeup.adlister.dao;
import com.codeup.adlister.models.Category;
import java.util.List;
public interface Categories {
List<Category> all();
void insert(Category cat);
} |
Python | UTF-8 | 1,070 | 4.34375 | 4 | [] | no_license | import random
secret_number = random.randint(1, 10)
trys = 0
print("I am thinking of a number between 1 and 10.")
while trys < 5:
try:
print("You have " + str(5 - trys) + " guesses left.")
number = int(input("What's the number? "))
if number == secret_number:
print("Yes! You w... |
PHP | UTF-8 | 2,136 | 2.5625 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: denny
* Date: 04/05/2017
* Time: 16:03
*/
namespace Main\Model;
use Main\Entity\ResourcesEntity;
use Main\InterFaces\Model\ResourcesModelInterFace;
use System\Model\DaoModel;
use Zend\Db\Adapter\AdapterInterface;
use Zend\Hydrator\HydratorInterface;
class ResourcesModel... |
Python | UTF-8 | 2,428 | 3.390625 | 3 | [] | no_license | #!/usr/bin/env python3
"""
@author: Timothy Baker
@date: 02-18-2019
assemble_shortest_contig.py
Dependencies:
biopython
"""
import sys
from Bio import SeqIO
def assemble_overlap(sequence_list, contig=""):
""" takes in a list of sequences and instantiates an empty string contig
Args:
seq... |
Python | UTF-8 | 1,434 | 3.1875 | 3 | [] | no_license | #v1.0 对更新用户信息的脚本进行测试,使用unittest框架技术
#更新个人信息时,需要用到登录接口获取的sessionID
#接口说明:
#接口访问地址:http://localhost:8080/jwshoplogin/user/update_information.do
#接口传入参数:1.email 2.phone 3.answer 4.question
#接口预期返回值:email已存在,请更换email再尝试更新 更新个人信息失败 更新个人信息成功
#脚本实现
#导入相关测试类
import unittest
import requests
#定义测试类,继承unittest框架
class test_up... |
Markdown | UTF-8 | 2,439 | 3.625 | 4 | [
"CC0-1.0"
] | permissive | ---
title: Alignment tab changed to `\cr`
category: errors
permalink: /FAQ-altabcr
---
This is an error you may encounter in LaTeX when a tabular
environment is being processed. "Alignment tabs" are the
`&` signs that separate the columns of a `tabular`
(or `array` or matrix) environment; so the error message
```late... |
Markdown | UTF-8 | 1,430 | 2.671875 | 3 | [] | no_license | # 如何解决json字符串中包含制表符
错误信息:
```
Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (Unescaped control character around character 135.) UserInfo=0x170e79d00 {NSDebugDescription=Unescaped control character around character 135.}
```
如何处理:
最关键的地方:
```
-(NSString *)removeU... |
Python | UTF-8 | 927 | 2.984375 | 3 | [] | no_license | import unittest
from hypothesis import strategies as st, given
from src.algorithms.search import linear_search
from src.algorithms.search import unbound_linear_search
from tests.search import _search
class TestBoundLinearSearch(unittest.TestCase):
@given(st.lists(st.integers()), st.integers())
def runTest... |
C++ | UTF-8 | 430 | 3.078125 | 3 | [] | no_license | #include <vector>
class Solution {
public:
int maxSubArray(std::vector<int>& nums) {
int max_sum = nums[0];
int sum_thus_far = 0;
for(auto n : nums) {
sum_thus_far += n;
if(sum_thus_far > max_sum)
max_sum = sum_thus_far;
... |
C | UTF-8 | 153 | 3.0625 | 3 | [] | no_license | #include "libft.h"
size_t ft_intlen(int *s)
{
size_t cont;
cont = 0;
if (!s)
return (0);
while (s[cont] != -1)
{
cont++;
}
return (cont);
}
|
PHP | UTF-8 | 567 | 2.875 | 3 | [] | no_license | <?php ob_start(); //NE PAS MODIFIER
$titre = "Exo 6 : La Boucle for "; //Mettre le nom du titre de la page que vous voulez
?>
<!-- mettre ici le code -->
<?php
$random = rand(5,20);
echo "<h2>Voici la table de multiplication de $random :</h2>";
for ($i=1; $i <= 10; $i++) {
echo $random ." * ". $... |
C | UTF-8 | 242 | 3.5 | 4 | [] | no_license | #include "holberton.h"
/**
* puts2 - prints every other character of a string
* @str: checked char
* Return: always 0 (success)
*/
void puts2(char *str)
{
int i;
while (str[i] != '\0')
{
_putchar (str[i]);
i += 2;
}
_putchar ('\n');
}
|
Markdown | UTF-8 | 1,152 | 3.546875 | 4 | [] | no_license | # 17. 电话号码的字母组合
给定一个仅包含数字 `2-9` 的字符串,返回所有它能表示的字母组合。
给出数字到字母的映射如下(与电话按键相同)。注意 1 不对应任何字母。

#### 示例:
<pre>
<strong>输入:</strong> "23"
<strong>输出:</strong> ["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"].
</pre>
#### 说明:
尽... |
PHP | UTF-8 | 1,188 | 2.515625 | 3 | [] | no_license | <?php
namespace AppBundle\Entity;
use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
/**
* A snapshot image
*
* @MongoDB\Document(repositoryClass="AppBundle\Repository\ImageRepository")
*/
class Image
{
/**
* @MongoDB\Id
*/
private $id;
/**
* @MongoDB\Timestamp
*/
priv... |
Markdown | UTF-8 | 820 | 2.765625 | 3 | [] | no_license | # Registration
---
- [Description](/{{route}}/{{version}}/registration/#description)
- [Procedure](/{{route}}/{{version}}/registration/#procedure)
<a name="description"></a>
## Description
`Appointment Management System` cannot be accessed without registration. This system's features are not accessible for guests. To... |
C++ | UTF-8 | 676 | 2.921875 | 3 | [
"MIT"
] | permissive | #include <iostream>
using namespace std ;
int main (){
int mese, anno ;
cout << "inserire numero del mese: "<<endl;
cin >> mese ;
if (mese==2){
cout << "inserire l'anno': "<<endl;
cin >> anno ;}
switch (mese)
{
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
cout << "il mese ha 31... |
Markdown | UTF-8 | 932 | 2.546875 | 3 | [] | no_license | # LDA Topic Modeling
## Analyzing and vectorizing contents of Social Network groups.
### Contents description
* loading_texts.ipynb - Notebook with VK app authorization and pipeline of VK groups content downloading.
* vk_tools.py - Module file with functions for handy loading and formatting of VK contents, used in l... |
Markdown | UTF-8 | 1,386 | 2.953125 | 3 | [] | no_license | News Manager
------------
The `NewsManager` class will be in charge of providing news from Reddit API. It will be responsible for performing the server request and give you a list of news with our already created News UI Model.
The main idea behind this is to make your API call to be executed outside of your Main UI ... |
SQL | UTF-8 | 118 | 2.859375 | 3 | [] | no_license | SELECT A.row_num, A.col_num, A.value * B.value
FROM A, B
WHERE A.row_num = B.row_num
AND A.col_num = B.col_num;
|
Python | UTF-8 | 2,999 | 2.578125 | 3 | [] | no_license | from PIL import Image
from torch.utils.data import Dataset
import torchvision
import torch
import os
import cv2
import xml.etree.ElementTree as ET
import numpy as np
from torchvision import transforms
class VOCDataset(Dataset):
CLASS_NAME = (
"__background__",
"pottedplant",
"person",
... |
Java | UTF-8 | 3,171 | 2.21875 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | /*
* Copyright 2013 National Technical University of Athens
* 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 b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.