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 |
|---|---|---|---|---|---|---|---|
SQL | UTF-8 | 17,353 | 3.0625 | 3 | [] | no_license | /*
Kunden Tabelle füllen
*/
/*Kunden in Kunden einfügen*/
insert into kunden (Nachname,Name,Geburtsdatum,EMail,PLZ,Ort,Strasse,Hausnummer,Passwort) values (
'Müller', 'Jens', '1980-10-06', 'jmueller@gmall.com', '07741', 'Jena', 'Lessingstraße', '8', 'Jens1980');
insert into kunden (Nachname,Name,Geburtsdatum,EMail,PLZ,... |
Java | UTF-8 | 798 | 3.375 | 3 | [] | no_license | public class TargetSumDfs{
public static void main(String[] args) {
int[] nums = {1};
Solution solution = new Solution();
int targetSumWays = solution.findTargetSumWays(nums, 1);
System.out.println(targetSumWays);
}
}
class Solution {
static int res;
public int findTarge... |
Java | UTF-8 | 324 | 1.859375 | 2 | [] | no_license | package org.unibl.etf.pisio.trellofa.models;
import lombok.Data;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Id;
@Data
public class Label
{
private Integer id;
private String color;
private String name;
private String text;
private Integer idCard... |
C# | UTF-8 | 743 | 4.15625 | 4 | [] | no_license | using System;
class ModifyABitAtGivenPosition
{
static void Main()
{
Console.WriteLine("Enter a positive number \"n\" :");
int n = int.Parse(Console.ReadLine());
Console.WriteLine("Enter the specific bit position \"p\" :");
int p = int.Parse(Cons... |
Rust | UTF-8 | 4,069 | 2.578125 | 3 | [
"BSD-3-Clause"
] | permissive | // Copyright 2019 The Tari Project
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
// disclaim... |
JavaScript | UTF-8 | 3,177 | 3.421875 | 3 | [] | no_license | import react, { useState } from 'react';
const App = () => {
const [name, setname] = useState({
fname: "",
lname: "",
email: "",
pnum: "",
});
const InputChange = (events) => {
const { name, value} = events.target;
setname = ((preVal) => {
return ... |
C++ | UTF-8 | 3,488 | 2.71875 | 3 | [
"WTFPL"
] | permissive | /*
*
* Confidential Information of Telekinesys Research Limited (t/a Havok). Not for disclosure or distribution without Havok's
* prior written consent. This software contains code, techniques and know-how which is confidential and proprietary to Havok.
* Level 2 and Level 3 source code contains trade secrets... |
Java | UTF-8 | 1,917 | 2.0625 | 2 | [] | no_license | package in.thinktanker.g3.Fragments;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import in.... |
PHP | UTF-8 | 564 | 3.34375 | 3 | [] | no_license | <?php
namespace Chapter2;
require_once 'Item.php';
class Recommendation {
/**
*
* @var Item
*/
public $item;
/**
*
* @var double
*/
public $score;
public function __construct(Item $item, $score) {
$this->item = $item;
$this->score = $score;
}
... |
C | UTF-8 | 1,181 | 4.125 | 4 | [] | no_license | /*
1 - L'ordinateur tire au sort un nombre entre 1 et 100.
2 - Il vous demande de deviner le nombre. Vous entrez donc un nombre entre 1 et 100.
3 - L'ordinateur compare le nombre que vous avez entré avec le nombre qu'il a tiré au sort.
4 - Il vous dit si le nombre est supérieur ou inférieur à celui que vous avez entré.... |
PHP | UTF-8 | 498 | 2.671875 | 3 | [] | no_license | <?php
namespace app\core;
use app\core\View;
use app\lib\Db;
abstract class Controller{
public $route;
public $view;
public $model;
public function __construct($route){
$this->route = $route;
$this->view = new View($this->route);
$this->model = $this->loadModel($this->rout... |
JavaScript | UTF-8 | 681 | 2.921875 | 3 | [] | no_license | const inputData= document.getElementById("search");
function haha() {fetch (`https://itunes.apple.com/search?term=${inputData.value}&limit=50`)
.then(response => response.json())
.then(data =>{
console.log(data);
data.results.map(result => {
data=result.previewUrl;
var node = document.createElement("LI");
... |
C++ | UTF-8 | 341 | 3.546875 | 4 | [] | no_license | #include<iostream>
template<typename T>
class Stack
{
private:
T* s; // head pointer
int N;
public:
Stack(int maxN): s{new T[maxN]}, N{0} {}
void push(T& item) { s[N++] = item; }
T pop() { return s[--N]; }
bool empty() { return N==0; }
int size() { return N; }
T peek() {... |
JavaScript | UTF-8 | 4,439 | 2.671875 | 3 | [
"MIT"
] | permissive | const StarNotary = artifacts.require('StarNotary')
contract('StarNotary', accounts => {
let user1 = accounts[1];
let user2 = accounts[2];
let randomMaliciousUser = accounts[3];
let name = 'awesome star!';
let starStory = "this star was bought for my wife's birthday";
let ra = "1";
let dec... |
Python | UTF-8 | 8,983 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | import logging
from typing import Optional
import torch
from torch import nn
from ...constants import AUTOMM, FEATURES, LABEL, LOGITS, WEIGHT
from ..ft_transformer import CLSToken, FT_Transformer
from ..utils import init_weights, run_model
from .base import AbstractMultimodalFusionModel
logger = logging.getLogger(__... |
Python | UTF-8 | 345 | 2.625 | 3 | [
"MIT"
] | permissive | """Game constants."""
# size of a (square) tile's side in pixels.
TILE_SIZE = 32
# the width of the screen in pixels.
SCREEN_WIDTH = 1024
# the height of the screen in pixels
SCREEN_HEIGHT = 768
# maximum frames per second that should be drawn
LIMIT_FPS = 30
# the window's background color (RGBA, from 0-255)
WINDO... |
Java | UTF-8 | 14,965 | 1.757813 | 2 | [] | no_license | package com.online.estoreshop.activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import com... |
Python | UTF-8 | 7,506 | 3.234375 | 3 | [] | no_license | from numpy import *
import math
import matplotlib.pyplot as plt
data = load("/Users/deepaliKamat/Downloads/data.npy")
# QUESTION 2(a)
# Function for Least squares Linear Classifier
def least_Square(data):
X = data[:,[0,1]]
X1 = data[:,0]
X2 = data[:,1]
X_new = c_[ones(len(X)),X]
Y = data[:,2]
... |
Java | UTF-8 | 448 | 2.109375 | 2 | [
"MIT"
] | permissive | package net.tokensmith.otter.controller.entity;
import net.tokensmith.otter.translatable.Translatable;
public class ServerError implements Translatable {
private String message;
public ServerError() {
}
public ServerError(String message) {
this.message = message;
}
public String get... |
C++ | UTF-8 | 282 | 2.8125 | 3 | [] | no_license | // do-while.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int x = 1;
do {
cout << x << endl;
x++;
} while (x < 10); // always runs the code above at least once
return 0;
}
|
Markdown | UTF-8 | 1,834 | 3.3125 | 3 | [
"MIT"
] | permissive | ---
title: "读丰子恺小品文"
date: "2014-02-16"
comments: true
categories: reading
---
虽然一直在看书, 但所看之书皆为技术相关的, 而且看得并不深入。技术方面的书也没有什么快感可言, 很多都是原理分析,结构之类, 看多了也伤胃。 对于人文类的还是很喜欢也乐于看, 可惜初中语文没学好, 很多东西都看不懂, 也渐渐看得少, 以致到目前的状况, 基本不看。
今天去了长宁图书馆, 也许是下雨的缘故, 也可能我去得晚, 馆内看书人很少, 且为数不多的读者中多为女性。我最喜欢去的是六楼的阅览室, 先前的各种经济管理、历史哲学书都在那里, 现在貌似只有文史类的。 每次看... |
Java | UTF-8 | 530 | 1.507813 | 2 | [] | no_license | package cn.dreamdeck.iot.service.impl;
import cn.dreamdeck.iot.mapper.SysDictDataMapper;
import cn.dreamdeck.iot.service.SysDictDataService;
import cn.dreamdeck.model.iot.SysDictData;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 字典数据表... |
Python | UTF-8 | 2,237 | 2.9375 | 3 | [] | no_license | import os
import time
import json
import pandas as pd
path = "/home/ashok/Desktop/flightTracking"
# flight info will be stored in the form of key followed by a panda dataframe
flight_info_stack = {}
columns = ['hex', 'squawk', 'flight', 'lat', 'lon', 'nucp', 'seen_pos', 'altitude', 'vert_rate', 'track',
'speed', 'me... |
SQL | UTF-8 | 6,058 | 3.234375 | 3 | [] | no_license | ---------------------------------------------------------- tables -----------------------------------------------------------------------------------------
------------------------------------------------------------------------------------ACTIVITY_ID---------------------------------------------------------------------... |
Java | UTF-8 | 2,034 | 3.796875 | 4 | [] | no_license | -----------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------
Question Description
--------------------------------------------------------------------------------... |
Java | UTF-8 | 827 | 2.515625 | 3 | [] | no_license | package com.autonavi.audit.base.pagging.mongrid.entity;
import java.util.List;
public class Rows {
private String id = "0";
private List<Rows> children = null;
private Object cell = null;
private int level = 0;
public String getId() {
return String.valueOf(id);
}
public void setId(String id) {
this.id = ... |
Java | UTF-8 | 695 | 1.789063 | 2 | [
"MIT"
] | permissive | package msteamsnotifications.teamcity.settings;
import jetbrains.buildServer.serverSide.settings.ProjectSettingsManager;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.mockito.Mockito.mock;
public class MsTeamsNotificationProjectSettingsTest {
ProjectSettingsManager psm =... |
Python | UTF-8 | 993 | 3.015625 | 3 | [] | no_license | from sang import Sang
class Spilleliste:
def __init__(self, listenavn):
self._sanger = []
self._navn = listenavn
def lesFraFil(self,filnavn):
lesfil = open(filnavn)
for linje in lesfil:
formatering = linje.strip().split(";")
self._sanger.append(Sang(form... |
C++ | UTF-8 | 729 | 3.15625 | 3 | [] | no_license | #include<iostream>
#include<stdlib.h>
using namespace std;
void merge(int arr[],int s,int e)
{
int mid = (s+e)/2;
int i=s;
int j = mid+1;
int k = s;
int a[1000];
while(i<=mid && j<=e)
{
if(arr[i]<arr[j])
a[k++] = arr[i++];
else
a[k++] = arr[j++];
}
while(i<=mid)
a[k++] = arr[i++];
while(j<=e)
... |
C++ | UTF-8 | 2,160 | 2.6875 | 3 | [
"MIT"
] | permissive | #ifndef __VCALLOCATOR_H__
#define __VCALLOCATOR_H__
#include "Type.h"
class TechParameter;
class OrionConfig;
class Arbiter;
class Buffer;
class VCAllocator
{
public:
enum VAModel
{
NO_MODEL = 0,
ONE_STAGE_ARB,
TWO_STAGE_ARB,
VC_SELECT
};
public:
~VC... |
Java | UTF-8 | 44,946 | 1.726563 | 2 | [] | no_license | //
// Decompiled by Procyon v0.5.30
//
package com.android.volley.toolbox;
import org.apache.http.HttpResponse;
import java.io.Serializable;
import org.apache.http.StatusLine;
import com.android.volley.NetworkResponse;
import org.apache.http.HttpEntity;
import java.util.HashMap;
import org.apache.http.Header;
impor... |
JavaScript | UTF-8 | 747 | 3.625 | 4 | [] | no_license |
const body = document.body;
const pallete = document.getElementById("pallete");
const pallete2 = document.getElementById("pallete2");
const pallete3 = document.getElementById("pallete3");
//Random Color
function randomColor() {
let randomize = Math.floor(Math.random() * 16777215).toString(16);
let randomize2 ... |
C# | UTF-8 | 3,404 | 2.640625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
namespace API.Barin.RuleEngine
{
public class ClusterRuleCtx
{
public Application App { get; set; }
public List<Reference> References { get; set; }
}
public class RuleClusterUsage
{
public RuleResult Ru... |
Python | UTF-8 | 4,602 | 3.640625 | 4 | [] | no_license | """
Clone of 2048 game.
"""
import poc_2048_gui
import random
# Directions, DO NOT MODIFY
UP = 1
DOWN = 2
LEFT = 3
RIGHT = 4
# Offsets for computing tile indices in each direction.
# DO NOT MODIFY this dictionary.
OFFSETS = {UP: (1, 0),
DOWN: (-1, 0),
LEFT: (0, 1),
RIGHT: (0, -1)}
d... |
Python | UTF-8 | 12,117 | 3.25 | 3 | [] | no_license | from .abnormalConditions import *
import copy
'''
每一个Matrix对象都会有自己“专属”的matrix,使用self.matrix便可查看他,或直接打印对象本身查看矩阵。
在使用时应当创建一个Matrix对象,保证其余模块能顺利工作。
考虑到numpy的矩阵存储格式,以及它们不应该被改变(维度或是列数),因此所有matrix都是一个元组。
'''
class Matrix:
"""
这个类是整个库的核心,所有其他模块都多少是依赖于这个类的。
"""
def __init__(self, num_list=None):
if ... |
Markdown | UTF-8 | 2,849 | 3.03125 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | ---
layout: post
title: "CLI Data Gem Project"
date: 2018-04-29 02:44:55 +0000
permalink: cli_data_gem_project
---
I start with saying that I one of those students who spent WAAAYYY too much time on this project. I mean several weeks (though I continued on with the lessons).
I suggest you don't do that!... |
Java | UTF-8 | 145 | 1.8125 | 2 | [] | no_license | package cn.yunovo.test.buycar;
/**
* Created by Administrator on 2018/12/17.
*/
public interface IBuyCar {
//买车
void buyCar();
}
|
Java | UTF-8 | 1,454 | 3.203125 | 3 | [] | no_license | package cz.muni.fi.pb162.project.geometry;
import cz.muni.fi.pb162.project.exceptions.EmptyDrawableException;
import cz.muni.fi.pb162.project.exceptions.TransparentColorException;
import java.util.Collection;
/**
* Interface representing ability to be able to draw on that object.
*
* @author Marek Sabo
*/
public... |
Markdown | UTF-8 | 10,884 | 3.90625 | 4 | [
"MIT",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | # Concurrency
| Recipe | Crates | Categories |
|--------|--------|------------|
| [Mutate the elements of an array in parallel][ex-rayon-iter-mut] | [![rayon-badge]][rayon] | [![cat-concurrency-badge]][cat-concurrency] |
| [Sort a vector in parallel][ex-rayon-parallel-sort] | [![rayon-badge]][rayon] [![rand-badge]][ra... |
Java | UTF-8 | 298 | 2.25 | 2 | [] | no_license | package kata.vending;
/**
* Created by bforeste on 5/9/15.
*
* @author bforeste
*/
public interface CoinWeights {
public static MeasuredCoin NOT_RECOGNIZED = new MeasuredCoin(Integer.MIN_VALUE);
MeasuredCoin measureCoin(UnknownCoin unknownCoin);
CoinDisplay getCoinDisplay(int total);
}
|
PHP | UTF-8 | 314 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php declare(strict_types=1);
namespace Scraper\ScraperPrestashop\Entity;
final class PrestashopImages
{
/** @var array<int, PrestashopImage> */
public array $images = [];
public function addImage(PrestashopImage $image): self
{
$this->images[] = $image;
return $this;
}
}
|
C++ | UTF-8 | 1,605 | 2.578125 | 3 | [] | no_license | #include "stdafx.h"
#include "ComExc.h"
#include "../str/StringEncoding.h"
namespace CommonLib
{
CComExc::CComExc(HRESULT err) : m_hr(err)
{
CExcBase::AddMsg(GetComErrorDesc(err));
}
CComExc::CComExc(_com_error& err) : m_hr(err.Error())
{
if (err.Error() != S_OK)
{
wstr errDesc;
boo... |
Java | UTF-8 | 5,109 | 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 model;
import controller.SimpleDataSource;
import java.sql.Connection;
import java.sql.Time;
import java.sql.Date;
... |
C++ | UTF-8 | 4,362 | 3.828125 | 4 | [] | no_license | #include <iostream>
#include <cstring>
class Book{
private:
char *author, *title;
size_t pages, year;
public:
//The big three = default constructor, copy constructor, operator=, destructor
Book() {
this->author = nullptr;
this->title = nullptr;
this->pages = 0;
this->year = 0... |
Python | UTF-8 | 1,772 | 2.546875 | 3 | [
"MIT"
] | permissive | import os
from typing import Tuple
from web3 import Web3
from src.contracts.ethereum.ethr_contract import EthereumContract
from src.util.common import project_base_path, Token
class Erc20(EthereumContract):
def __init__(self, provider: Web3, token: Token, dest_address: str):
abi_path = os.path.join(proj... |
C++ | UTF-8 | 9,207 | 2.640625 | 3 | [] | no_license | #ifndef UTILS_META_ENABLECOPYMOVE_HXX
#define UTILS_META_ENABLECOPYMOVE_HXX
#include "always-false.hxx" // AlwaysFalseV
namespace Utils
{
template <
bool TCopyConstructible, bool TCopyAssignable, bool TMoveConstructible, bool TMoveAssignable, typename TTag
>
struct EnableCopyMove
{
static_assert (
... |
JavaScript | UTF-8 | 1,544 | 2.890625 | 3 | [] | no_license |
var o1,o2,o3,o4,o5,o6,o7,o8,o9,o0;
var mycar = cars[player.index - 1];
function createOb(){
var x = 0;
x-=300;
o1 = createSprite(x,50,10,150);
x-=300;
o2 = createSprite(x,50,10,150);
x-=300;
o3 = createSprite(x,50,10,150);
x-=300;
o4 = createSprite(x,50,10,150);
x-=300;
o5 = createSprite(x,50,10,150);
x-=300;
o6 = c... |
Markdown | UTF-8 | 2,058 | 2.640625 | 3 | [
"MIT"
] | permissive | # Docker
Electron Release Server has a `Dockerfile` and a `docker-compose.yml`file.
So, you can use [docker](https://www.docker.com/) and [docker-compose](https://github.com/docker/compose).
## Requirements
Install [docker](https://www.docker.com/) and [docker-compose](https://github.com/docker/compose).
## Localse... |
C++ | UTF-8 | 1,224 | 2.828125 | 3 | [] | no_license | #pragma once
#include <SFML/Graphics.hpp>
#include "Component.h"
class TransformComponent : public Component {
public:
TransformComponent(Entity* owner, float x, float y, const char* filename) : Component(owner) {
if (!m_texture.loadFromFile(filename)) {
printf("Failed to load texture %s", filename);
exit(1);... |
Python | UTF-8 | 1,506 | 2.84375 | 3 | [] | no_license | import os, sys, glob
from PIL import Image
def getBinaryData(filename):
binaryValues = []
file = open(filename, "rb")
data = file.read(1)
while data != b"":
try:
binaryValues.append(ord(data))
except TypeError:
pass
data = file.read(1)
return binaryValues
def createGreyScaleIma... |
Java | UTF-8 | 7,198 | 2.25 | 2 | [] | no_license | package com.suypower.cloudx.storage.support;
import com.suypower.cloudx.storage.core.entity.FileOption;
import com.suypower.cloudx.support.util.DateTime;
import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.activation.MimetypesFileTypeMap;
import java.io.*;
imp... |
PHP | UTF-8 | 1,158 | 2.75 | 3 | [
"MIT"
] | permissive | <?php
use Faker\Factory as Faker;
use App\Models\domain;
use App\Repositories\domainRepository;
trait MakedomainTrait
{
/**
* Create fake instance of domain and save it in database
*
* @param array $domainFields
* @return domain
*/
public function makedomain($domainFields = [])
{
... |
Java | UTF-8 | 1,191 | 2.28125 | 2 | [
"BSD-3-Clause"
] | permissive | /*
* Copyright (C) 2019 Intel Corporation
* SPDX-License-Identifier: BSD-3-Clause
*/
package com.intel.mtwilson.jetty;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;
import org.junit.AfterClass;
import org.junit.BeforeClass;
/**
*
* @author jbuhacoff
*/
public class Junit... |
JavaScript | UTF-8 | 660 | 3.984375 | 4 | [] | no_license | alert("Open F12 to see result");
class arrayGenerator {
constructor(n){
let arr = [];
for(let i = 0; i < n; i++){
arr.push(Math.floor(Math.random()*100));
}
console.log("Created array:" , arr);
return arr;
}
}
function filterRangeInPlace(arr, from , to){
let filtered = ar... |
Java | UTF-8 | 2,188 | 3.015625 | 3 | [] | no_license | import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class UserInterFaceStringHex extends UserInterface
{
JTextField input;
JTextField result;
JButton buttonEq;
JLabel message;
/*... |
Java | UTF-8 | 542 | 2.296875 | 2 | [] | no_license | package br.com.prss.sales.model;
public class RelatorioVendas {
// soma do valor de todos os itens das vendas no mês
private double valorTotalVendas;
// número de vendas realizadas no mês
private int numeroVendas;
public RelatorioVendas() {
}
public RelatorioVendas(int numeroVendas, double valorTotalVendas)... |
Java | UTF-8 | 1,752 | 2.234375 | 2 | [] | no_license | package com.ebiz.filter;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.Map;
@WebFilter(urlPatterns = "/*")
p... |
Python | UTF-8 | 112 | 3.265625 | 3 | [] | no_license | i=0
j=0
while(i<6):
if i==0 or i==5:
print '+',
else:
print '-',
i=i+1
|
Java | UTF-8 | 1,053 | 2.09375 | 2 | [
"Apache-2.0"
] | permissive | package com.gw.swipebacksample.activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.gw.swipebacksample.R;
import com.gw.swipebacksample.base.BaseSwipeBackActivity;
/**
* Created by GongWen on 17/8/24.
*/
publ... |
Java | UTF-8 | 194 | 2.234375 | 2 | [] | no_license | package visitor;
import twitter.User;
import twitter.UserGroup;
public interface Visitor {
public void visit(User user);
public void visit(UserGroup userGroup);
public int getResult();
}
|
C | UTF-8 | 825 | 3.25 | 3 | [] | no_license | // s4.C - String class substrings
#include <iostream.h>
#include "String3.h"
void f(const String & s1, const String & s2) {
cout << s2 << endl;
cout << s1(5, 3) << endl; // rvalue, substring "bet"
cout << s1[0] << s2[1] << s2[2] << endl;
cout << s1(10, 2) << endl; // rvalue - error (illegal position)... |
Markdown | UTF-8 | 1,609 | 3 | 3 | [] | no_license | Intro
-----
This is wrapper to use with [api.ai](http://api.ai) service webhooks.
You can see example of usage for weather robot (with ```pyowl``` package to get weather data).
Concepts
--------
API.AI webhooks get "action" attribute.
This library filters handlers by action (you can use empty action name - "" - to han... |
JavaScript | UTF-8 | 1,457 | 2.6875 | 3 | [] | no_license | import React, { useEffect, useState } from 'react'
import axios from 'axios'
import Card from './Card'
import './CardHolder.css';
// #093009
// #0D3e10
// #369457
const CardHolder = ({category, limit}) => {
const [data, setData] = useState([]);
useEffect(() => {
const apiUrl = category ==='betterCall... |
Markdown | UTF-8 | 15,000 | 3.1875 | 3 | [
"CC0-1.0"
] | permissive | ## Counting Theorems
:::{.theorem title="Lagrange's Theorem"}
\[H \leq G \implies \# H \divides \# G.\]
Moreover, there is an equality $[G:H] = \# G/ \# H$ when $G$ is finite.
:::
:::{.proof title="of Lagrange's theorem"}
Write $G/H = \ts{g_0 H, g_1 H, \cdots, g_N H}$ for some $N \da [G:H]$.
Since cosets are equal or... |
Java | UTF-8 | 1,730 | 2.4375 | 2 | [] | no_license | package CTAControllers.Login;
import CTAControllers.ChallongeController;
import CTAModels.UserModel;
import Constants.ViewConstants;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.PasswordField;
import javafx.... |
Java | UTF-8 | 1,293 | 1.976563 | 2 | [] | no_license | package com.example.notepad;
import android.content.Intent;
import android.os.Bundle;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;... |
C# | UTF-8 | 3,547 | 2.9375 | 3 | [] | no_license | using System;
using System.Windows.Forms;
namespace AdoNetDemo
{
public partial class Form1 : Form
{
ProductDal _productDal = new ProductDal();
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
... |
Java | UTF-8 | 518 | 2.75 | 3 | [] | no_license | package de.zwibbltv.dreamland.utils;
public enum CarTypes {
GOLFCART("Golf-Cart", 35, 1),
SPEEDCAR("Formel 1", 40, 1),
ANTIQCAR("Dreamland-Shop", 52, 2);
String Name;
Integer DamageNumber;
Integer Speed;
private CarTypes(String name, Integer damagenumber, Integer speed) {
this.Name = name;
this.DamageN... |
Java | UTF-8 | 4,896 | 1.953125 | 2 | [] | no_license | package com.it.apt.userDash.controller;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframewo... |
Python | UTF-8 | 1,889 | 2.53125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/python
import os
import sys
import unittest
import time
import subprocess
from generator.actions import Variable, Actions
class POLL_GENERATOR(unittest.TestCase):
def test_variable(self):
with self.assertRaises(TypeError):
Variable()
with self.assertRaises(AssertionError)... |
C# | UTF-8 | 3,124 | 3.296875 | 3 | [] | no_license |
using System;
namespace FluidEarth2.Sdk
{
public class TimeInterval
{
uint _days;
uint _hours;
uint _minutes;
double _seconds;
bool _millisecondLimit = true;
bool _allowZero = false;
public static TimeInterval FromDays(uint days)
{
... |
Python | UTF-8 | 1,231 | 3.90625 | 4 | [] | no_license | array = [[], [], [], [], []] # has 5 empty "buckets"
class HashTable:
def __init__(self,num_buckets):
self.num_buckets = num_buckets
self.buckets = [[] for _ in range(num_buckets)]
def hash_function(self,string):
string_weight = sum([ord(char)-97 for char in string])
return str... |
C++ | UTF-8 | 638 | 3.5 | 4 | [] | no_license | #include<iostream>
#include<conio.h>
using namespace std;
void LeftShiftString(char *str,int len,int shift);
void reverseString(char*str,int start,int end);
int main(){
int shift;
char str[20];
cout<<"INPUT String:";
cin>>str;
cout<<"INPUT Shift:";
cin>>shift;
LeftShiftString(str,strlen(str),shift);
cout<<str<<... |
Markdown | UTF-8 | 1,430 | 3.84375 | 4 | [] | no_license | # 85 最大矩形
对每一行求出每个元素对应的高度,然后进行84题中柱状图中最大矩形计算,得到最大值
```java
class Solution {
public int maximalRectangle(char[][] matrix) {
if (matrix.length == 0 || matrix[0].length == 0) return 0;
int[] arr = new int[matrix[0].length];
int max = 0;
for (int i = 0; i < matrix.length; i++) {
... |
Go | UTF-8 | 1,455 | 2.8125 | 3 | [] | no_license | package handler
import (
"fmt"
"net/http"
dbP "github.com/maseiler/avh-booking-system/server/database"
)
// UpdateFavoriteItems forwards API calll to create a new entry in database if item and user doesn't exists or increments count otherwise.
func UpdateFavoriteItems(w http.ResponseWriter, r *http.Request) {
ca... |
TypeScript | UTF-8 | 713 | 2.578125 | 3 | [] | no_license | import HttpError from '@shared/errors/HttpError'
import Client from '../infra/typeorm/entities/Client'
import { IClientRepository } from '../repositories/ClientRepository.ts'
class UpdateClientNameService {
constructor(private clientsRepository: IClientRepository) {}
public async execute(clientId: string, name... |
Java | UTF-8 | 2,990 | 1.882813 | 2 | [] | no_license | package aa14f.client.servicesproxy.rest;
import aa14f.api.interfaces.AA14FindServicesForOrganizationalEntityBase;
import aa14f.client.servicesproxy.rest.AA14RESTServiceResourceUrlPathBuilderBases.AA14RESTServiceResourceUrlPathBuilderForEntityPersistenceBase;
import aa14f.model.oids.AA14IDs.AA14BusinessID;
import ... |
Java | UTF-8 | 706 | 2.390625 | 2 | [] | no_license | import java.util.Arrays;
import java.util.stream.Collectors;
import org.antlr.v4.runtime.ANTLRInputStream;
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.ParserRuleContext;
public class Main {
public static void main(String[] args) {
String exp... |
Python | UTF-8 | 1,853 | 3.5625 | 4 | [] | no_license | from enum import Enum
class Type(Enum):
NOTHING = 0 # Null (None)
INT64 = 1 # Int (Integer)
FLOAT64 = 2 # Float (Decimal)
BOOLEAN = 3 # Boolean (True || False)
CHAR = 4 # Char ('d')
STRING = 5 # String ("Cadena")
ARRAY = 6 # Array ([])
STRUCT = 7 ... |
Shell | UTF-8 | 951 | 3.265625 | 3 | [] | no_license | #!/bin/sh
# $NetBSD: makeconf,v 1.7 2009/01/24 00:19:47 abs Exp $
emit_file() {
echo "Generating $1"
echo '#
# $NetBSD: makeconf,v 1.7 2009/01/24 00:19:47 abs Exp $
#
# This file was automatically created. Changes will be
# lost when running makeconf in this directory.
#
# Created from:' > $1
if [ $2 != GENERIC.in ... |
Markdown | UTF-8 | 5,882 | 2.703125 | 3 | [
"MIT"
] | permissive | # camunda-modeler-autosave-plugin

[](https://github.com/camunda/camunda-modeler) [
doc=f.read()
print('------原文------------------------------------------')
print(doc.encode('raw_unicode_escape').decode('utf-8'))
# 找出文章中的特徵文字
vectorizer=CountVectorizer(min_df=1)
content=[]
... |
PHP | UTF-8 | 4,136 | 2.765625 | 3 | [] | no_license | <?php
/**
*
* Sql_CompilerSelect
* @package Sql_Compiler
* @author Thomas Sch�fer
* @since 30.11.2008 07:49:30
* @desc compiles sql select statements into string
*/
/**
*
* Sql_CompilerSelect
* @package Sql_Compiler
* @author Thomas Sch�fer
* @since 30.11.2008 07:49:30
* @desc compiles s... |
Java | UTF-8 | 236 | 1.5 | 2 | [] | no_license | package com.smc.sba.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import com.smc.sba.entity.IpoDetlsEntity;
public interface IpoDetlsRepository extends JpaRepository<IpoDetlsEntity, Integer> {
}
|
Java | UTF-8 | 1,015 | 3.34375 | 3 | [] | no_license | /**
* Created by 1 on 2017/6/30.
*/
public class _108ConvertSortedArraytoBinarySearchTree {
static class TreeNode {
int val;
TreeNode left;
TreeNode right;
TreeNode(int x) { val = x; }
}
public static void main(String[] args) {
_108ConvertSortedArraytoBinarySearchT... |
C# | UTF-8 | 413 | 3.46875 | 3 | [] | no_license | using System;
namespace Commons
{
public static class TimeSpanExtensions
{
public static TimeSpan Multiply(this TimeSpan timeSpan, int factor)
{
return TimeSpan.FromTicks(timeSpan.Ticks * factor);
}
public static TimeSpan Divide(this TimeSpan timeSpan, int divisor)... |
Java | UTF-8 | 2,367 | 2.265625 | 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 com.service;
import com.dao.T_laborDao;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.go... |
Java | UTF-8 | 8,631 | 1.890625 | 2 | [] | no_license | package com.aimxcel.abclearn.theramp.view.bars;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.geom.GeneralPath;
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.io.IOException;
import java.util.ArrayLi... |
C# | UTF-8 | 4,251 | 2.578125 | 3 | [] | no_license | using BulletinBridge.Data;
using BulletinEngine.Core;
using System;
using System.Collections.Generic;
using System.Linq;
namespace BulletinEngine.Helpers
{
static class GroupHelper
{
///-------------------------------------------------------------------------------------------------
/// <summa... |
Java | UTF-8 | 747 | 2.234375 | 2 | [] | no_license | package itachi_waiyan.com.assignment3_cardesign.viewholder;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import itachi_waiyan.com.assignment3_cardesign.delegate.EventItemDelegate;
public class MyViewHolder extends RecyclerView.ViewHolder {
pr... |
Java | UTF-8 | 4,097 | 2.0625 | 2 | [
"Apache-2.0"
] | permissive | package com.tvd12.ezyfox.sfs2x.testing.serverhandler;
import org.testng.annotations.Test;
import com.smartfoxserver.v2.api.ISFSApi;
import com.smartfoxserver.v2.core.ISFSEvent;
import com.smartfoxserver.v2.core.SFSEventParam;
import com.smartfoxserver.v2.entities.User;
import com.smartfoxserver.v2.entities.Zone;
impo... |
JavaScript | UTF-8 | 1,301 | 2.578125 | 3 | [] | no_license | import { createStore, combineReducers, applyMiddleware } from 'redux';
import ReduxThunk from 'redux-thunk';
import { composeWithDevTools } from 'redux-devtools-extension';
import axios from 'axios';
// initialState
const userInitialState = {}
// action type
const LOGOUT = 'LOGOUT';
// 纯粹的方法,不应该有副作用 纯函数不依赖外部变量
// ... |
JavaScript | UTF-8 | 646 | 4.28125 | 4 | [] | no_license | var obj = {
person1Age: 20,
person1Name: 'Ivanov',
person2Age: 30,
person2Name: 'Petrov',
person3Age: 40,
person3Name: 'Sidorov'
};
function extractNumber(obj){
var numbers = [];
for(key in obj){
var value = obj[key]
if(!isNaN(+value)){
numbers.push(value);
}
}
return numbers;
}
function extr... |
C++ | UTF-8 | 669 | 2.6875 | 3 | [] | no_license | #include "RenderManager.h"
RenderManager::RenderManager()
{
}
RenderManager::~RenderManager()
{
}
RenderManager & RenderManager::get()
{
static RenderManager* instance = NULL;
if (instance == NULL)
{
instance = new RenderManager();
}
_ASSERT(instance);
return *instance;
}
void RenderManager::startUp()
{
//... |
Java | UTF-8 | 3,404 | 2.234375 | 2 | [
"Apache-2.0"
] | permissive | package net.sf.fmj.media.datasink.render;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.media.CannotRealizeException;
import javax.media.IncompatibleSourceException;
import javax.media.Manager;
import javax.media.NoPlayerException;
import javax.media.Player;
... |
C++ | UTF-8 | 2,302 | 2.671875 | 3 | [] | no_license | #include "pw_iconv.h"
#include "pw_logger.h"
#include "pw_tss.h"
#include "pw_memory.h"
namespace pwutils
{
std::string g_sDefaultEncoding("GBK");
class Encoding
{
public:
Encoding()
{
m_hIconvToUtf8 = iconv_open("UTF-8",g_sDefaultEncoding.c_str());
assert(m_hIconvToUtf8 != (iconv_t)-1);
m_hIconvTo... |
Java | UTF-8 | 1,655 | 2.140625 | 2 | [] | no_license | package com.android.ohara.telemaco.activity;
import android.graphics.Typeface;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.android.ohara.telemaco.R;
public c... |
Java | UTF-8 | 1,754 | 2.046875 | 2 | [] | no_license | package com.zdsoft.finance.businesssetting.entity;
import com.zdsoft.framework.core.common.domain.BaseEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* 版权所有:重庆正大华日软件有限公司
* @title ExceptMatter.java
* @className ExceptMatter
* @description 特批事项域对象
* @a... |
Shell | UTF-8 | 2,073 | 2.671875 | 3 | [] | no_license | ##
# Stolen from https://github.com/natebosch/dotfiles/blob/master/zshrc.d/completion.zsh
# because he is my friend
##
setopt COMPLETE_IN_WORD # Allow tab completion in the middle of a word
setopt CORRECT # Spell check commands
setopt ALWAYS_TO_END # Push cursor on completions.
setopt histigno... |
Java | UTF-8 | 551 | 2.203125 | 2 | [] | no_license | package com.example.demo.controller;
import com.example.demo.entities.Person;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class controller {
@RequestMapping(value="")
public String sho... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.