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 |
|---|---|---|---|---|---|---|---|
Python | UTF-8 | 3,904 | 2.65625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 05 19:26:22 2017
@author: hp
"""
import tkFileDialog
import xlrd
import quopri
from tkinter import *
from tkinter.ttk import *
import os
reload(sys)
sys.setdefaultencoding("utf-8")
def tovcf():
listbox.delete(0,END)
dic={}
#path=r"C:\Users\hp\... |
Ruby | UTF-8 | 1,253 | 4.03125 | 4 | [] | no_license | require 'pry'
class Board
attr_accessor :board, :cells
def initialize
reset!
end
#why is this reset! ? how will this create a new instance? Does it already have a board defined?
def reset!
@cells = Array.new(9, " ")
#binding.pry
# I was originally doing
#cells.clear
#cells ... |
Java | UTF-8 | 1,868 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | package org.madhawav.j2pbind;
import java.util.ArrayList;
import java.util.List;
public class Config {
private String javaExportPath;
private String pythonExportPath;
private String pythonPrefix;
private List<Class> classList;
private String javaExportPathRelativeToPythonExportPath;
private L... |
Python | UTF-8 | 753 | 2.671875 | 3 | [] | no_license | # coding=utf-8
import numpy as np
import matplotlib.pyplot as plt
from lpsd import lpsd
from scipy import signal
N = int(1e5) # Number of data points in the timeseries
fs = 2. # sampling rate
fmin = float(fs) / N # lowest frequency of interest
fmax = float(fs) / 2. # highest frequency of interest
Jdes = ... |
JavaScript | UTF-8 | 2,471 | 2.515625 | 3 | [] | no_license | const youtube = require('ytdl-core');
const fileSize = require('filesize');
// const fs = require('fs')
const readline = require('readline');
// const http = require('https')
const ffmpeg = require('fluent-ffmpeg');
const ytmp3 = (url, sender) => new Promise(async (resolve, reject) => {
try {
const info = ... |
Python | UTF-8 | 2,156 | 3.328125 | 3 | [] | no_license | with open('input.txt') as f:
player1, player2 = f.read().strip().split('\n\n')
player1 = [int(c) for c in player1.split('\n')[1:]]
player2 = [int(c) for c in player2.split('\n')[1:]]
# PART 1
while len(player1) > 0 and len(player2) > 0:
c1 = player1.pop(0)
c2 = player2.pop(0)
if c1 > c2:
... |
Markdown | UTF-8 | 2,778 | 2.609375 | 3 | [
"MIT"
] | permissive | ---
keyword: [云原生AI, 监控, GPU资源]
---
# 云原生AI监控
云原生AI的监控组件能够帮助您监控集群的GPU资源使用情况以及集群的各命名空间下的资源配额使用情况。本文介绍如何安装和使用云原生AI的监控组件。
- ACK的Kubernetes集群版本大于等于1.18.8。
- Arena组件版本大于等于0.7.0。具体操作,请参见[通过组件安装最新版的Arena](/cn.zh-CN/解决方案/AI解决方案/环境准备/通过组件安装最新版的Arena.md)。
- 安装ARMS Prometheus监控组件,具体操作,请参见[arms-prometheus](https://cs.cons... |
C++ | UTF-8 | 2,983 | 2.9375 | 3 | [] | no_license | /**
* @file cdc_vcp.hpp
* @author Petr Malaník (TheColonelYoung(at)gmail(dot)com)
* @version 0.1
* @date 28.09.2020
*/
/*
Some modifications of HAL USb middleware layer are needed for proper function
Add this to usbd_cdc_if.h (anywhere to begining of file where this will not be rewritten)):
extern void USB_VCP_R... |
Java | UTF-8 | 1,669 | 2.421875 | 2 | [] | no_license | //package com.example.weixin;
//
//import lombok.extern.slf4j.Slf4j;
//
//import org.apache.commons.lang3.StringUtils;
//import org.apache.commons.codec.digest.DigestUtils;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.Arrays;
//
//
//@Slf4j
//@RestController
//@RequestMapping("/wx/portal")
... |
Java | UTF-8 | 3,427 | 2.296875 | 2 | [] | no_license | package com.example.administrator.appctct.View;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;... |
JavaScript | UTF-8 | 1,993 | 2.6875 | 3 | [] | no_license | const studentsModel = require('../models/studentModells');
const getAllStudent = async (req, res) => {
try {
await studentsModel.find({}, (err, result) => {
if (err) console.log(err);
res.json({ massage: "success", data: result })
})
} catch (err) {
res.json(... |
Python | UTF-8 | 517 | 4.40625 | 4 | [] | no_license | #fahrenheit = float(input("This program will convert a temperature in Fahrenheit to Celsius. Enter a value to continue: "))
#answer = (fahrenheit - 32) * 5 / 9
#print(fahrenheit,"degrees Fahrenheit is",answer,"degrees Celsius.")
#import random
#while True:
#r = random.randrange(0, 101 ,10)
#print(str(r))
import mat... |
PHP | UTF-8 | 768 | 2.625 | 3 | [] | no_license | <html>
<head>
<meta charset="utf-8"/>
<title>FUSSBALL!!!!</title>
</head>
<body>
<form action="/vote.php" method="post">
<select name="voted">
<option></option>
<?php
mb_internal_encoding("UTF-8");
$db = mysqli_connect("localhost", "root", "", "fussball");
$abfrage = "Select Vereinsname from Verein... |
Java | UTF-8 | 1,733 | 3.375 | 3 | [] | no_license | package SecondExam;
import java.util.Scanner;
public class JoroTheNaughty {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int rows = in.nextInt();
int cols = in.nextInt();
int jumpNumber = in.nextInt();
int[] start = new int[2];
for (... |
Java | UTF-8 | 5,347 | 2.609375 | 3 | [] | no_license | package com.team3824.akmessing1.scoutingapp.adapters;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.TextView;
import com.team3824.akmessing1.scoutingap... |
Java | UTF-8 | 384 | 2.109375 | 2 | [] | no_license | package model.inheritance.singletable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
@Entity
@DiscriminatorValue("BA")
public class BankAccount extends BillingDetails {
@Id
@GeneratedValue
protected Long id;
@NotNull
protected String account;
@NotNull
protecte... |
Java | UTF-8 | 5,127 | 2.15625 | 2 | [] | no_license | /*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
package thesis.thesis;
import haibison.android.lockpattern.LockPat... |
JavaScript | UTF-8 | 1,556 | 2.515625 | 3 | [
"MIT"
] | permissive | import { RESET_STATE } from '../actions'
import capitalize from 'lodash/capitalize'
import orderBy from 'lodash/orderBy'
import filter from 'lodash/filter'
import moment from 'moment'
export default store => next => action => {
const { type } = action;
if (type === 'INIT') {
try {
const now = moment()
... |
Java | UTF-8 | 4,164 | 2.671875 | 3 | [
"MIT"
] | permissive | package com.conveyal.r5.streets;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Base class for tests of turn costs and restrictions..
*/
public abstract class TurnTest {
public StreetLayer streetLayer;
private static final Logger LOG = LoggerFactory.getLogger(TurnTest.class);
// center... |
C# | UTF-8 | 681 | 2.78125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Empl
{
[Serializable]
public class Emp
{
[NonSerialized]
private string _Password = "abc@123";
private int _No;
public int No
{
... |
JavaScript | UTF-8 | 135 | 3.03125 | 3 | [] | no_license | let updateFunctions = [];
for (var i=0;i<2;i++)
{
updateFunctions.push(function(){return i;});
}
console.log(updateFunctions[0]()); |
Markdown | UTF-8 | 5,311 | 2.609375 | 3 | [] | no_license | 1. >Есть скрипт: a=1 b=2 c=a+b d=$a+$b e=$(($a+$b)) -> Какие значения переменным c,d,e будут присвоены? Почему?
В переменной "c" будет храниться алгоритм сложения переменной "a" и "b"
В переменной "d" будет храниться суммирование значений переменных a и b, т.е. 3
В переменной "e" будет храниться суммировани... |
JavaScript | UTF-8 | 1,509 | 3.71875 | 4 | [] | no_license | // var maxSubarrayProduct = function (nums) {
// n = nums.length;
// var max_ending_here = 1;
// var min_ending_here = 1;
// var max_so_far = 1;
// var flag = 0;
// if(nums.length === 1){
// return nums[0];
// }
// for(var i=0; i<n;i++) {
// if(nums[i] > 0){
// max_ending_here = max_end... |
C | UTF-8 | 3,837 | 3.921875 | 4 | [] | no_license | /**
* Example of a main() function using a binary search tree (BST),
* reading information about plants to add one by one from the
* standard input.
*
* Course: High Performance Programming, Uppsala University
*
* Authors: Anastasia Kruchinina <anastasia.kruchinina@it.uu.se>
* Elias Rudberg <elias.rudb... |
Ruby | UTF-8 | 409 | 2.8125 | 3 | [
"MIT"
] | permissive | module Hirsute
# defines the interface for a Constraint object that can correct a field that would otherwise break a constraint
class Constraint
def correct(field_value)
end
end
# this just adds
class UniqueConstraint < Constraint
@counter = 1
def correct(field_value)
ret_val = field... |
Java | WINDOWS-1251 | 3,158 | 2.640625 | 3 | [] | no_license | package rtorrent.torrent;
import bittorrent.TorrentFile;
import java.io.File;
import java.io.IOException;
/**
* User: welvet
* Date: 18.05.2010
* Time: 18:53:01
*/
public class ActionTorrent extends ActionTorrentBase implements TorrentFacade{
private File file;
private transient TorrentFile... |
C++ | SHIFT_JIS | 2,216 | 3.078125 | 3 | [] | no_license | #ifndef SCENE_TRANSITION_H
#define SCENE_TRANSITION_H
#include "..\Widget.h"
class CTransition; // gWVNX.
class CSceneTransition
{
const float ALPHA_ADD_VALUE = 0.01f; // ߂̉Zl.
const float ALPHA_MAX = 1.0f;
private:
// tF[h̏.
enum class enFadeState
{
In, // tF[hC.
Out, // tF[hAEg.
Finish, // tF[hI.
... |
Markdown | UTF-8 | 8,441 | 3 | 3 | [
"MIT"
] | permissive | +++
title = "What can the labor flow of 500 million people on LinkedIn tell us about the structure of the global economy?"
date = 2019-08-02T20:53:37-04:00
draft = true
# Authors. Comma separated list, e.g. `["Bob Smith", "David Jones"]`.
authors = ["Jaehyuk Park"]
# Tags and categories
# For example, use `tags = []`... |
Markdown | UTF-8 | 2,973 | 3.359375 | 3 | [] | no_license | # 第6回 価値反復法の導入
## 報酬の導入
- 迷路課題であればゴールをした時に、ロボットの歩行であれば転ばずに歩けている間、毎ステップ**報酬**を与える
- 時刻tでもらえる報酬を即時報酬(immediate reward)$$R_t$$と呼ぶ -> $$R_t$$は課題に合わせて自分で設定
- 今後未来にわたって得られるであろう報酬の合計を報酬和$$G_t$$と呼ぶ -> $$G_t = R_{t+1} + R_{t+2} + R_{t+3} + ...$$
- **時間割引**を考慮した割引報酬和(discounted total reward)$$G_t$$ -> $$G_t = R_{t+1} + \gammaR_... |
Python | UTF-8 | 593 | 4.3125 | 4 | [] | no_license | print("Python interprets any non-zero value as True. None and 0 are interpreted as False.")
while 20:
print("Works with int")
break
while "string":
print("Works with string")
break
a = None
while a:
print("Works with None")
else:
print("Does not Work with None")
while 0:
print("Works ... |
Python | UTF-8 | 135 | 3.09375 | 3 | [] | no_license | import sys
m = int(sys.stdin.readline().rstrip('\n'))
if m == 2:
print(29)
elif m in [4,6,9,11]:
print(30)
else:
print(31)
|
Java | UTF-8 | 6,551 | 2.125 | 2 | [] | no_license | package gui;
import java.net.URL;
import java.util.ArrayList;
import java.util.ResourceBundle;
import com.sun.org.apache.bcel.internal.generic.NEW;
import Entity.User;
import client.ClientConsole;
import common.Message;
import javafx.application.Platform;
import javafx.event.ActionEvent;
import javafx.f... |
C# | UTF-8 | 3,122 | 2.96875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Xml.Serialization;
using MaksDipl.Models;
using MaksDipl.View;
namespace MaksDipl.Services
{
/// <summary>
/// Класс работы с данными
///... |
Java | UTF-8 | 2,398 | 2.453125 | 2 | [] | no_license | package com.polymart.service.impl;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import com.polymart.dao.IHoaDonNhapHangDAO;
import com.polymart.dao.impl.HoaDonNhapHangDAO;
import com.polymart.model.HoaDonNhapHang... |
C# | UTF-8 | 1,791 | 2.796875 | 3 | [
"BSD-3-Clause"
] | permissive | using System;
using Common.Schema;
namespace Common.SchemaWrapper
{
public class Piece
{
private Schema.Piece schemaPiece;
public Piece()
{
this.SchemaPiece = new Schema.Piece();
}
public Piece(ulong id, PieceType type, DateTime timeStamp)
... |
C# | UTF-8 | 3,486 | 2.953125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Xml;
using System.Xml.Serialization;
namespace LauncherLesAuDacieuX
{
[Serializable]
public class Config
{
/// <summary>
/// Le nom du serveur à affi... |
Markdown | UTF-8 | 856 | 2.859375 | 3 | [
"ISC"
] | permissive | # `locations(query, [opt])`
`query` must be an string (e.g. `'Alexanderplatz'`).
With `opt`, you can override the default options, which look like this:
```js
{
fuzzy: true // find only exact matches?
, results: 10 // how many search results?
, stations: true
, addresses: true
, poi: true // poin... |
Java | UTF-8 | 1,170 | 2.1875 | 2 | [] | no_license | package freem.android;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import com.google.android.gcm.GCMBaseIntentService;
public class GCMIntentService extends GCMBaseIntentService {
public GCMIntentService() {
super(Config.GCM_SENDER_ID);
}
... |
Shell | UTF-8 | 3,253 | 2.921875 | 3 | [] | no_license | #!/bin/bash
xterm -geometry 500x500 -bg black -fg black -e "exit"
yad --center --image="/usr/share/images/conectando.jpg" --no-buttons --auto-close --no-escape --undecorated &
timeout 1 ping -q -i 0.2 -c 2 172.18.20.200
ping="$?"
nc -z -w5 172.18.20.200 8000
nc="$?"
killall -9 yad
if [ "$ping" = "2" ]; then
yad ... |
Swift | UTF-8 | 825 | 2.875 | 3 | [] | no_license | //
// ForecastAPI.swift
// BikeOrNot
//
// Created by Joel Bell on 5/19/16.
// Copyright © 2016 Joel Bell. All rights reserved.
//
import Foundation
class ForecastAPI {
class func getLocalWeatherData(_ completion: @escaping (_ results: NSDictionary) -> Void) {
let url = URL(string: "http... |
Shell | UTF-8 | 800 | 3.15625 | 3 | [] | no_license | #!/usr/bin/env sh
# clang++ main.cpp # results in:
# /usr/bin/ld: /tmp/main-6066d4.o: in function `main':
# main.cpp:(.text+0x2d): undefined reference to `MakeItRain()'
# /usr/bin/ld: main.cpp:(.text+0x32): undefined reference to `MakeItSunny()'
# clang: error: linker command failed with exit code 1 (use -v to see inv... |
SQL | UTF-8 | 791 | 3.59375 | 4 | [] | no_license | CREATE TABLE User (
username varchar(200) PRIMARY KEY,
fullname varchar(200)
);
CREATE TABLE Room (
room_id integer auto_increment PRIMARY KEY,
name varchar(200)
);
CREATE TABLE Participant (
participant_id integer auto_increment PRIMARY KEY,
room_id integer NOT NULL,
name varchar(200),
username varch... |
PHP | UTF-8 | 1,449 | 2.71875 | 3 | [] | no_license | <?php
namespace App\Http\Middleware;
use Closure;
use Firebase\JWT\JWT;
use Firebase\JWT\ExpiredException;
use App\Models\Customer;
class CustomerAuthJwtMiddleware
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed... |
Go | UTF-8 | 1,290 | 3.125 | 3 | [] | no_license | package card
import (
"bank/pkg/bank/types"
"fmt"
)
func ExampleWithdraw_positive() {
card := types.Card{Balance: 20_000_00, Active: true}
result := Withdraw(&card, 10_000_00)
fmt.Println(result.Balance)
//Output:
//1000000
}
func ExampleWithdraw_noMoney() {
card := types.Card{Balance: 0, Active: true}
re... |
Markdown | UTF-8 | 1,332 | 3.203125 | 3 | [
"Apache-2.0"
] | permissive | # Crowd Funding
## Overview
This example models the concept of crowd funding campaign where backers contribute money to a project, but the collected funds can only be released if they exceed a predefined threshold. If the threshold is not reached the funds can be reclaimed. A suggested extension to this model is to i... |
PHP | UTF-8 | 484 | 2.578125 | 3 | [] | no_license | <?php
class MsgController extends BaseController{
public function addAction(){
if ($this->getRequest()->isPost()) {
$name = $this->getRequest()->getPost('name');
$content = $this->getRequest()->getPost('content');
$result = (new MsgModel())->add("insert into msg(name,content,create_at) values('{$name}','... |
Python | UTF-8 | 940 | 3.625 | 4 | [
"MIT"
] | permissive | # 49 Ritcher Scale
a = float(input("Enter the magnitude: "))
if a < 2.0:
print("Magnitude of ",a," earthquake is considered Micro earthquake")
elif 2.0 <= a < 3.0:
print("Magnitude of ",a," earthquake is considered Very minor earthquake")
elif 3.0 <= a < 4.0:
print("Magnitude of ",a," earthquake is ... |
Java | UTF-8 | 756 | 3.140625 | 3 | [] | no_license | package ca.bcit.comp2526.a2b;
import java.awt.Color;
/**
* Sets a piece.
* @author Yan Wang
* @version 1
*
*/
public class Bishop extends Piece {
private static final long serialVersionUID = 1L;
private boolean value;
/**
* Bishop constructor.
* @param color.
*/
public B... |
Java | UTF-8 | 9,364 | 2.234375 | 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 studentdatabase;
import java.sql.*;
import javax.swing.JOptionPane;
import studentdatabase.Sqlite;
/**
*
* @author MoMo
*/
p... |
Python | UTF-8 | 1,310 | 2.734375 | 3 | [] | no_license |
# coding: utf-8
# In[2]:
import numpy as np
from keras.preprocessing import image
from keras.models import Sequential
from keras.models import load_model
import h5py
from flask import Flask, request
app = Flask(__name__)
@app.route('/', methods=['POST'])
def predict_pose():
classifier = load_model('my_model_multi... |
Go | UTF-8 | 614 | 3.109375 | 3 | [
"MIT"
] | permissive | package repo
import (
"errors"
"os"
"path"
)
// Locate returns the absolute path of the Git repository containing the current working directory.
func Locate() (*string, error) {
potentialGitRepoPath, err := os.Getwd()
if err != nil {
return nil, err
}
for potentialGitRepoPath != "/" {
_, err := os.Stat(pat... |
Python | UTF-8 | 868 | 4.0625 | 4 | [] | no_license | # Summary: 先定义一个温度类,然后定义两个描述符类用于描述摄氏度和华氏度两个属性
# 要求两个属性会自动进行转换,也就是你可以给摄氏度这个属性赋值,然后打印的华氏度属性是自动转换后的结果
# 华氏度 = 摄氏度*1.8 + 32
# Author: Fangjie Chen
# Date: 2017-11-23
# 摄氏度
class Celsius:
def __init__(self, value = 26.0):
self.value = float(value)
def __get__(self, instance, owner):
... |
C | UTF-8 | 15,503 | 2.515625 | 3 | [] | no_license | #include "mini.h"
int ft_putchar(int smb)
{
int res;
res = write (1, &smb, 1);
return (res);
}
void parser_echo(char **massiv)
{
int flag;
int i;
int j;
flag = 0;
j = 1;
i = 0;
while (!ft_strncmp(massiv[++i], "-n", 2))
{
while (massiv[i][j] == 'n')
j++;
if (massiv[i][j] == '\0')
flag = 1;
els... |
Java | UTF-8 | 54,260 | 1.6875 | 2 | [] | no_license | package com.spock.core;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.H... |
C | UTF-8 | 5,663 | 2.59375 | 3 | [] | no_license | //! \file func_s.h
//! \brief Realize functions compatible with VC++ 6.0 and below
#ifndef FUNCTIONS_COMPATIBLE_VC60_H
#define FUNCTIONS_COMPATIBLE_VC60_H
#if !defined(_MSC_VER) || _MSC_VER < 1400 // not VC8
#ifdef __GNUC__
#include <wchar.h>
#include <wctype.h>
#endif
#ifndef max
#define max(a,b) ((a)>(b)?(a):(b... |
Markdown | UTF-8 | 998 | 2.796875 | 3 | [
"MIT"
] | permissive | teamcity-notifier
=================
Node-project that can fire events when a build fails or is fixed in Teamcity
```js
var TeamCity = require('teamcity-notifier');
var tc = new TeamCity({
host: 'teamcity-server',
port: 80,
user: 'username',
password: 'password'
});
tc.on('unauthorized', function() {
cons... |
PHP | UTF-8 | 1,147 | 2.5625 | 3 | [] | no_license | <?php
session_start();
if (empty($_POST['answer']))
{
exit(0);
}
$memcache = new Memcache;
$memcache->connect('localhost',11211) or die("Could not connect to memcache");
// Check user answer against correct answer ($memcache->get('answer'))
// Create new database connection if correct and update user scor... |
PHP | UTF-8 | 748 | 2.6875 | 3 | [] | no_license | <?php
// Load Environment Variables from .env
require_once __DIR__.'/vendor/autoload.php';
$dotenv = new Dotenv\Dotenv(__DIR__);
$dotenv->load();
$host = getenv('MYSQL_HOST');
$user = getenv('MYSQL_USERNAME');
$password = getenv('MYSQL_PASSWORD');
$db = getenv('MYSQL_DATABASE');
$port = getenv('MYSQL_PORT');
try{
... |
SQL | UTF-8 | 3,978 | 2.765625 | 3 | [] | no_license | CREATE TABLE OrdLine
( OrdNo CHAR(8),
ProdNo CHAR(8),
Qty INTEGER DEFAULT 1,
CONSTRAINT PKOrdLine PRIMARY KEY (OrdNo, ProdNo),
CONSTRAINT FKOrdNo FOREIGN KEY (OrdNo) REFERENCES OrderTbl
ON DELETE CASCADE,
CONSTRAINT FKProdNo FOREIGN KEY (ProdNo) REFERENCES Product );
INSERT INTO ordline
(OrdNo, ProdNo, Qt... |
Swift | UTF-8 | 5,188 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | //
// EventDispatcher.swift
// Player
//
// Created by Fredrik Sjöberg on 2017-11-23.
// Copyright © 2017 emp. All rights reserved.
//
import Foundation
import AVFoundation
/// Dispatch class used by the player to trigger registered event callbacks.
///
/// `Tech` implementations should trigger the related events... |
Python | UTF-8 | 2,088 | 4.125 | 4 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Fri May 24 09:32:26 2019
@author: Training29
"""
####1.Write a Python program to create a tuple. ####
x = (4,6,7)
print(x)
###2. Write a Python program to create a tuple with different data types ###
tuple = ("vijay", True, 7.5, 1)
print(tuple)
###3. Write a Pyt... |
JavaScript | UTF-8 | 437 | 2.796875 | 3 | [] | no_license | (function (exports) {
let count = 0;
function Headline(webTitle, webUrl) {
this.webTitle = webTitle;
this.webUrl = webUrl;
this.id = count++;
console.log(this.id);
Object.defineProperty(this, 'title', {
get() {
return this.webTitle;
},
});
Object.defineProperty(thi... |
SQL | UTF-8 | 1,801 | 3.578125 | 4 | [] | no_license | CREATE DATABASE roster;
DROP TABLE IF EXISTS `Member`;
DROP TABLE IF EXISTS `User`;
DROP TABLE IF EXISTS `Course`;
CREATE TABLE `User` (
user_id INTEGER NOT NULL AUTO_INCREMENT,
name VARCHAR(128) UNIQUE,
PRIMARY KEY(user_id)
) ENGINE=InnoDB CHARACTER SET=utf8;
INSERT INTO `user`(`user_id`, `na... |
PHP | UTF-8 | 856 | 2.609375 | 3 | [] | no_license | <?php
namespace App\Exports;
use App\Models\User;
use Carbon\Carbon;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
class StaffsExport implements FromCollection, WithMapping, WithHeadings
{
/**
* @return \Illuminate\Suppo... |
Python | UTF-8 | 2,931 | 2.578125 | 3 | [] | no_license | """perform feature extraction, produce training dataset
"""
from __future__ import division
from copy import deepcopy
from datetime import datetime
from functools import partial
from multiprocessing.pool import ThreadPool as Pool
from os import listdir as _dir
import numpy as np
import pandas as pd
from common impor... |
C++ | UTF-8 | 327 | 2.609375 | 3 | [
"MIT"
] | permissive | #include "TimeUtils.h"
TimeUtils::TimeUtils()
{
}
TimeUtils::~TimeUtils()
{
}
void TimeUtils::start()
{
startTime = high_resolution_clock::now();
}
void TimeUtils::stop()
{
endTime= high_resolution_clock::now();
}
long TimeUtils::getDuration()
{
return (long)duration_cast<nanoseconds>(endTime - startTime).coun... |
Markdown | UTF-8 | 532 | 2.5625 | 3 | [] | no_license | # React
### Setting up
1. Install yarn
- Installing on Windows:
1. Get Node.js
https://nodejs.org/en/
2. Install Yarn package
https://yarnpkg.com/latest.msi
2. Run `yarn create react-app your-app-name`
- if you come across an issue like `is not recognized as an internal or external command, operable prog... |
Java | UTF-8 | 2,549 | 1.789063 | 2 | [] | no_license | package org.muhia.app.psi.portal.controllers;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.muhia.app.psi.integ.wsdl.mpesa.cbp.request.ObjectFactory;
import org.muhia.app.psi.integ.wsdl.mpesa.cbp.request.Response;
import org.muhia.app.psi.integ.wsdl.mpesa.cbp.request.Result;
import org.springframe... |
Python | UTF-8 | 845 | 3.671875 | 4 | [
"Apache-2.0"
] | permissive | import json
def get_user():
"""Get the users name if it exists"""
filename = 'user_db.json'
try:
with open(f'txt_files/{filename}') as f:
username = json.load(f)
except FileNotFoundError:
return None
else:
return username
def create_new_user():
"""Pr... |
Java | UTF-8 | 16,092 | 2.09375 | 2 | [
"Unlicense"
] | permissive | package de.azrael.commandsContainer;
import java.awt.Color;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.Logger... |
PHP | UTF-8 | 3,463 | 2.640625 | 3 | [] | no_license | <?php
/**
* Class and Function List:
* Function list:
* - __construct()
* - CreateContentControls()
* - CreateFieldControls()
* - CreateReferenceControls()
* - btnSave_click()
* - btnDelete_click()
* - IsNew()
* Classes list:
* - AWSInstanceEditPanelBase extends MJaxPanel
*/
class AWSInstanceEditPanelBase extends MJaxP... |
Python | UTF-8 | 1,911 | 3.28125 | 3 | [] | no_license | Mouse = '''
class Mouse:
"""STOP!!! DON'T USE THIS UNLESS YOU'RE REALLY SURE YOU KNOW HOW TO USE IT!!
Nothing bad will happen, but it just won't really help you much. Peace.
"""
def __init__(self):
"""Mouse.__init__()"""
## button press things
self.justpressed = (0,0,0)
... |
Python | UTF-8 | 2,468 | 3.5 | 4 | [] | no_license | """
@author: Khor Peak Siew
@since: 14/9/2018
@modified: 14/9/2018
"""
import unittest
from linked_list import linkedList
class MyTest(unittest.TestCase):
def test_is_empty_true(self):
my_list = linkedList()
self.assertTrue(my_list.is_empty())
def test_is_empty_false(self):
my_list ... |
Java | UTF-8 | 684 | 1.804688 | 2 | [
"MIT"
] | permissive | package uk.co.mccnet.soapNagios;
import uk.co.mccnet.simplenrpe.enums.NRPEStatus;
public class TestSuiteRequest {
private NRPEStatus nrpeStatus;
private String projectName;
private String testCaseName;
public NRPEStatus getNrpeStatus() {
return nrpeStatus;
}
public void setNrpeStatus(NRPEStatus nrp... |
Markdown | UTF-8 | 2,664 | 2.96875 | 3 | [] | no_license | # Twisted Neurons (v0.3a)
### Web app showcasing boardgames with AI that's build with machine learning techniques such as artificial neural network
## Usage/Setup
Note: The chess AI is still under active developement and is not very good right now.
View the deployed app [here](https://twisted-neurons-heroku.herokua... |
Markdown | UTF-8 | 1,896 | 3.03125 | 3 | [] | no_license | # NodeJS based Continuous Integration Server
A CI for node applications. It simply run the following on your repo:
```bash
npm install
npm test
npm run build
```
If running arbitrary code on bare metal scares you, the CI support also
to run in a VM using vagrant.
If your repository provides a Vagrantfile, the CI wi... |
JavaScript | UTF-8 | 1,561 | 2.609375 | 3 | [] | no_license | import {createStore} from "redux";
import {applyMiddleware} from "redux";
import {composeWithDevTools} from "redux-devtools-extension";
import thunk from "redux-thunk";
const initialState = {
"selected": 0,
"cities": [
{
"name" : "Moscow",
"index": "RU",
"temp": 0,
... |
JavaScript | UTF-8 | 7,406 | 2.765625 | 3 | [] | no_license | import {noteService} from '../services/note-service.js';
class NoteController {
constructor() {
this.modeSelector = document.querySelector('#mode');
this.createBtn = document.querySelector('#create');
this.popup = document.querySelector('#popup');
this.closePopupBtn = document.query... |
C++ | UTF-8 | 2,241 | 3.46875 | 3 | [] | no_license | /*
Dado un conjunto de valores, la moda es el valor (o valores) que más se
repite en dicho conjunto. Diseñar un algoritmo iterativo de coste lineal que dado un
vector de enteros positivos menores que 1000 devuelva una moda del vector.
*/
#include <iostream>
#include <fstream>
#include <algorithm> // std::max
#inclu... |
Java | UTF-8 | 710 | 2.515625 | 3 | [] | no_license | import javax.servlet.*;
import java.io.IOException;
/**
* Created by USER on 05.09.2017.
*/
public class FilterConnect implements Filter {
private FilterConfig config = null;
private boolean active = false;
public void destroy() {
config = null;
}
public void doFilter(ServletRequest... |
Java | UTF-8 | 15,845 | 1.992188 | 2 | [
"MIT"
] | permissive | /*
* The MIT License
*
* Copyright 2014 Sebastian Russ <citeaux at https://github.com/citeaux/JAHAP>.
*
* 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 w... |
TypeScript | UTF-8 | 454 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | import { BitmapImage2D } from '../image/BitmapImage2D';
import { Image2D } from '../image/Image2D';
import { IImageFactory } from './IImageFactory';
export class DefaultStageFactory implements IImageFactory {
public createImage2D(
width: number,
height: number,
transparent: boolean = true,
fillColor: number ... |
C++ | UTF-8 | 686 | 3.375 | 3 | [] | no_license | void RecordOddEven(int A[], int len){
int i=0, j = len - 1;
while(i < j){
while(i<len && A[i] % 2 == 1)
i++;
while(j>=0 && A[j] % 2 == 0)
j--;
if(i<j){
A[i] ^= A[j] ^= A[i] ^= A[j];
}
}
}
void RecordOddEvenTest(){
int A[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 11};
int len = sizeof(A) / sizeof(A[0]);... |
JavaScript | UTF-8 | 2,830 | 4.28125 | 4 | [] | no_license |
// ********* Historical Life Expectancy ************
// When we looked up all the people in our data set that lived more than
// 90 years, only the latest generation in the data came out. Let’s take a closer
// look at that phenomenon.
// Compute and output the average age of the people in the ancestry
// ... |
JavaScript | UTF-8 | 935 | 2.515625 | 3 | [] | no_license | import {
PIKCHA100_LOADED,
PIKCHA100_LOADING,
PIKCHA100_ERROR,
PIKCHA100_RESET
} from "../actions/types";
const initialState = {
top100: [],
count: 15,
start: 1,
loading: true,
error: null,
hasMore: true
};
export default (state = initialState, { type, payload }) => {
switch (type) {
case PI... |
Markdown | UTF-8 | 1,835 | 2.640625 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: '方法 : ペンを定義する'
ms.date: 03/30/2017
dev_langs:
- csharp
- vb
helpviewer_keywords:
- pens [WPF], defining
- creating [WPF], pens
ms.assetid: 7a4f2900-cdf9-49de-84e0-ba5d0ded4d33
ms.openlocfilehash: 7c5be5eff06df55e465f3e34646ba1c34e8b7e07
ms.sourcegitcommit: 3d5d33f384eeba41b2dff79d096f47ccc8d8f03d
... |
C++ | UTF-8 | 3,352 | 3.890625 | 4 | [] | no_license | /*************************************************
* @Filename: link_list.cc
* @Author: qeesung
* @Email: qeesung@qq.com
* @DateTime: 2015-06-04 03:37:28
* @Version: 1.0
* @Description: 实现链式链表的接口
**************************************************/
#include <iostream>
// 构造函数和析构函数
template <class E... |
Java | GB18030 | 302 | 2.171875 | 2 | [] | no_license | package com.neuedu.action;
import java.awt.Graphics;
/**
* @ClassName: ActionAble
* @Description: Ϊӿ
* @author neuedu_sjm
* @date 2019819 1:00:23
*
*/
public interface ActionAble {
// ƶķ
void move();
//
void draw(Graphics g);
}
|
PHP | UTF-8 | 1,293 | 2.71875 | 3 | [] | no_license | <?php
require('function.php');
debug('================================');
debug('最大挙上重量ページ');
debug('================================');
debugLogStart();
//ログイン認証
require('auth.php');
//DB用変数
$user_id = $_SESSION['user_id'];
//DB接続開始
try{
$dbh = dbConnect();
$sql = 'SELECT item_name,MAX(weight) FROM post WHE... |
Python | UTF-8 | 3,481 | 2.78125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Mon Oct 30 10:56:56 2017
@author: Eric
"""
import requests
import csv
from bs4 import BeautifulSoup as bsoup
from MALPageScrape import MALPageScrape as scrape
# this times 50 = top x shows to be considered
class MALTopScrape:
def __init__(self):
w... |
Python | UTF-8 | 25,818 | 2.5625 | 3 | [] | no_license | import json
from create_wf_model import change_and_xor_to_or, merge_split_join, change_and_to_multi_merge, \
change_loop_or_to_discriminator
from trace_validation import validate_multi_merge_in_trace, get_m_in_discriminator
from wf_graph import WF
class pattern_finder:
def __init__(self, log, wf_model, advan... |
SQL | UTF-8 | 7,093 | 3.421875 | 3 | [] | no_license |
#erstellen der evaluation_type und der evaluation_value Tabellen
CREATE TABLE evaluation_type (id INT NOT NULL, evaluation_type VARCHAR(100),
PRIMARY KEY (id), UNIQUE (evaluation_type));
CREATE TABLE evaluation_value (id INT NOT NULL, evaluation_value VARCHAR(100),
evaluation_type_id INT, FOREIGN KEY (evaluatio... |
Python | UTF-8 | 7,263 | 3.484375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sat Feb 22 18:37:17 2020
Requires the spacy library to be installed.
Needed to reformat the data from the data set to match the
data set format from the previous chat bot prototype.
Converts the tsv file to the desired list of tuples. Each index of the
tuple... |
C | UTF-8 | 7,340 | 4.0625 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include "linked_list.h"
struct list
{
cell_t *first;
cell_t *last;
int length;
};
struct cell
{
int key;
void *value;
cell_t *prev;
cell_t *next;
};
union elem
{
int i;
unsigned int u;
bool b;
float f;
void *... |
C# | UTF-8 | 7,207 | 2.640625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
using ExcelLibrary.CompoundDocumentFormat;
using ExcelLibrary.SpreadSheet;
... |
PHP | UTF-8 | 1,221 | 3 | 3 | [] | no_license | <?php
class Users {
// deklasrasi objek/variabel
private $mysqli;
// fungsi yang otomatis diload pertama kali oleh kelas
function __construct($conn) {
$this->mysqli = $conn;
}
// fungsi tampil data users
public function tampil($id = null) {
$db = $this->mysqli->conn;
$sql = "SELECT * FROM tb_... |
SQL | UTF-8 | 380 | 2.546875 | 3 | [] | no_license | /*
Creator: Mats J Svensson, CAnMove
*/
create table r_ori_sensor_type
(
sensor_type_id serial primary key,
sensor_type varchar(50) not null unique,
remark text
);
insert into x_table (name) select distinct 'r_ori_sensor_type' from x_table
where not exists (select 1 from x_table where name='r_ori_sensor_type... |
Markdown | UTF-8 | 2,277 | 2.734375 | 3 | [
"MIT"
] | permissive | Dyn API hook for Dehydrated
===========================
`host.rb` is a hook, driven by `hook.sh`, for [Dehydrated](https://dehydrated.de/) to get certificates from [Let's Encrypt](https://letsencrypt.org/) using the `dns-01` challenge-response method, for [Dyn](https://dyn.com/) Managed DNS.
It uses the official `dyn... |
PHP | UTF-8 | 1,100 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
namespace Xsanisty\UserManager\Command;
use SilexStarter\Console\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class PermissionRemoveCommand extends Command
{
protected function configure... |
Java | UTF-8 | 1,038 | 2.515625 | 3 | [] | no_license | package Classes;
import java.sql.PreparedStatement;
public class PessoaDao {
public boolean inserir(Pessoa p) {
Conexao con = new Conexao();
Boolean resultado = false;
try {
String SQL = "INSERT INTO vestibulando(nome, endereco, cidade, estado, cpf, rg, telresidencia, telcelular, email, titeleitor, pai, m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.