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 |
|---|---|---|---|---|---|---|---|
Markdown | UTF-8 | 1,859 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | # ml optic
This is a Jupyter Magic to run Optic statements against a MarkLogic endpoint.
### Installation
1. Download the code and run pip -install . from the directory
2. Start Jupyter and create a notebook.
3. Run %load_ext ml_optic. The notebook should reply:
marklogic optic magic loaded.
4. You can use %%ml_op... |
PHP | UTF-8 | 3,196 | 2.75 | 3 | [] | no_license | <?php
require_once("php_include/basic_includes.php");
require_once("php_include/db_user.php");
echo "<title>Login</title>";
if (isset($_GET["source"]) && $_GET["source"] == "cart") {
echo "Bitte loggen Sie sich ein um den Warenkorb zu nutzen!<br>";
}
if (isset($_GET["newuser"])) {
echo "Vielen Dank für die Re... |
Markdown | UTF-8 | 1,963 | 3.5 | 4 | [
"MIT"
] | permissive | # Computing-Eigenvalues-and-Eigenvectors-using-Normalized-Power-Iteration-together-with-Deflation
In this project, I implemented the normalized power iteration algorithm together with deflation to find two eigenvalues and corresponding eigenvector for the dominant eigenvalue of a given matrix A, where A is a square mat... |
PHP | UTF-8 | 2,437 | 2.765625 | 3 | [] | no_license | <?php
namespace App\Library;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Support\Facades\Log;
/**
* Class GuzzleLibrary
* @package App\Library
*
* @author joven <joven@cafe24corp.com>,
* @version 1.0
* @date 12/3/2020 4:24 PM
*/
class GuzzleLibrary
{
/**
* [URL] En... |
C++ | UTF-8 | 529 | 2.671875 | 3 | [] | no_license | #include <stdio.h>
#include <iostream>
#include <uuid/uuid.h>
int main()
{
uuid_t uu;
int i;
uuid_generate(uu);
for(i=0; i<16; i++) {
printf("%02X-",uu[i]);
}
printf("\n");
char buf[33];
uuid_generate(uu);
snprintf(buf,33,"%02X",uu[0]);
snprintf(buf,33, "%02X%02X%02X%02X%02X%02X%02X%02X%02X%0... |
Markdown | UTF-8 | 4,761 | 3.1875 | 3 | [
"MIT"
] | permissive | # Paso 6: Crear la primer componente de React
[Volver al paso 5](/es/step5_add_django_webpack_loader)
## Conceptos de React que vamos a usar en este paso
Si nunca has visto estos conceptos, puedes tomarse tu tiempo y leer sobre ellos accediendo a los enlaces.
Usaremos:
- Componentes de presentación y contenedores: [p... |
JavaScript | UTF-8 | 1,054 | 2.84375 | 3 | [] | no_license | angular.module('WebMIDI').service('Command', function () {
const minNote = 0;
const maxNote = 127;
var baseNotes = ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B'];
var notes = {}; // 60 = middle C (C3)
this.getNote = getNote;
this.getNumber = getNumber;
function init() {
... |
Python | UTF-8 | 91 | 2.8125 | 3 | [] | no_license | def print_sorry():
for i in range(1,101):
print("I am sorry! \n")
print_sorry() |
Java | UTF-8 | 709 | 2.609375 | 3 | [] | no_license | /*
* Classname: FileSystemUtils.java
* Author: Héctor Hernández Chávez
* Date: 12-ago-2019
*/
package javaee.examples.cdi.events.reactive;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
/**
* @author Héctor Her... |
Python | UTF-8 | 3,284 | 2.90625 | 3 | [] | no_license | def segment(data: str, slice_size: int):
encoded = data.encode()
packet_list = []
slices = [encoded[i * slice_size:i * slice_size + slice_size] for i in range(len(encoded) // slice_size + 1)]
i = 0
for slice in slices:
syn = 0
fin = 0
if i == 0:
syn = 1
... |
C++ | UTF-8 | 7,780 | 2.59375 | 3 | [] | no_license | #include <assign2.h>
void error(const char *msg)
{
perror(msg);
exit(1);
}
string get_time(){
time_t t = time(0); // get time now
tm* now = localtime(&t);
string ts =
to_string(now->tm_mday) + "-"
+ to_string((now->tm_mon + 1))+ "-"
+ to_string((now... |
Python | UTF-8 | 819 | 2.75 | 3 | [] | no_license | from santas_little_helpers import day, get_data, timed
from knot_hash import arr_size, hex_representation, to_ascii
today = day(2017, 10)
def hash_data(lengths: [int], repeat: int = 1) -> [int]:
l = list(range(arr_size))
idx = 0
skip = 0
for _ in range(repeat):
for n in lengths:
l = l[idx % arr_size... |
Python | UTF-8 | 5,662 | 3.078125 | 3 | [
"MIT"
] | permissive | import random
from games.abstract_ruleset import Ruleset
import numpy as np
from games.simple_ramsch.state import RamschState
from utils import one_hot_to_int
from numba import jit
dealing_pattern = np.array([0, 0, 0, 1, 1, 1, 2, 2, 2,
3, 3,
0, 0, 0, 0, 1, 1, 1... |
Java | UTF-8 | 2,235 | 2.3125 | 2 | [] | no_license | package fex.signs.util;
import java.sql.Date;
import java.util.Calendar;
//import java.util.HashSet;
//import java.util.Set;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
public class Util {
public static boolean isSign(Material m){
return m... |
JavaScript | UTF-8 | 1,854 | 2.8125 | 3 | [] | no_license | import React from 'react';
import uuid from 'uuid/v4';
import Form from './Form';
import Todo from './Todo';
import '../styles/Todolist.css';
class Todolist extends React.Component {
constructor(props) {
super(props);
this.state = {
todos: []
}
this.addTodo = this.addTodo.bind(this);
t... |
C | UTF-8 | 190 | 2.625 | 3 | [] | no_license | Rows and columns{
int i, j, r ,c;
printf("enter number of Rows and columsn");
scanf_s("%d%d", &r,&c);
for (i=0;i<r;i++)
{
for (j = 0; j<c; j++)
printf("*");
printf("\n");
}
}
|
JavaScript | UTF-8 | 2,058 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | const assert=require('assert');
const fs=require('fs');
const http=require('http');
const concat=require('concat-stream');
const crypto=require('crypto');
const arg1=process.argv[2];
function getData() {
const username = 'psf.ginfo';
const password = 'xisto917';
const options = {
host: 'wwwapp.si... |
Python | UTF-8 | 10,102 | 3.03125 | 3 | [] | no_license | __author__ = 'Roderik'
import pygame
import colorsys
from math import *
class LinearLayout:
HORIZONTAL = 1
VERTICAL = 2
def __init__(self,
layout_type=None,
gravity=None,
padding=0,
padding_left=None,
padding_right=None... |
JavaScript | UTF-8 | 2,260 | 2.890625 | 3 | [] | no_license | function consultaUsuario(){
//pegando valor com jquery do form
var cpf = $("#cpf").val();
var formData = {
'cpf' : cpf
};
$.ajax({
type : 'POST',
url : '/CadastroUsuario/ConsultarUsuario',
contentType : 'application/json',
data : JSON.stringify(formData),
dataTy... |
Markdown | UTF-8 | 508 | 2.90625 | 3 | [] | no_license | # Project Euler Solutions
This is a repo where I store my Python solutions to problems on
<https://projecteuler.net>.
I recently noticed that the Project Euler website says
users are not supposed to share answers on public repos. But since
I am using this repo mostly for keeping track of my own progress, I
would ... |
C# | UTF-8 | 550 | 2.53125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace VisualScript.Commads
{
public class CaseCommand : Stmt
{
private Stmt command;
private Expr expression;
public CaseCommand(Expr expression, Stmt command)
{
this.command = command;
this.expression = express... |
Java | UTF-8 | 1,668 | 2.625 | 3 | [] | no_license | package edu.nitin.testng.pull459;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import java.util.Arrays;
/**
* Created on 12/29/15.
*
* @author <a href="mailto:nitin.matrix@gmail.com">Nitin Verma</a>
*/
public class VarArgsDataProviderTest {
@DataProv... |
Markdown | UTF-8 | 2,596 | 3.546875 | 4 | [
"MIT"
] | permissive | select方法是用的最广泛、同时也是最复杂的查询条件
### 使用方法
在所有sql链式调用方法之后 调用 `.select()` 即为查询
> 所有语法采用链式调用方式
> 默认用 * 查询所有字段,可以使用 .field 方法精确字段查询
> union方法优先级最高,如果查询中有次方法,则其他查询字段无效
> 同时存在 limt 和 page 方法时,page方法将优先于limit方法
> sql的查询方式有很多,尽可能按照正确的sql语句语法查询
> 对所有的方法没有固定的顺序,内部会自动排序
### 简单用法
```js
sql
.table('node_tabl... |
C# | UTF-8 | 864 | 3.109375 | 3 | [] | no_license | public class WaitableWorker
{
private readonly System.Threading.Timer timer;
public WaitableWorker(int interval, Action callback, bool blocking = false)
{
if (blocking)
{
Thread.Sleep(interval);
callb... |
C# | UTF-8 | 7,743 | 2.625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Entidades;
using System.Data.Entity.Validation;
namespace Repositorio
{
public class CocineroRepositorio
{
public ComentariosRepositorio comenRepo = new ComentariosRepositorio();
PW3_TP_20161CEnti... |
JavaScript | UTF-8 | 1,672 | 2.984375 | 3 | [] | no_license | import Board from "./Board";
import { Pawn, Bishop, Rook, Queen, King, Knight } from "./Piece";
import Square from "./Square";
import Color from "./Color";
export default class Game {
constructor() {
this.board = new Board();
let pieces = [
new Knight(this.board, new Square(1, ... |
Python | UTF-8 | 1,592 | 3.078125 | 3 | [] | no_license | from selenium import webdriver
import datetime
user_names=[]
def attack():
driver = webdriver.Chrome("C:\\Users\\Downloads\\chromedriver.exe")
driver.get("https://web.whatsapp.com/")
for att in range(0,len(user_names)):
user = driver.find_element_by_xpath('//span[@title = "{}"]'.format(use... |
C++ | UTF-8 | 6,381 | 2.921875 | 3 | [] | no_license | #include <string>
#include <iostream>
#include <iomanip>
#include <sstream>
#include "Contact.h"
//#include "Date.h"
void Contact::setGender(string gender) {
_gender = gender;
}
string Contact::getGender() {
return _gender;
}
void Contact::setTitle(string title) {
_title = title;
}
string Contact::getTitle() {
re... |
Java | UTF-8 | 377 | 1.695313 | 2 | [] | no_license | package io.github.binglau;
/**
* 类Config.java的实现描述:TODO:类实现描述
*
* @author bingjian.lbj 2016-04-30 下午6:42
*/
public class Config {
final static String KAFKA_ADDRESS = "192.168.33.10:9092";
final static String TOPIC = "demo-test";
final static String ZK_CONNECT = "192.168.33.10:2181";
final static S... |
Markdown | UTF-8 | 10,532 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive | <p align="center">
<img src="./img/borgia-logo-light.png" />
</p>
# Documentation - Gestion d'un magasin
## Application
Build : [4.5.0 + ](https://github.com/borgia-app/Borgia/releases/tag/4.5.0)
Licence : [GNU GPL version 3](./license.txt)
# Introduction
Ce guide a pour objectif d'expliquer le fonctionnement ... |
PHP | UTF-8 | 2,090 | 2.625 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace app\modules\work\models;
use Yii;
/**
* This is the model class for table "work_progress".
*
* @property integer $id
* @property integer $work_id
* @property double $exp
* @property integer $phy
* @property integer $fin
*/
class WorkProgress extends \yii\db\ActiveRecord
{
/**
* @inher... |
Markdown | UTF-8 | 2,774 | 2.546875 | 3 | [] | no_license | ---
authors:
- Raphael Brugier
tags:
- AWS
date: 2018-11-28T23:20:07.000Z
title: "AWS re:Invent 2018 - Day 1"
image: https://raw.githubusercontent.com/ippontech/blog-usa/master/images/2018/11/reinvent2.jpeg
---
Hi everyone,
AWS re:Invent is huge! And each day has a lot of new announcements. Here are our favorites:
#... |
JavaScript | UTF-8 | 2,218 | 3.0625 | 3 | [] | no_license | function FormValidatorClass(config) {
//sample config file
//normally states added to an elemnt initially is:
//state= {touched: false, filled: false, valid: false}
//this state is added to data attribute of all elements in the given form
/*
config = {
name: "my-form",
namespaces: [n1, n2], //namesp... |
Python | UTF-8 | 379 | 2.640625 | 3 | [] | no_license | def sign():
from Crypto.Hash import SHA256
from Crypto.PublicKey import RSA
key = RSA.generate(2048)
public = key.publickey().exportKey('PEM').decode('ascii')
private = key.exportKey('PEM').decode('ascii')
text = 'abcdefgh'.encode('utf-8')
hash = SHA256.new(text).digest()
signature = ke... |
Python | UTF-8 | 371 | 3.484375 | 3 | [] | no_license | import random
try:
while True:
for i in range(21,30):
print(str(i) + " X " + str(i))
answer = int(input())
if(answer == (i*i)):
print("SUCCESS!!")
else:
print("FAIL!! correct answer: " + str(i*i))
except:
print("Irreleven... |
C++ | UTF-8 | 3,639 | 3 | 3 | [] | no_license | #include "Driver.h"
#include "Tracker/KilometersPassedTracker.h"
#include "Tracker/SatisfactionTracker.h"
/**
* Constructor.
* @param idNum id number.
* @param ageVal age of the driver.
* @param status marital status.
* @param years years of experience.
* @param cabID id number of the driver's cab.
* @return Dr... |
C | UTF-8 | 6,878 | 2.921875 | 3 | [] | no_license | // SRmisc_functions.c
#include "SRmisc_functions.h"
#include <util/delay.h>
#include <avr/interrupt.h>
#include <stdio.h> // for printf
#define kPa2PSI 0.14503774 // 1 kPa = 0.14503774 PSI (approx)
// Mean and Standard Deviation Module variables
uint16_t M_SD_target_num_samples;
uint16_t M_SD_num_s... |
Java | UTF-8 | 333 | 1.898438 | 2 | [] | no_license | package com.dj.cloud.service;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RestController;
@RestController
@Service
public class OrderServiceImpl implements OrderService{
@Override
public String sayOrder(String userName) {
return "hello Order,"+userName... |
C++ | UTF-8 | 17,622 | 2.53125 | 3 | [] | no_license | #include <graphics/Context.hpp>
#include <graphics/Renderer.hpp>
#include <graphics/TextureManager.hpp>
#include <utils/log.hpp>
#include <utils/split.hpp>
#include <utils/libgen.hpp>
#include <utils/to_string.hpp>
#include <algorithm>
#include <set>
#define check_gl_err() graphics::show_gl_err(__FILE__, __LINE__)
n... |
C++ | ISO-8859-1 | 683 | 2.609375 | 3 | [] | no_license | #include "Hide.h"
#include "components\MoveComponent.h"
#include "steering\ObstacleAvoidance.h"
Hide::Hide(CVector pos)
{
position = pos;
}
Hide::~Hide(void)
{
}
void Hide::apply(MoveComponent *self)
{
//Steuert so schnell wie mglich einen bestimmten Vektor an
CVector currentPosition = self->getPosition();
CVec... |
Rust | UTF-8 | 3,464 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | use super::structs::*;
use crate::config::Config;
use std::fmt;
use std::{collections::HashMap, error::Error, path::PathBuf};
mod fill_intermediate_entries;
use fill_intermediate_entries::fill_intermediate_entries;
mod fill_stems;
use fill_stems::fill_stems;
mod fill_containers;
use fill_containers::fill_containers;... |
Python | UTF-8 | 820 | 3.140625 | 3 | [] | no_license | import random
from gym_hnefatafl.envs import HnefataflEnv
class RandomAgent(object):
def __init__(self, player):
self.player = player
self.corners = [(1, 1), (1, 11), (11, 1), (11, 11)]
# chooses a random move and returns it
# in order for games to finish in a reasonable amount of time,
... |
Python | UTF-8 | 9,685 | 2.765625 | 3 | [] | no_license | import cv2
import numpy as np
import time
import math
import matplotlib.pyplot as plt
def to_show(images, titles):
length = len(images)
rows = 1
if length < 4:
columns = length
else:
rows = round(length / 2)
columns = 3
for i in range(len(images)):
plt.subplot(rows,... |
Python | UTF-8 | 1,395 | 2.71875 | 3 | [
"MIT"
] | permissive | from molsysmt._private.exceptions import ArgumentError
from molsysmt import pyunitwizard as puw
import numpy as np
functions_with_boolean = (
'molsysmt.basic.get.get',
'molsysmt.basic.compare.compare',
'molsysmt.basic.iterator.__init__',
'iterators.__init__',
)
def digest_tempe... |
Shell | UTF-8 | 1,592 | 3.671875 | 4 | [] | no_license | #!/bin/bash
#chkconfig: 345 70 31
#description: cmsweb_discovery This script runs CMS DBS Data Discovery service
if [ -z ${DDHOME} ]; then
echo $"The DDHOME environment is not set" 2>&1 1>& /dev/null < /dev/null &
. /data/projects/dbs/setup.sh
fi
cd ${DDHOME}
RETVAL=$?
port=`cat DBSDD.conf | grep -i "port=" | ... |
Markdown | UTF-8 | 1,677 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | # OBJETIVO: editar la información de la colección o sus cromos de manera sencilla
<!-- editar-coleccion.component.ts -->
Recibimos la coleccion al iniciar el componente.
Los parámetros de nombreColeccion y imagenColeccion los asociamos a los dos inputs que tenemos. Al principio serán iguales a al nombre y la imagen... |
Java | UTF-8 | 2,905 | 2.09375 | 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.professorjasse.bigsoft.sige.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*... |
Java | UTF-8 | 8,930 | 3.140625 | 3 | [] | no_license | import java.util.*;
import java.io.*;
public class USACO{
public static void main(String[] args){
// try every test case, catch if file is invalid
try{
System.out.println(bronze("testCases/makelake.1.in"));
System.out.println(bronze("testCases/makelake.2.in"));
System.out.println(bronze("te... |
Python | UTF-8 | 1,250 | 3.3125 | 3 | [] | no_license | #!/usr/bin/env python
#
# Luke Southam <luke@devthe.com>
# GCJ Problem A. Tic-Tac-Toe-Tomek
#
T = int(raw_input())
symbols = ["X","O",".","T"]
for test_i in xrange(T):
board = [[],[],[],[]]
unfinished = 0
for i in xrange(4):
line = raw_input()
for char in line:
if char == "."... |
C# | UTF-8 | 2,382 | 2.65625 | 3 | [] | no_license | using UnityEngine;
public class BulletController : MonoBehaviour
{
// THIS IS THE PLAYER'S PROJECTILE CONTROLLER.
public ParticleSystem particles0;
public ParticleSystem particles1;
public ParticleSystem particles2;
public float speed; // This is the speed at which the projectile travels.
... |
Markdown | UTF-8 | 6,523 | 2.78125 | 3 | [] | no_license | ---
author_image: cc-logo-96dpi.png
author: ContentConcepts
bio: Manuscript Editing Services at affordable prices
title: Predatory Journal - what is it and how to avoid them?
date: 2021-02-14T18:30:00.000Z
previewImage: predatory-journal.jpg
excerpt: "“Predatory journals (also called deceitful or scamming journals) are... |
C++ | UTF-8 | 2,283 | 3.8125 | 4 | [
"Apache-2.0"
] | permissive | #pragma once
#include <core/std.h>
// Ignores element constructors / destructors!
template <typename T>
class array_deque {
public:
array_deque() {}
array_deque(uint capacity) : m_data(capacity) {}
array_deque(const array_deque& o) {
m_data.resize(o.capacity());
m_start = 0;
m_s... |
Java | UTF-8 | 268 | 2.671875 | 3 | [] | no_license | package assign5;
public class Context {
private AverageInterface avg;
public Context (AverageInterface avgI){
this.avg = avgI;
}
public double findAvg () {
return avg.getAverage();
}
public void setAvg(AverageInterface avgI){
this.avg = avgI;
}
}
|
Markdown | UTF-8 | 16,923 | 3.03125 | 3 | [] | no_license | ---
published: true
organization_id: '2013126'
year_submitted: 2013
indicator: ' Health'
body_class: strawberry
project_id: '3102190'
title: >-
“Hey I’m Walking Here!”: A Campaign Celebrating Pedestrians in the City of Los
Angeles
project_summary: "\"The future of the city is walking. Redesigning our cities for wa... |
Java | UTF-8 | 9,065 | 2.046875 | 2 | [
"Apache-2.0"
] | permissive | package com.oval.app.activities;
import java.io.File;
import java.util.ArrayList;
import java.util.StringTokenizer;
import org.mitre.svmp.activities.AppRTCRefreshAppsActivity;
import org.mitre.svmp.activities.SvmpActivity;
import org.mitre.svmp.common.ConnectionInfo;
import org.mitre.svmp.services.SessionSer... |
TypeScript | UTF-8 | 10,462 | 2.8125 | 3 | [
"LicenseRef-scancode-free-unknown",
"MIT"
] | permissive | import { toQueryString } from "../../utils";
import { SdkClient } from "../common/sdk-client";
import { JobManagerModels } from "./jobmanager-models";
/**
* Offers execution mechanisms for running models stored in Model Management module.
* A schedule is created based on a model identifier and a cron expression so t... |
Markdown | UTF-8 | 4,543 | 2.953125 | 3 | [] | no_license | # Simple Java Sandbox
## Features
* Provide 2 http endpoints that accepts JSON base64 encoded binary data on both endpoints
`<host>/v1/diff/<ID>/left` and `<host>/v1/diff/<ID>/right`
* The provided data needs to be diff-ed and the results shall be available on a third end
point `<host>/v1/diff/<ID>`
* The results s... |
Markdown | UTF-8 | 6,277 | 3.609375 | 4 | [
"MIT"
] | permissive | ---
layout: post
title: Swift 简书- 函数
published: true
date: 2015-09-30 16:07
categories:
tags:
comments: true
description: 本来不想写这个,心想不就是函数吗?可是然并卵!Swift的函数太牛掰了!不过这个可能不太适合初学者。废话少叙,开始。
---
-------------------------
> "这些文章都是看苹果的官方《The Swift Programming Language (Swift 2)》,然后自己理解表达简化出来的,肯定有不确切的地方"
>[原文链接] [id]
[id]: ht... |
Python | UTF-8 | 3,130 | 3.921875 | 4 | [] | no_license | """
Реализовать класс LinkedListWithDriver от класса LinkedList.
Дочерний класс должен уметь работать с реализованными ранее драйверами.
1. Реализовать свойство driver, которое будет возвращать используемый драйвер и проверять, что устанавливаемый
драйвер является экземпляром класса IStructureDriver.
2.... |
Markdown | UTF-8 | 12,020 | 2.71875 | 3 | [] | no_license | # Planning Tools
Planning Tools is a set of programs to help with the design planning process.
It contains programs to cluster user research data like product features or
user needs. It can import data from card sorts, fielded data describing
elements of interest, or manually entered pairwise comparisons. It can clust... |
Python | UTF-8 | 1,359 | 3 | 3 | [] | no_license | import xlrd
import MySQLdb
# read cell value from excel
def get_row_col(excel):
for row in range (excel.nrows):
for col in range (excel.ncols):
print row,excel.cell(row,col).value
# connect db
def read_excel_data_to_db():
conn=MySQLdb.connect(host="127.0.0.1",user="root",passwd="1",db="li... |
Java | UTF-8 | 1,065 | 3.671875 | 4 | [] | no_license | package modul_2.array_2;
import java.util.Scanner;
public class Task_7 {
public static void main(String[] args) {
int n;
Scanner scr = new Scanner(System.in); // 7.
System.out.println("Введите переменную/размер матрицы n - ");
n ... |
C++ | UTF-8 | 4,582 | 2.5625 | 3 | [] | no_license | /*
Copyright 2011 Etay Meiri
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distr... |
Markdown | UTF-8 | 3,014 | 3.015625 | 3 | [] | no_license | # 动画性能
> 性能影响一切
## 技术:去除布局颠簸
- 由设置和获取的交替而导致的UI性能降低称为布局颠簸。
- 解决办法:批量操作DOM的设置和获取
```
// 糟糕的做法
var currentTop = $("element").css("top"); // 获取
$("element").style.top = currentTop + 1; // 设置
var currentLeft = $("element").css("left"); // 获取
$("element").style.left = currentLeft + 1; // 设置
```
- jQuery元素对象(JEO)
```
// 糟糕做法... |
C# | UTF-8 | 3,688 | 2.5625 | 3 | [
"MIT"
] | permissive | using System;
using PivotalTrackerDotNet.Domain;
using NUnit.Framework;
namespace PivotalTrackerDotNet.Tests {
[TestFixture]
public class StoryServiceTest {
private StoryService storyService = null;
const int projectId = 456301;
[TestFixtureSetUp]
public void TestFixtureSetUp() {
storyService = new... |
C++ | UTF-8 | 1,263 | 3.203125 | 3 | [] | no_license | #define relayPin 13 //定義繼電器接腳為13
#define IN1 12 //定義IN1接腳為12
#define OnPin 2 //定義ON按鈕開關接腳為2
#define OffPin 3 //定義OFF按鈕開關接腳為3
int val = 0; //變數val用來儲存按鈕狀態
int val1 = 0; //變數val1用來儲存按鈕狀態
int state = 0; //1表示ON按鍵按下,0表示OFF按下
void setup(){
pinMode(relayPin, O... |
Shell | UTF-8 | 842 | 3.703125 | 4 | [] | no_license | #!/bin/bash
RUNS=5
SIZE="80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 256 260 264 268 272 276"
FILE="stats.csv"
# Chek for program arguments
if [ $# == 0 ]; then
echo "Usage: $0 FILE [RUNS]"... |
Java | UTF-8 | 941 | 3.1875 | 3 | [] | no_license | package JAVA_APP;
import java.util.*;
import java.util.stream.Collectors;
import static java.util.Collections.*;
import static java.util.stream.Collectors.*;
public class Demo {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Set set = new HashSet();
int n = ... |
Java | UTF-8 | 847 | 2.03125 | 2 | [] | no_license | package s.po;
import java.io.Serializable;
public class GoodsPictureInfo implements Serializable {
private static final long serialVersionUID = 1L;
private Integer pkid;
private byte[] GoodsPictureData;
private String GoodsPictureName;
private Integer GoodsId;
public Integer getPkid() {
return pkid;
}
pu... |
Markdown | UTF-8 | 622 | 2.765625 | 3 | [] | no_license | [funky](../../index.md) / [org.funky.option](../index.md) / [kotlin.Array](index.md) / [firstOption](.)
# firstOption
`fun <A> `[`Array`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)`<out A>.firstOption(): `[`Option`](../-option/index.md)`<A>`
`fun <A> `[`Array`](https://kotlinlang.org/api/l... |
Java | UTF-8 | 879 | 2.15625 | 2 | [] | no_license | package com.pl.bg.javamasproject.demo.adapter;
import com.pl.bg.javamasproject.demo.model.Tomograph;
import org.springframework.data.domain.Example;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param... |
Java | UTF-8 | 1,234 | 2.609375 | 3 | [] | no_license | /**
* Project : Classify URLs
*/
package xlong.classifyURL.main;
import weka.core.Instances;
import weka.core.converters.ConverterUtils.DataSink;
import xlong.classifyURL.core.FilesToInstances;
public class GetOriginalArff {
public static void getOriginalArff(int nAll) throws Exception{
Instances data;
Str... |
Python | UTF-8 | 144 | 2.71875 | 3 | [] | no_license | n=int(input())
s=list(map(int,input().split()))
ans=0
for i in range(n-1):
ans+=max(s[i]-s[i+1],0)
s[i+1]=max(s[i+1],s[i])
print(ans)
|
C# | UTF-8 | 1,267 | 2.828125 | 3 | [] | no_license | using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.ServiceBus.Messaging;
using System;
using System.Collections.Generic;
using System.Text;
namespace ServiceBusQueueTriggerFunction
{
public static class ServiceBusQueueTriggeredFunction
{
[FunctionName("ServiceBusQueueTri... |
Markdown | UTF-8 | 756 | 2.53125 | 3 | [] | no_license | Deployed version [here](http://fideligard.surge.sh/)
Fideligard allows clients to test the historical performance of stock portfolios. Buy and sell stocks based on past performance and Fidelagard will keep track of your transactions and portfolio at any given date. Fideligard is an Angular JS Javascript single-page we... |
Markdown | UTF-8 | 4,257 | 2.875 | 3 | [] | no_license | ---
layout: default
title: Quelques astuces pour travailler avec des chiffres
section: pages
---
* La meilleure façon de travailler avec des données, c’est d’y prendre plaisir. Les données peuvent sembler rébarbatives, mais si vous les laisser vous intimider, vous n’arriverez à rien. Voyez-les comme un jouet, un ... |
Shell | UTF-8 | 214 | 2.71875 | 3 | [
"MIT"
] | permissive | #!/bin/bash
source ../spec.sh
source ./module_spec.sh
# Clean up vlc, if we dont have Qt5
if [ "${INCVLC}" == "Y" ] && [ "${INCQTFIVE}" != "Y" ]; then
rm ${DIR}/usr/${LIBDIR}/vlc/plugins/gui/libqt_plugin.so
fi
|
Java | UTF-8 | 4,620 | 2.71875 | 3 | [] | no_license | package akydroid.galactic.bunny.gameworld;
import java.util.ArrayList;
import akydroid.galactic.bunny.objects.BoundaryFrame;
import akydroid.galactic.bunny.objects.EnemyBall;
import akydroid.galactic.bunny.objects.MyBG;
import akydroid.galactic.bunny.objects.MyPlayer;
import com.badlogic.gdx.Gdx;
import co... |
TypeScript | UTF-8 | 340 | 2.78125 | 3 | [] | no_license | export class Credentials {
public username: string;
public password: string;
constructor(username: string, password: string) {
this.username = username;
this.password = password;
}
public getJson():string {
return '{"username":"'+this.username+'", "password":"'+this.passwo... |
Ruby | UTF-8 | 526 | 2.578125 | 3 | [] | no_license | class HogwartAsAService
def get_students(house1)
house_id = get_json('house').select do |house|
house[:name] == house1
end.first[:id]
get_json("house/#{house_id}")
end
def get_json(url)
response = conn.get(url)
JSON.parse(response.body, symbolize_names: true)
end
def conn
Farad... |
PHP | UTF-8 | 587 | 2.8125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace App\Configuration;
use App\Version\VersionInterface;
interface ConfigurationInterface
{
public function __construct(array $paths, VersionInterface $version, ?string $changelog);
public static function parseFile(string $filename, string $versioning): ConfigurationInt... |
TypeScript | UTF-8 | 369 | 2.703125 | 3 | [] | no_license | interface Option {
label: string;
value: any;
}
interface IRegiao {
id: number;
nome: string;
sigla: string;
}
export interface IEstado {
id: number;
nome: string;
regiao: IRegiao;
sigla: string;
}
export interface ICidade {
id: number;
nome: string;
}
export type ICidadeWithPicker = ICidade & Option;
e... |
C# | UTF-8 | 631 | 3.359375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
namespace LamdaDemo
{
class LambdaArray
{
static void Sample_Select_Lambda_Indexed()
{
string[] words = { "one", "two", "three" };
var result = words.Select(... |
C++ | UTF-8 | 821 | 3.03125 | 3 | [] | no_license | #include <iostream>
#include <conio.h>
#include <iomanip>
#include <stdlib.h>
using namespace std;
int main ()
{
int Mat_A[4][4];
int i,j,k, baris, kolom;
do
{
system("cls");
cout<< "Baris dan kolom tidak boleh lebih dari 4!\n\n";
cout<< "Masukkan banyak baris matrik A : ";
cin>> baris;
cou... |
Java | UHC | 767 | 2.453125 | 2 | [] | no_license | import java.awt.event.MouseListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class puzzle{
public static void main(String[] args) {
MainFrame mf = new MainFrame();
//Ŭ, ҷ
}
}
class MainFrame extends JFrame implements MouseListener, Runnable{
/... |
Java | UTF-8 | 1,670 | 2.328125 | 2 | [] | no_license | package com.cdkj.gchf;
import java.io.IOException;
import java.util.Enumeration;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import org.slf4j.Logger;... |
PHP | UTF-8 | 614 | 2.828125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
/*
* This file is part of Matrices.
*
* (c) Graham Campbell <graham@alt-three.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace GrahamCampbell\Matrices\Iterators;
/**
* This is the c... |
Markdown | UTF-8 | 3,644 | 3.125 | 3 | [] | no_license | 前面我们实现了通过网络端口来访问运行在docker容器内的服务。下面我们来实现通过端口连接到一个docker容器
----------
# 网络端口映射
我们创建了一个 python 应用的容器。
```
docker run -d -P training/webapp python app.py
```
另外,我们可以指定容器绑定的网络地址,比如绑定 127.0.0.1。
我们使用 `-P` 参数创建一个容器,使用 docker ps 来看到端口5000绑定主机端口32768。
```
runoob@runoob:~$ docker ps
CONTAINER ID IMAGE ... |
Python | UTF-8 | 685 | 2.53125 | 3 | [
"MIT"
] | permissive | from rest_framework.response import Response
from rest_framework.views import status
"""
Decorador definido para que valide que algunos campos de la sentencia
que llegan en la petición no estén vacíos
"""
def validate_request_data(fn):
def decorated(*args, **kwargs):
# args[0] == GenericVi... |
C# | UTF-8 | 1,414 | 2.71875 | 3 | [] | no_license | using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Extensions.Logging;
using System;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
namespace Buzz.Client
{
/// <summary>
/// Client Function - user interaction
/// provide Post and Delete API... |
Markdown | UTF-8 | 832 | 3.078125 | 3 | [] | no_license | # Redux Feedback Loop
## Description
For this project I built a feedback app. The user answers a list of questions (each located on their own route) and submits their feedback. For the questions I chose to use a dropdown with the values 1-5. When the feedback is submitted it is Posted to a SQL database. Upon completi... |
Rust | UTF-8 | 1,050 | 3.78125 | 4 | [
"MIT"
] | permissive | fn main() {
let a = String::from("hello");
run1(&a).unwrap();
run2(&a).unwrap();
}
fn run1(a: &String) -> Result<(), String> {
let b = match foo(a) {
Ok(x) => x,
Err(x) => return Err(x),
};
let c = match bar(a) {
Ok(x) => x,
Err(x) => return Err(x),
};
le... |
Java | UTF-8 | 7,210 | 2.53125 | 3 | [] | no_license | package com.ing.connector.interfaces;
//import com.eds.cio.model.Model;
//import com.eds.cio.server.interfaces.persistence.NailbaPending2XSegTDB;
import java.util.Hashtable;
import java.util.Vector;
import java.util.Date;
import java.text.SimpleDateFormat;
import java.text.ParsePosition;
import com.ing.connector.i... |
JavaScript | UTF-8 | 2,210 | 2.53125 | 3 | [] | no_license | import { put, takeLatest, all } from 'redux-saga/effects';
import axios from 'axios';
// Function sends get request to get all challenge photos and puts in reducer listening for 'SET_CHALLENGE_PHOTOS'
function* fetchChallengePhotosSaga(action){
let response = yield axios({
method: 'GET',
url: `... |
Markdown | UTF-8 | 2,702 | 3.296875 | 3 | [
"MIT"
] | permissive | # AI in AEC - artificial intelligence in architecture, engineering and construction
There is a dream that artificial intelligence could be very useful and productive in helping the built environment be updated faster, cheaper and better.
The tools, the people, and the expertise are all available to make this dream ha... |
JavaScript | UTF-8 | 11,991 | 2.609375 | 3 | [] | no_license | // Store frame for motion functions
var previousFrame = null;
var paused = false;
var waitGesture = true;
var waitNavigate = false;
var frameCount = 0;
var prevSelect = 0;
var circleCount = 0;
var selected = false;
var swipe = false;
//var selection = "";
// Setup Leap loop with frame callback function
var controllerOp... |
Python | UTF-8 | 6,974 | 2.765625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import urllib
from bs4 import BeautifulSoup
import urllib.request as request
import re
import sqlite3
import os
from datetime import datetime
class Crawler(object):
def __init__(self, db_path, use_proxies=False):
self.con = sqlite3.connect(db_path)
self.cursor = self.con.cur... |
Shell | UTF-8 | 382 | 3.625 | 4 | [] | no_license | #!/bin/bash
git_status_improved__() {
local filename="$1"
gitstatus_result="$(git status -s --ignored $filename)"
if [[ -z "$gitstatus_result" ]]; then
git_tracked_files=$(git ls-files | grep $filename)
if [[ -z "$git_tracked_files" ]]; then
echo "?? $filename"
else
echo "[Good] $filename"
fi
else
... |
Python | UTF-8 | 1,133 | 3.96875 | 4 | [] | no_license |
"""
142:环形链表2
https://leetcode-cn.com/problems/linked-list-cycle-ii/
判断环形链表是不是会相交
快慢指针,如果两个链表相交,那么让快的指针指向头节点
两个指针速度一样往前走,碰面的地方就是交点.
"""
# Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def detectCycle(self, h... |
Java | UTF-8 | 2,299 | 2.0625 | 2 | [] | no_license | package cn.piesat.minemonitor.mapdata.base;
import android.content.Intent;
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 butterknife.ButterKnife;
import b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.