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 |
|---|---|---|---|---|---|---|---|
C++ | UTF-8 | 294 | 2.625 | 3 | [] | no_license | #include <iostream>
#include "point.h"
#include "rectangle.h"
int main(void){
point p1,p3;
p1.getpoint(1,1);
p3.getpoint(2,1);
rectangle a;
a.setPoints(p1,p3);
double c,d;
a.getDimensions(c,d);
std::cout << "Perimeter is :" << a.perimeter() << std:: endl;
} |
Shell | UTF-8 | 137 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | #!/bin/sh
echo "App started"
while true
do
date >> data/output.txt
echo "Output content:"
cat data/output.txt
sleep 1
done |
Python | UTF-8 | 4,281 | 3.265625 | 3 | [] | no_license | """Module with interactions for user table threw backend API"""
import requests
import urllib.parse
from typing import Union, List, Dict
class User:
__GET_USERS_REL_PATH = 'users'
__GET_ONE_USER_REL_PATH = 'get_one_user'
__ADD_USER_REL_PATH = 'add_user'
__CHANGE_USER_REL_PATH = 'change_user'
__D... |
C++ | UTF-8 | 965 | 2.59375 | 3 | [
"MIT"
] | permissive | #include <MemeGraphics/VertexArray.hpp>
#include <MemeGraphics/OpenGL.hpp>
#include <MemeCore/Debug.hpp>
namespace ml
{
/* * * * * * * * * * * * * * * * * * * * */
VertexArray::VertexArray()
: IHandle(NULL)
{
}
VertexArray::VertexArray(const VertexArray & copy)
: IHandle(copy)
{
}
VertexArray::~VertexAr... |
Python | UTF-8 | 2,681 | 2.75 | 3 | [] | no_license | '''
@author: Inon Sharony
@contact: www.tau.ac.il/~inonshar
@organization: Tel Aviv University Department of Chemical Physics
@since: Aug 5, 2015
'''
from numpy import exp
from random import gauss
import unittest
from src.FitDissipationOrdinaryLeastSquares import FitDissipationOrdinaryLeastSquares
class FitDissipat... |
Python | UTF-8 | 1,824 | 2.859375 | 3 | [] | no_license | # Making sure all libraries are installed
try:
import xml.etree.ElementTree as xml
except:
print("Failed to import XML library!")
quit()
try:
import sys
except:
print("Failed to import sys library!")
quit()
# Preparing root for Nessus file
file = xml.parse(sys.argv[1])
root = file.getroot()
# Preparing output f... |
JavaScript | UTF-8 | 748 | 2.875 | 3 | [
"MIT"
] | permissive | function canvasToRgba(ctx) {
// const bgra = canvas.toBuffer('raw');
/* const rgba = Buffer.allocUnsafe(bgra.length);
for (let i = 0; i < bgra.length; i += 4) {
rgba[i + 0] = bgra[i + 2];
rgba[i + 1] = bgra[i + 1];
rgba[i + 2] = bgra[i + 0];
rgba[i + 3] = bgra[i + 3];
} */
// We cannot use t... |
Markdown | UTF-8 | 590 | 2.8125 | 3 | [] | no_license | # repositories.json
### What's this?
This contains all the repositories containing SimpleCoreAPI Modules, used to download them at runtime if required.
### Format
```json
[
{
"url": "my-repo-url",
"repo": "simplecoreapi-modules"
},
{
"url": "another-repo-url",
"repo": "maven-public"
}
]
```
... |
C# | UTF-8 | 854 | 3.046875 | 3 | [] | no_license | namespace PixelMoon.Core
{
public enum GameStates { IsPlaying, InMenu, IsPaused, InBattle };
public static class GameState
{
private static GameStates _gameState = GameStates.IsPlaying;
private static GameStates _previousGameState;
public static bool IsPlaying => (_gameState == Ga... |
Markdown | UTF-8 | 974 | 2.703125 | 3 | [
"MIT"
] | permissive | # [#OpenTalks](https://github.com/open-minds?utf8=%E2%9C%93&q=open-talks) 1.0: Augmented Reality

## Augmented Reality demo using Unity3D & Vofuria
In the 15mn talk/demo, [Oussama](https://github.com/oussamabon... |
JavaScript | UTF-8 | 2,506 | 2.96875 | 3 | [] | no_license | function Coin(x, y, z, radius, width) {
var y_rot = 0;
this.pts = [];
this.origin = createPoint(x, y, z);
var steps = 24;
var alpha = 1;
this.destroyed = 0;
this.set = function(x, y, z, radius, width) {
this.radius = radius;
this.width = width;
var vstp = 2.0 * M... |
JavaScript | UTF-8 | 1,005 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react';
class LinkList extends Component {
render() {
let links = [];
if (Array.isArray(this.props.links)) {
links = this.props.links.map(function (link, i) {
let classes = "link-item col-md-5 alert alert-warning";
if (i % 2 == 1) {
classes += " col-md-offset-1"... |
C++ | UTF-8 | 2,177 | 3.171875 | 3 | [] | no_license | /*************************************************************************
> File Name: 8.1.cpp - ML learning for linear regression
> Author:
> Mail:
> Created Time: 2017年03月05日 星期日 11时12分24秒
************************************************************************/
#include<iostream>
#include<cmath>
#include<ve... |
Markdown | UTF-8 | 2,453 | 2.578125 | 3 | [] | no_license | # nkfust-demo
demo how to use github
## h2 ##
show h2 title
### h3 ###
show h3 title
#### h4 ####
show h4 title
##### h5 ######
show h5 title
###### h6 ######
show h6 title
`
小區塊顯示使用1個反引號(`)
`
```
大區塊顯示使用3個反引號(```)
```
>多行使用>符號
>多行使用>符號
>多行使用>符號
>多行使用>符號
>多行使用>符號
>多行使用>符號
>多行使用>符號
>多行使用>符號
>多行使用>符號
>多行使用>符號
>多行使用>符號
... |
Markdown | UTF-8 | 2,212 | 2.9375 | 3 | [
"MIT"
] | permissive | # 简介 {#DDHApiWelcome .concept}
欢迎您选择专有宿主机DDH(Dedicated Host),我们提供了丰富的API供您使用。
## 使用限制 {#section_otf_b2h_4fb .section}
您能创建的专有宿主机有数量和规格限制。更多详情,请参见[使用限制](../../../../cn.zh-CN/产品简介/使用限制.md#)。
当接口描述、参数可选值和资源规格与使用限制发生矛盾时,以使用限制为准。
## 开发者选项 {#section_ldy_f2h_4fb .section}
您可以通过以下方式调用专有宿主机API。
- (推荐)不同编程语言的[SDK](https... |
C++ | UTF-8 | 5,119 | 2.65625 | 3 | [] | no_license | #pragma once
#include <cassert>
#include <memory>
#include <vector>
#include <VRPG/Game/Misc/RenderParams.h>
#include <VRPG/Game/World/Chunk/ChunkModel.h>
VRPG_GAME_BEGIN
using BlockEffectID = uint16_t;
/*
一个BlockEffect代表一种特定类型的方块外观,包括其shader、纹理、input layout等
一个chunk model由多个section model构成,一个section model包含多个pa... |
Java | UTF-8 | 775 | 2.125 | 2 | [
"Apache-2.0"
] | permissive | package com.example.configclient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.Ap... |
Java | UTF-8 | 4,276 | 2.03125 | 2 | [] | no_license | package com.maxvision.tech.robot.ui.dialog;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.rec... |
Python | UTF-8 | 435 | 3.703125 | 4 | [] | no_license |
# coding: utf-8
# ## Q. 최대, 최소 기대수명 출력하라. [loc,iloc,컬럼명 3가지 이용]
# In[1]:
import pandas as pd
df=pd.read_csv('./../data/gapminder.tsv',sep='\t')
df
# In[2]:
df.head(2)
# In[3]:
subset_loc=df.loc[0]
subset_tail=df.tail(1)
subset_head=df.head(1)
# In[4]:
print(subset_loc,'\n===>')
print(subset_tail,'\n')... |
C | UTF-8 | 739 | 4.03125 | 4 | [] | no_license | /* 1st way: Using 2 pointer */
int *sortedSquares(int *A, int ASize, int *returnSize) {
int i, start = 0, end = ASize - 1;
int *res = malloc(ASize * sizeof(int));
*returnSize = ASize;
for (i = ASize - 1; i >= 0; i--) {
if (abs(A[start]) > A[end]) {
res[i] = A[start] * A[start];
start++;
} el... |
Java | UTF-8 | 1,778 | 3.09375 | 3 | [] | no_license | import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.StringTokenizer;
/**
* Created by omar on 21/07/17.
*/
public class ProbabilityTree {
ArrayList<Node>[] children;
int l, u;
ArrayList<Integer> res = new ArrayList<>();
public int[] getOdds(String[] tre... |
Java | UTF-8 | 3,632 | 2.09375 | 2 | [
"Apache-2.0"
] | permissive | package com.isz.model;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import org.spring... |
Python | UTF-8 | 3,338 | 3.265625 | 3 | [] | no_license | #!/usr/bin/env python2.7
import hashlib
class BitVector(object):
def __init__(self, size_in_bits):
self._size_in_bits = size_in_bits
full_bytes_used, leftover = self._decode_index(size_in_bits)
size_in_bytes = full_bytes_used + (1 if leftover else 0)
self._vector = bytearray(size_in_bytes)
def g... |
Java | UTF-8 | 745 | 2.1875 | 2 | [] | no_license | package com.yeeoffice.libarary.page;
import org.openqa.selenium.WebDriver;
import com.yeeoffice.libarary.publics.BasePages;
import com.yeeoffice.libarary.publics.Locator;
public class CreatePage extends BasePages{
WebDriver driver;
public WebDriver getDriver() {
return driver;
}
public Create... |
C++ | UTF-8 | 1,085 | 3.28125 | 3 | [] | no_license | #ifndef __COORDINATE_H__
#define __COORDINATE_H__
#include <iostream>
//*****************************************************************
struct Coordinate
{
/** Constructor. */
Coordinate ();
/** Constructor with parameters. */
Coordinate (int row, int column);
/** Copy constructor. */
Coordinate ( const Coo... |
PHP | UTF-8 | 293 | 2.671875 | 3 | [] | no_license | <?php
require_once("includes/Vraag.class.php");
foreach(Vraag_class::find_all( ) as $vraag)
{
echo "<p><strong>".$vraag->getVraag()."</strong><br><br>
".$vraag->getAntwoord()."<br><br><br></p>";
}
?>
<br><h2><a href='index.php?action=vraag'>Stel een vraag</a></h2><br><br> |
Markdown | UTF-8 | 19,117 | 3 | 3 | [
"MIT"
] | permissive | # Objective-C Style Guide
This style guide outlines the coding conventions of the iOS team at Gigigo Mobile Services. We welcome your feedback in [issues](https://github.com/gigigoapps/objective-c-style-guide/issues), [pull requests](https://github.com/gigigoapps/objective-c-style-guide/pulls) and [tweets](https://twi... |
Markdown | UTF-8 | 942 | 2.890625 | 3 | [
"MIT",
"CC-BY-SA-3.0"
] | permissive | # IP

## Installation
To use this segment, you need to activate it by adding `ip` to your
`P9K_LEFT_PROMPT_ELEMENTS` or `P9K_RIGHT_PROMPT_ELEMENTS` array, depending
where you want to show this segment.
## Configuration
This segment tries to examine all currently used network interfaces and prints
t... |
PHP | UTF-8 | 1,459 | 2.578125 | 3 | [] | no_license | <?php
use Phinx\Migration\AbstractMigration;
class ImageFieldLength extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-change-method
*
* Uncomment this method if you would like ... |
Java | UTF-8 | 591 | 2.25 | 2 | [] | no_license | package com.example.mailtest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
public class Email {
@Autowired
private JavaMailSender javaMailSender;
/*
Envia un email a "enricp... |
Markdown | SHIFT_JIS | 3,164 | 3.125 | 3 | [] | no_license | % ۑX fBAtB^Ɛs
% fBAtB^[KpCmCY̌
% 14NE012 erS
W摜uorg.jpgv摜ƂD̉摜͏c480摜C480fɂ鐳`̃fBW^J[摜łB
ORG = imread('image/org.jpg'); % 摜̓ǂݍ
ORG = rgb2gray(ORG); % ZW摜ɕϊ
imagesc(ORG); colormap(gray); colorbar; % 摜̕\
pause;
ɂāA摜O[XP[iPxl݂̂̉摜jɕϊB
O[XP[摜}1ɎB
 {}
public Profile(String lang, String exp) {
super();
//this.pid=pid;
this.lang = lang;
this.exp = exp;
}
public int getPid() {
re... |
Python | UTF-8 | 1,122 | 2.96875 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
# pytorch 版本的
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class RegressionNN(nn.Module):
# A simple MLP regression network
def __init__(self, feature_number):
super(RegressionNN,self).__init__()
self.feature_number = feature_n... |
Python | UTF-8 | 2,350 | 2.90625 | 3 | [
"MIT",
"CC0-1.0"
] | permissive | #!/usr/bin/env python
#
# BakeBit Example for using the BakeBit LED for LED Fade effect
# http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_Red_LED
# http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_Green_LED
#
# The BakeBit connects the NanoPi NEO and BakeBit sensors.
# You can learn more about BakeBit here: ... |
Java | UTF-8 | 520 | 2.71875 | 3 | [] | no_license | package com.example.lab3baydulina;
import com.example.lab3baydulina.task3.Point3D;
import org.junit.Test;
public class Testtask3 {
@Test
public void Test(){
Point p1 = new Point();
System.out.println("(Without setters) " + p1);
p1.setX(5);
p1.setY(3);
System.out.printl... |
Markdown | UTF-8 | 4,197 | 2.828125 | 3 | [] | no_license | # 1. Create upload file mechanism
## Client
[resource](https://www.apollographql.com/blog/graphql-file-uploads-with-react-hooks-typescript-amazon-s3-tutorial-ef39d21066a2/)
Install [apollo-upload-client](https://github.com/jaydenseric/apollo-upload-client)
````
npm install apollo-upload-client
````
Import createUpl... |
C# | UTF-8 | 673 | 2.578125 | 3 | [] | no_license | using Microsoft.Bot.Connector;
using System.Collections.Generic;
namespace MovieSeeker.Util
{
public static class MovieSeekerUtilities
{
public static Attachment GetHeroCard(string title, string subtitle, string text, CardImage cardImage, CardAction cardAction)
{
var heroCard = new... |
Markdown | UTF-8 | 495 | 2.515625 | 3 | [
"MIT"
] | permissive | # react-table-mui
A npm package that implements react-table-plain for Material-UI.
<!--

 -->
## Usage
```javascript
import { TablePlain } ... |
Java | UTF-8 | 312 | 1.734375 | 2 | [] | no_license | package com.liuqi.business.model;
import lombok.Data;
import java.io.Serializable;
@Data
public class RoleMenuRel implements Serializable {
/**
* 编号
*/
private Long id;
/**
* 角色id
*/
private Long roleId;
/**
* 菜单id
*/
private Long menuId;
}
|
JavaScript | UTF-8 | 1,934 | 2.875 | 3 | [
"MIT"
] | permissive | $("#login_button").click(function(){
var username = $("#input_username").val().trim();
var password = $("#input_password").val().trim();
if (validate(username,password)) {
$.post("controller/login_controller.php",{username:username,password:password},function(data){
if (data =="true") {
window.location.href... |
PHP | UTF-8 | 2,097 | 2.625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
/**
* MIT License. This file is part of the Propel package.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Propel\Runtime\DataFetcher;
use Propel\Runtime\Map\TableMap;
/**
* Class ArrayDataFetcher
*
* @package Pr... |
Java | UTF-8 | 1,667 | 2.4375 | 2 | [] | no_license | package com.riksof.a320.sample;
import java.util.List;
import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.riksof.a320.remote.RemoteAdapter;
import com.riksof.a320.remote.image.ImageLoader;
public class Sam... |
Markdown | UTF-8 | 2,516 | 2.53125 | 3 | [
"MIT",
"LicenseRef-scancode-ms-net-library-2018-11"
] | permissive | # System
``` diff
namespace System {
public class ArgumentException : SystemException {
+ public static void ThrowIfNullOrWhiteSpace([NotNullAttribute] string argument, [CallerArgumentExpressionAttribute("argument")] string paramName = null);
}
public static class GC {
+ [RequiresPreviewF... |
Python | UTF-8 | 1,551 | 3.796875 | 4 | [] | no_license | #create a dictionary with key 'rollno' and add list of rollnos, similarly and add "name" key and add 5 names in that key
dict={"rollno":[1,2,3,4],"name":["ande","Shirsak","a","b"]}
roll=dict["rollno"]
nam=dict["name"]
data=int(input("enter your rollno"))
temp=0
for i in range(len(roll)):
if roll[i]==data... |
Markdown | UTF-8 | 656 | 2.59375 | 3 | [] | no_license | ## Takeoff Variations
* Crosswind Takeoff
* Full upwind aileron to prevent the wind from tipping you.
* Use the rudder to keep you pointed straight.
* Keep the airplane on the runway to a higher speed before liftoff.
## Landing Variations
* Crosswind Landing
* 10 degrees of flaps on legs
* 20 deg... |
Java | UTF-8 | 2,951 | 2.703125 | 3 | [] | no_license | package thesis.timetable_generation;
import java.io.Serializable;
import java.util.HashMap;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ListMultimap;
/*
* This class holds two structures for the exam index and the exam id and two
* structures which hold the same d... |
JavaScript | UTF-8 | 1,294 | 3.109375 | 3 | [] | no_license | let i = 0;
let form = document.querySelector('form');
window.addEventListener('DOMContentLoaded', (e) => {
let speedSet = document.querySelector('#speed').value;
document.querySelector('#r').innerHTML = speedSet;
document.getElementById('cursor').style.animation = `flip ${3 * speedSet}ms linear infinite`;
... |
Java | UTF-8 | 3,757 | 2.0625 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright (C)2016 - SMBJ Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or... |
TypeScript | UTF-8 | 2,804 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | /* Copyright(c) 2018 Philip Mulcahy. */
// Thanks to Simon Sturmer: sstur/dom-to-json.js
'use strict';
export interface IJsonObject {
[index: string]: any
}
export function toJSON(
node: any,
include_attribs?: Set<string>,
exclude_elem_types?: Set<string>
): IJsonObject|null {
// @ts-ignore: this ... |
Java | UTF-8 | 1,200 | 2.078125 | 2 | [] | no_license | package com.mlc.autohaus.configuration;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.Serializatio... |
TypeScript | UTF-8 | 1,609 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | import request from "supertest";
import app from "../src/app";
import { User } from "../src/models/User";
const testProfile = {
id: "myfaketestuser",
displayName: "My Fake Test User"
};
const testAccessToken = "1jnjn3i54jn3i45jn3i4j5n3ij45n3i4j5";
const testRefreshToken = "2ni353ni45n3i4jn53ij45n3i45n3i4u5";
desc... |
C++ | UHC | 885 | 2.96875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
template<typename T>
struct Greater
{
bool operator()(const T&left,const T&right)const
{
return left>right;
}
};
int main()
{
vector<int> v1;
v1.push_back(80);
v1.push_back(60);
v1.push_back(50);
v1.push_back(30);
v1.push_back(10);
vector<int> v2;
v2.push_ba... |
Ruby | UTF-8 | 448 | 4.09375 | 4 | [
"Apache-2.0"
] | permissive | =begin
Start from the leftmost element of arr[] and one by one compare x with each element of arr[]
If x matches with an element, return the index.
If x doesn’t match with any of elements, return -1.
=end
def linear_search(arr, x)
arr_size = arr.size
for i in (0..(arr_size-1))
if arr[i] == x
... |
Java | UTF-8 | 2,596 | 3.75 | 4 | [] | no_license | package peter;
import java.util.Stack;
/**
* Write a program to solve a Sudoku puzzle by filling the empty cells.
*
* Empty cells are indicated by the character '.'.
*
* You may assume that there will be only one unique solution.
*
* @author peter Mar 16, 2015
*
*/
public class _037_Sudoku_Solver {
pub... |
JavaScript | UTF-8 | 3,687 | 2.578125 | 3 | [] | no_license | import * as homeUtil from "../utils/homeUtil";
// for home reducer
export const getHomes = homes => {
return {
type: homeUtil.GET_HOMES,
homes
};
};
export const getHomesSearch = (homes, searchStr) => {
return {
type: homeUtil.GET_HOMES_SEARCH,
homes,
searchStr
};
};
export const getHomes... |
C# | UTF-8 | 660 | 2.640625 | 3 | [] | no_license | using Burinbot.Base;
using Discord.Commands;
using System;
using System.Threading.Tasks;
namespace Burinbot.Modules
{
public class Ping : BaseDiscordCommand
{
[Command("oinc")]
[Alias("ping")]
[Summary("Returns Burinbot's latency relative to the Discord API's heartbeat!")]
publ... |
Java | UTF-8 | 1,807 | 3.890625 | 4 | [] | no_license | /**
* Tema 6, ejercicio 21
*
* Realiza un programa que genere una secuencia de cinco monedas de curso
* legal lanzadas al aire. Las monedas disponibles son de 1 céntimo, 2 céntimos,
* 5 céntimos, 10 céntimos, 20 céntimos, 50 céntimos, 1 euro y 2 euros. Las dos
* posiciones posibles son cara y cruz.
*
* Ejempl... |
Java | UTF-8 | 2,887 | 2.15625 | 2 | [] | no_license | package com.TestBase;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
//import java.util.TestUtil;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openq... |
C# | UTF-8 | 1,227 | 2.578125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ATM
{
class sendsms
{
public static bool SendSMS(string num, string msg)
{
try
{
string userName = "amisvora";
... |
C | UTF-8 | 29,743 | 3.171875 | 3 | [
"MIT"
] | permissive | /*
* leblanc.c
*
* Created on: Nov 9, 2016
* Author: michael
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <time.h>
#define toc(x) ((double)(clock() - (x))/CLOCKS_PER_SEC)
// Node
typedef struct {
int nid;
double lon;
double lat;
} Node;
... |
Python | UTF-8 | 919 | 2.71875 | 3 | [] | no_license | import scrapy
from douban.items import DoubanItem
class Douban250Spider(scrapy.Spider):
name = 'douban250'
allowed_domains = ['douban.com']
start_urls = ['https://movie.douban.com/top250']
def parse(self, response):
data_list = response.xpath('//*[@class="info"]')
for data in data_list... |
Markdown | UTF-8 | 648 | 3.53125 | 4 | [] | no_license | ### activité 6.1
Écrivez un programme Python qui permettra de créer un dictionnaire avec les couples clé/valeur suivants :
- nom => Doe
- prenom => John
- age => 42
### activité 6.2
Soit les données suivantes :
|nom|prenom|age|
|--- |--- |--- |
|John|Doe|42|
|Pierre|Martin|23|
|Christine|Dune|27|
|Marie|Tellaz|12|... |
Rust | UTF-8 | 5,927 | 2.953125 | 3 | [
"MIT"
] | permissive | use std::fs::File;
use std::io::{Write, BufWriter};
use std::fmt::format;
use std::ops::Mul;
use std::cell::Cell;
use ndarray::{Array, ArrayBase, ArrayD, Ix, IxDyn, Dim, LinalgScalar, NdFloat};
use rand::{thread_rng, Rng};
use rand::rngs::StdRng;
use rand::distributions::{Distribution, Uniform};
#[derive(Debug, Clone... |
Java | UTF-8 | 3,015 | 3.53125 | 4 | [] | no_license | package T20200127;
import java.util.ArrayList;
import java.util.List;
/**
* error
* @Author: hyy
* @Date: 2020-01-27 19:06
*
* 1751. 牛郎织女
* cat-only-iconCAT 专属题目
*
* 又到了七夕节,牛郎织女相约一起去一个n*m大小的迷宫maze里玩耍。然而没过多久,他们就倒霉地走散了。现在给定由.,*,S,T组成的矩阵maze,
* 其中.表示空地,*表示障碍物,S表示牛郎的位置 ,T表示织女的位置,牛郎和织女都会试图寻找对方,不停地在矩阵中走动(他们可以每次向上下... |
Java | UTF-8 | 1,339 | 3 | 3 | [] | no_license | package com.kuter.bcw;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.math.MathUtils;
// Hiçbir yere ait olmayan bağzı utility fonksiyonları
public class Utils {
// http://stackoverflow.com/questions/34441749/how-to-specify-a-color-with-hue-saturation-and-brightness-in-libgdx
public static Color... |
Java | UTF-8 | 195 | 2.34375 | 2 | [
"MIT"
] | permissive | interface Kata {
static String findScreenHeight(int width, String ratio) {
return width + "x" + width * Integer.parseInt(ratio.split(":")[1]) / Integer.parseInt(ratio.split(":")[0]);
}
}
|
Python | UTF-8 | 2,327 | 3.3125 | 3 | [] | no_license | import numpy as np
import time
from multiprocessing import Pool
class MonteCarlo:
def __init__(self, AI_color, move_iter = 1, n_jobs=1):
self.AI_color = AI_color
self.engine = None
self.move_iter = move_iter
self.n_jobs = n_jobs
# Play current single move
# Return 1 if AI w... |
Java | UTF-8 | 1,427 | 2.859375 | 3 | [
"MIT"
] | permissive | package com.mps.dsp.config;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import com.mps.dsp.util.Logger;
/**
* File Writer to configure nodelist.txt file. It build
* nodelist.txt file as per the given set of template.
* The template is organized as :
... |
Markdown | UTF-8 | 384 | 2.609375 | 3 | [] | no_license | # Simplified Koa
This repo contains a simplified version of [koa-v1](https://github.com/koajs/koa/tree/v1.x) in 20-30 lines. It is not supposed to be used on other projects and only aims at explaining how Koa works.
## Installation:
**Node version 4.8 or above is required**
Install dependencies: `yarn`
Run the ser... |
Python | UTF-8 | 1,169 | 3.4375 | 3 | [] | no_license | # coding=utf-8
"""
@version: 2018/1/1
@author: Suen
@contact: sunzh95@hotmail.com
@file: Pearson_Correlation_desc
@time: 20:59
@note: ??
"""
import numpy as np
import math
def compute_correlation(x, y):
"""相关系数"""
x_bar = np.mean(x)
y_bar = np.mean(y)
SSR = 0
var_x = 0
var_y = 0
for i in... |
Java | UTF-8 | 2,619 | 1.773438 | 2 | [] | no_license | /**
* Obfuscator: Binsecure Decompiler: FernFlower
* De-obfuscated by Gopro336
*/
package dev.nuker.pyro.launcher;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.Map;
import javax.swing.JButton;
import javax.swing.JComboBox;
import kotlin.Metadata;
import kotlin.jvm.functions... |
Shell | UTF-8 | 3,289 | 3.4375 | 3 | [] | no_license | #!/bin/sh
# Another big fat ugly hack ...
# Rationale: we don't want to change too much on Gluons core files,
# but we need to replace some for practical reasons. Thus we clone
# the original, stash them in the firmware as -ffgt versions and
# on first boot replace the Gluon ones with their FFGT counterparts.
# Yes, wh... |
C++ | UTF-8 | 1,030 | 2.890625 | 3 | [] | no_license | /*
If you think you are beaten, you are.
If you think you dare not, you don't!
If you like to win, but think you can't,
It's almost a cinch you won't.
you think you'll lose, you're lost;
For out in the world we find
Success begins with a fellow's will;
It's all in the state of mind.
If you think you are outclassed, you... |
C++ | UTF-8 | 1,262 | 2.734375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#define maxn 10010
int main(int argc, char *argv[]) {
int n, k;
std::cin >> n >> k;
int two = 2 * n, four = n;
int a[maxn];
for(int i = 0; i < k; i++) {
std::cin >> a[i];
while(a[i] >= 4 && four > 0) {
a[i] -= 4;
four--;
}
}
for(int i = 0; i < k; i++) {
... |
Markdown | UTF-8 | 3,681 | 3.234375 | 3 | [
"Apache-2.0"
] | permissive | ---
layout: post
title: 读书要多写卡片,少画思维导图
date: 2018-06-06
categories: blog
tags: [读书,卡片]
description: 读书是一项「对重要内容进行提炼的工序」。
---
如果让你看回多年前亲手画的读书思维导图,你还能还原出当时的记忆与感想吗?
下图是我 2014 年的读书思维导图。
[](https://imgchr.com/i/Dzdw7T)
[;
const c = canvas.getContext('2d');
canvas.width = window.innerWidth -50;
canvas.height = window.innerHeight - 50;
let spawnRate = 2000;
let segDim = 25;
let speed = 2;
let speedY = speed;
let speedX = 0;
let growthRate = 50;
let snake = Array(0);
let edib... |
C# | UTF-8 | 904 | 3 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | namespace Hebron.Runtime
{
internal class ArrayBuffer2D<T>
{
public T[] Array { get; private set; }
public int Capacity1 { get; private set; }
public int Capacity2 { get; private set; }
public T this[int index1, int index2]
{
get => Array[index1 * Capacity2 + index2];
set => Array[index1 * Capacit... |
Python | UTF-8 | 513 | 2.671875 | 3 | [] | no_license | i1=lambda : input()
i2=lambda : int(input())
i3=lambda : map(int,input().split())
i4=lambda n : [list(map(int,input().split()) for _ in range(n))]
N,M=i3()
INF=float('infinity')
C=[[INF]*(N+1) for _ in range(N+1)]
for i in range(0,M):
s,t,c=i3()
C[s][t]=c
for i in range(0,N+1):
C[i][i]=0
ans=0
for k in ... |
Go | UTF-8 | 443 | 2.875 | 3 | [] | no_license | package dcp040
import (
"fmt"
"testing"
)
func TestFindNonDuplicate(t *testing.T) {
var tests = []struct {
a []int
n int
}{
{[]int{7}, 7},
{[]int{6, 1, 3, 3, 3, 6, 6}, 1},
{[]int{5, 4, 3, 2, 5, 4, 3, 5, 4, 3}, 2},
}
for _, tt := range tests {
t.Run(fmt.Sprintf("%+v", tt.a), func(t *testing.T) {
n... |
Ruby | UTF-8 | 1,125 | 3.46875 | 3 | [] | no_license | require 'colorize'
class Board
attr_reader :length, :grid, :rows, :columns
def initialize(length)
@length = validate_length(length)
@grid = blank_grid(@length)
@rows = @grid.keys[1..@length]
@columns = @grid["*"]
end
def validate_length(length)
if length.is_a? Fixnum
@length = ... |
TypeScript | UTF-8 | 2,358 | 2.78125 | 3 | [] | no_license | import { Injectable } from '@angular/core';
import StorageNames from '../StorageNames';
export enum ThemeType {
Dark = 'theme_dark',
Light = 'theme_light',
Default = 'theme_default',
}
@Injectable({
providedIn: 'root',
})
export default class ThemeService {
private theme: ThemeType = ThemeType.Default;
pr... |
Python | UTF-8 | 4,340 | 2.796875 | 3 | [
"MIT"
] | permissive | """Subject Model"""
import random
import hashlib
from datetime import datetime
from sqlalchemy import desc
from flask_bcrypt import generate_password_hash, check_password_hash
from har import db
class Subject(db.Model):
"""Schema for Subject model."""
device = db.Column(db.String(40), primary_key=True)
t... |
PHP | UTF-8 | 794 | 3.46875 | 3 | [] | no_license | <?php
class Genome
{
public $type;
public $length;
public $fitness;
public $chromo = [];
function __construct($args = array())
{
$this->type = $args['type'];
$this->length = $args['length'];
}
public function initialize()
{
$this->fitness = (float) $this->randFit();
$this->chromo = $this->randCh... |
Java | UTF-8 | 7,573 | 2.015625 | 2 | [] | no_license | package com.diandiallo.meteo.fragment;
import android.app.ActionBar;
import android.app.ProgressDialog;
import android.app.SearchManager;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.No... |
Java | UTF-8 | 770 | 2.234375 | 2 | [] | no_license | package com.database.bpo.service.impl;
import com.database.bpo.dao.UserEmployerDao;
import com.database.bpo.pojo.entity.User;
import com.database.bpo.pojo.entity.UserEmployer;
import com.database.bpo.service.UserEmployerService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Servic... |
C# | UTF-8 | 1,184 | 2.53125 | 3 | [
"MIT"
] | permissive | using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using reboot_server.Models;
using reboot_server.Data.Abstraction;
namespace reboot_server.Controllers
{
public class HomeController : Controller
{
public HomeController(IRepos... |
Markdown | UTF-8 | 38,866 | 3.203125 | 3 | [] | no_license | # 病論篇第七十三【詳解】
**黃帝問曰:天元九窒,餘已知之,願聞氣交,何名失守?******
**岐伯曰:謂其上下升降,遷正退位,各有經論,上下各有不前,故名失守也。是故氣交失易位,氣交乃變,變易非常,即四失序,萬化不安,變民病也。******
****
**【詳解】**
**黃帝說:關於天元之氣窒抑的情況,我已經知道了,還想聽聽氣交變化,怎樣叫失守呢?**
**岐伯說:說的是司天在泉的遷正退位與左右間氣升降的問題,司天在泉的遷正退位,各有經文論述之,左右間氣各有升降不前的反常現象,所以叫做失守。由於氣交失守,不能移易其時位,氣交就要發生非常的變化,也就是四時節令失去正常的秩序,萬物生化不得平安,人類就要發生疾病。**
****... |
Python | UTF-8 | 1,002 | 2.9375 | 3 | [
"MIT"
] | permissive | import sys
sys.path.append("../../")
from examples.ortools.cvrp import CVRP
class Drop(CVRP):
"""
Stores the data from ortools CVRP example with penalties ;
https://developers.google.com/optimization/routing/penalties
Some vertices can be dropped, activating a penalty.
"""
def __init__(self)... |
Python | UTF-8 | 974 | 2.984375 | 3 | [
"MIT"
] | permissive | class ClassContext:
def __init__(self, class_name):
self._class_name = class_name
# The class meta type as defined by the schema
self._class_type = None
self._base_classes = []
self._constructor_parameters = []
self._data_members = []
@property
def class_name... |
Java | UTF-8 | 135 | 1.96875 | 2 | [] | no_license | package com.ytel.example.otp;
public class OtpRequest {
public String to;
public OtpRequest(String to) {
this.to = to;
}
}
|
Markdown | UTF-8 | 748 | 3.21875 | 3 | [] | no_license | # 1.编写代码,尽可能好的实现中文数字串到阿拉伯数字串的转换,以下是一些程度不同的转换示例,从要求2开始给出设计文档:
## 1) 一三九->139, 一零零八六->10086(基础)
## 2) 一百三十九->139, 一万零八十六->10086(基础)
## 3) 十三点九->13.9, 一千零八点六->1008.6
## 4)同时支持壹、贰、肆、伍、陆、柒...拾、佰、仟(扩展)
# 2.设计类Date,表示基本的年月日信息,不能用内置模块和第三方模块实现,完成以下功能:
## 1)生成指定日期的对象
## 2)计算对象前一天和后一天的日期
## 3)比较两个日期的大小
## 4)计算指定日期之后第N天的日期,N可能为任意... |
Shell | UTF-8 | 1,377 | 3.625 | 4 | [
"Apache-2.0"
] | permissive | #!bash
# set -x
trap "exit" SIGINT
EXPERIMENT="index comparison"
DIR_DATA="data"
DIR_RESULTS="results"
FILE_RESULTS="${DIR_RESULTS}/index_comparison.csv"
BIN="build/bin/index_comparison"
# Set number of repetitions and samples
N_REPS="3"
N_SAMPLES="20000000"
PARAMS="--n_reps ${N_REPS} --n_samples ${N_SAMPLES}"
# S... |
Python | UTF-8 | 1,982 | 2.75 | 3 | [] | no_license | import unittest
from findingExitFromMaze import FindingExitFromMaze
class findingExitFromMazeTest(unittest.TestCase):
def setUp(self):
self.findingExit = FindingExitFromMaze()
def test_dfsAdjMatrix(self):
n = m = 4
edges = [[1, 2], [3, 2], [4, 3], [1, 4]]
self.assertEqual(self.... |
JavaScript | UTF-8 | 2,429 | 3.703125 | 4 | [] | no_license | // Benchmark is a library that times
var Benchmark = require("benchmark");
var generate = require("../shared/generate");
// Generate an array of the given length.
var length = 100000;
var stuff = generate(length);
var randomValue = stuff[Math.ceil(Math.random() * length)];
// const stuff = [10, 34, 56, 67, 93, 120,... |
Java | UTF-8 | 686 | 1.914063 | 2 | [] | no_license | package uk.co.agilesoftware;
import com.github.tomakehurst.wiremock.WireMockServer;
import com.github.tomakehurst.wiremock.client.WireMock;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
public class WiremockTest {
private static WireMockSer... |
JavaScript | UTF-8 | 3,047 | 2.765625 | 3 | [] | no_license | 'use strict'
function onInit() {
renderBooks();
}
function renderBooks() {
var books = getBooks();
var strHTML = books.map(book =>
`<tr><th class="align-middle">${book.id}</td>
<td class="align-middle" scope="row">${book.name}</td>
<td class="align-middle">${book.price}</td>
... |
Python | UTF-8 | 5,359 | 3.25 | 3 | [
"MIT"
] | permissive | import sys
import pygame
from settings import Settings
from ship import Ship
from bullet import Bullet
from alien import Alien
class AlienGame:
""" Overall class to manage game assets and state"""
def __init__(self):
"""Initialize the game and create game resources."""
pygame.init()
... |
C# | UTF-8 | 577 | 3.203125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Tools
{
public static class Helpers
{
/// <summary>
/// returns a string made up of the current hour, minute, second and mllisecond
/// </summary>
/// ... |
Markdown | UTF-8 | 1,092 | 2.890625 | 3 | [] | no_license | # README #
This is a demonstration Docker container with go. Try it on Google Cloud by clicking below:
[](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/devries/hellogo.git&page=editor&open_in_editor=README.md)
### T... |
Java | UTF-8 | 726 | 2.359375 | 2 | [] | no_license | package com.example.springbootjpa.service;
import com.example.springbootjpa.entity.Book;
import com.example.springbootjpa.entity.User;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.List;
public interface BookService {
Book save(Book... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.