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 |
|---|---|---|---|---|---|---|---|
Ruby | UTF-8 | 1,591 | 3.484375 | 3 | [] | no_license | require "benchmark"
def solution(a)
result = nil
length = a.size
for i in 0..(length-1)
while a[i] != (i+1)
item = a[i]
break if item >= length || a[item-1] == item
a[i] = a[item-1]
a[item-1] = item
end
result = i+1 if a[i] > length
end
result = length+1 if !result
resu... |
Markdown | UTF-8 | 5,258 | 3.359375 | 3 | [] | no_license | # Applicant comments
> <img src="http://hhru.github.io/api/badges/emp_paid.png" alt="employer with paid access" /> : Methods require [paid access for the employer](employer_payable_methods.md)
* [List of comments](#list)
* [Adding a comment](#add_comment)
* [Comment update](#edit_comment)
* [Delete comment](#delete_c... |
Python | UTF-8 | 1,993 | 2.640625 | 3 | [] | no_license | #!/usr/bin/env python
import socket
import time
import datetime
from thread import *
import threading
import Queue
import select
import os
import signal
import errno
import random
TIMEOUT = 5
do_work = 1
def proc_evt_q(q,pid_list):
while not q.empty():
item = q.get()
pid_list[item[0]] = item[1]
... |
Java | UTF-8 | 1,170 | 1.953125 | 2 | [] | no_license | package com.qlf.plants.activity;
import com.qlf.plants.MainActivity;
import com.qlf.plants.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
public clas... |
Python | UTF-8 | 1,904 | 3.609375 | 4 | [] | no_license | import heapq
#pair:(vertex, weight)
adjList = {1:[(2,10),(4,5)],
2:[(3,1),(4,2)],
3:[(5,4)],
4:[(2,3),(3,9),(5,2)],
5:[(1,7),(3,6)]}
heap = []
def decreaseKey(solution, adjList, heap):
for vertexInSol in solution:
for pair in adjList[vertexInSol[2]]:
for vertexInHeap i... |
TypeScript | UTF-8 | 3,772 | 2.671875 | 3 | [
"MIT"
] | permissive | import { createElement as h } from "react";
import { DOMParser, XMLSerializer } from "xmldom";
import { camelCase } from "lodash";
const { styled } = require("@patternplate/components");
const parser = new DOMParser();
const serializer = new XMLSerializer();
const TAG_NAMES = ["circle", "g", "path", "polygon", "rect... |
JavaScript | UTF-8 | 308 | 2.734375 | 3 | [] | no_license | export const setTheme = name => {
try {
localStorage.setItem("theme", name);
} catch (error) {
console.log(error);
};
};
export const getTheme = () => {
try {
const ongoingTheme = localStorage.getItem("theme");
return ongoingTheme;
} catch (error) {
console.log(error);
};
}; |
Markdown | UTF-8 | 1,059 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | ---
layout: post
title: "Python2 str and unicode err"
description:
category: python
tags:
---
{% include JB/setup %}
使用Py2最大的不爽的一点就是,在文件写入带有非asii码字符时总是容易出错。一会儿又需要调用codecs模块啦,
一会儿又是 str.decode() 着的 unicode.encode()方法了。 什么时候调用 decode 什么时候调用 encode总是搞混。
而且一个最大的麻烦就是,怎么知道一个对象是str还是unicode对象呢?
设想一个场景,从命令行传递 参数给 python s... |
C++ | UTF-8 | 3,126 | 2.890625 | 3 | [] | no_license | #pragma once
#ifndef APPLICATION_H_
#define APPLICATION_H_
#include <exception>
#include <memory>
#include <vector>
#include <string>
#include <SDL.h>
#include <SDL_ttf.h>
#include <GL/glew.h>
#include <AL/al.h>
#include <AL/alc.h>
#include "Physics.h"
#include "UiSystem.h"
namespace myengine
{
class Camera;
cla... |
C++ | UTF-8 | 1,181 | 3.296875 | 3 | [] | no_license | /**********************************************
* Lab 10
* Your name goes here
**********************************************/
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
#include "Tree.h"
/**********************************************
* main
**********************************... |
C++ | UTF-8 | 263 | 2.53125 | 3 | [] | no_license | #include "counting_id_generator.hpp"
BEGIN_NAMESPACE_CORE
counting_id_generator::counting_id_generator(std::size_t prev_id)
: m_last_assigned_id(prev_id)
{
}
std::size_t counting_id_generator::operator()() { return ++m_last_assigned_id; }
END_NAMESPACE_CORE
|
JavaScript | UTF-8 | 2,484 | 2.796875 | 3 | [] | no_license | /**
*
*/
let sendbutton = document.getElementById('WeightButton');
sendbutton.addEventListener("click",(e)=>{
e.preventDefault();
let weight = document.getElementById('weight').value;
let height = document.getElementById('height').value;
let age = document.getElementById('age').value;
let gender = d... |
C++ | UTF-8 | 1,618 | 3.453125 | 3 | [] | no_license | #include <iostream>
#include <conio.h>
using namespace std;
unsigned long long int getBits(int num);
int getDateToBits(int date, int month, int year);
int getDateToInt(int binary);
int main()
{
int year;
int month;
int date;
cout << "Enter a date DD: " << endl;
cin >> date;
if (date > 31) {
... |
C# | UTF-8 | 1,440 | 2.703125 | 3 | [] | no_license | using Pin80Server.Models.JSONSerializer;
namespace Pin80Server.Models.Effects
{
public class SetEffect : Effect
{
public SetEffect(EffectSerializer effect) : base(effect) { }
public override bool Tick(EffectInstance triggeredAction, long ts)
{
var ledTarget = (LEDTarget)tr... |
Python | UTF-8 | 923 | 2.5625 | 3 | [] | no_license | import os
import codecs
import operator
import numpy as np
import csv
# read data
# filename1 = os.path.join(os.path.dirname(__file__), 'all_data.csv')
filename1 = os.path.join(os.path.dirname(__file__), 'all_data.csv')
#f1 = codecs.open( filename1, "r", "utf-8")
#filename2 = os.path.join(os.path.dirname(__file__), ... |
SQL | UTF-8 | 387 | 3.5 | 4 | [
"MIT"
] | permissive | CREATE TABLE core.mno_prefixes
(
id serial NOT NULL,
mno_id integer NOT NULL,
prefix character varying(16) NOT NULL,
CONSTRAINT mno_prefixes_pkey PRIMARY KEY (id),
CONSTRAINT mno_prefixes_mno_id_fkey FOREIGN KEY (mno_id)
REFERENCES core.mno (id) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE
);
... |
C++ | UTF-8 | 6,036 | 3 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<cmath>
#include<ASU_tools.hpp>
/*****************************************************************
* This C++ function use "points_in_polygon.fun.c" from ASU_tools
* to combine several polygons into another set of polygons.(The
* uni... |
Markdown | UTF-8 | 503 | 2.59375 | 3 | [] | no_license | In Lesson 5 of the [Self Driving Car Nanodegree](https://www.udacity.com/course/self-driving-car-engineer-nanodegree--nd013) offered by Udacity, you create, piece by piece, a library called MiniFlow. The library is a core component recreation of some aspects of Tensorflow in order to learn key concepts via 1st principl... |
C++ | UTF-8 | 855 | 2.5625 | 3 | [] | no_license | #ifndef _CLEVELTRANSITION_H_
#define _CLEVELTRANSITION_H_
#include "CStaticObject.h"
#include "CStateMgr.h"
class CLevelTransition : public CStaticObject
{
private :
CStateMgr::StateList m_eStateToChange;
SDL_Rect m_DrawingRect;
bool m_bTransitStart;
double m_dTransitTime;
double m_dMaxTransitTime;
float m_f... |
Python | UTF-8 | 4,317 | 2.734375 | 3 | [] | no_license | # python libraties
import os, cv2
import numpy as np
from PIL import Image
# pytorch libraries
import torch
from torch import nn
from torch.autograd import Variable
from torchvision import models,transforms
def set_parameter_requires_grad(model, feature_extracting):
if feature_extracting:
for... |
Markdown | UTF-8 | 1,057 | 2.859375 | 3 | [] | no_license | ## Table of Contents
- [What is Snapwhyb](#what-is-snapwhyb)
- [Features](#features)
## What is Snapwhyb
Snapwhyb is acronym for Snap - Where have you been
Take a photo using the app. It suggests your current location and you
write your thoughts about the photo. Photos are stored locally on the phone.
## Features
-... |
Java | UTF-8 | 703 | 2.015625 | 2 | [] | no_license | package be.rochus.repository;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import be.rochus.domain.Schutter;
public interface SchutterRepository extends JpaRepository... |
Java | UTF-8 | 952 | 2.15625 | 2 | [] | no_license | package com.xz.netty.demo.cspecial.client;
import com.xz.netty.demo.cspecial.SpecialDelimiter;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.DelimiterBasedFrameDecoder;
import io.n... |
Markdown | UTF-8 | 738 | 2.609375 | 3 | [] | no_license | 1. 调用queryPage接口可以查询数据库app_timeline中的任何数据。
2. 查询语句:(Ok)
'''
select date from app_timeline
'''
3. 插入语句:
```
INSERT INTO app_timeline
(date,subject,title,content,author,flag,url)
VALUES
("2017-12-03","美团1","爬虫","你好,异常!","刘先锋",1,'');
```
4. 更新语句:(always Ok)
```
UPDATE app_timeline SET content="我爱学习"
WHERE id=1;
```
5. 删除... |
JavaScript | UTF-8 | 12,133 | 2.625 | 3 | [] | no_license | const SHA256 = require('crypto-js/sha256');
const Blockchain = require('./simpleChain.js').Blockchain;
const Block = require('./simpleChain.js');
const BitcoinMessage = require('bitcoinjs-message');
const message_star = 'starRegistry';
/**
* Controller Definition to encapsulate routes to work with blocks
*/
class Blo... |
C++ | UTF-8 | 496 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include "tree.h"
static void test_tree()
{
int a[] = { 1, 2, 4, 7, 3, 5, 6, 8 };
int* preorder = a;
int b[] = { 4, 7, 2, 1, 5, 3, 8, 6 };
int* inorder = b;
int c[] = { 7, 4, 2, 5, 8, 6, 3, 1 };
int* postorder = c;
BinaryTreeNode* tree = ConstructInPost(inorder, postorder, 8);
PreorderTraver... |
Java | UTF-8 | 2,737 | 2.21875 | 2 | [] | no_license | /**
* @author pulem3t
*/
package org.pulem3t.crm.entry;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "COMPANIES")
public class Company implements Serializable ... |
C | UTF-8 | 437 | 3.703125 | 4 | [] | no_license | /* dez2bin.c */
#include <stdio.h>
#include <stdlib.h>
#define ulong unsigned long
void dez2bin(ulong dez) {
if(dez) {
dez2bin(dez / 2);
printf("%lu", dez % 2);
}
}
int main(void) {
ulong dezimal;
printf("Dezimalzahl in Dualzahl konvertieren\n");
printf("Welche Zahl : ");
scanf("%lu",&d... |
Java | UTF-8 | 1,497 | 2.6875 | 3 | [] | no_license | package ru.snchz29.dao;
import lombok.extern.java.Log;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Properties;
import static java.sql.Connection.TRANSACTION_READ_COMMITTED;
@Log
public class DataBaseConnection {
pri... |
SQL | UTF-8 | 855 | 3.875 | 4 | [] | no_license | CREATE TABLE IF NOT EXISTS redes_sociais(
id BIGSERIAL PRIMARY KEY,
nome VARCHAR(50) NOT NULL UNIQUE
);
CREATE TABLE IF NOT EXISTS enderecos(
id BIGSERIAL PRIMARY KEY,
rua VARCHAR NOT NULL,
pais VARCHAR(100) NOT NULL,
cidade VARCHAR(100) NOT NULL
);
CREATE TABLE IF NOT EXISTS ... |
C# | UTF-8 | 2,532 | 2.671875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ShowScaffolding.Models;
namespace ShowScaffolding.Controllers
{
public class MoviesController : Controller
{
private readonly IMovieRepository movieRepository;
// If you are using Dependency... |
Java | UTF-8 | 1,451 | 2.03125 | 2 | [] | no_license |
package com.ljwd.plms.web.wsdl.webservice.service;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for searchRefundApply complex type.
*
* <p>The following schema fragment specifies the expected conte... |
C# | UTF-8 | 1,531 | 2.640625 | 3 | [] | no_license | using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;
using RecognitionOfPassports;
namespace WebApplication.Controllers
{
public class RecognitionController : ApiController
{
private const string TempPath = @"... |
C++ | UTF-8 | 2,842 | 2.59375 | 3 | [] | no_license | #include "Artnet.h"
// General pointer to facilitate calling back to non-static function Artnet::on_DMX_frame()
void* pt2Object;
bool connect_wifi(void)
{
START;
char* ssid = "Trap_House";
char* password = "ThIsHoUsEisatrap72";
boolean state = true;
int i = 0;
WiFi.begin(ssid, password);
Serial.println("")... |
PHP | UTF-8 | 1,106 | 2.71875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: EPOP
* Date: 6/6/2018
* Time: 3:59 PM
*/
require_once __DIR__.'/_PDO.php';
class ModelProjectPhaseLog extends _PDO
{
function addLog($phase_id,$user_id,$message){
//connect DB
$this->connect();
$sql = "INSERT INTO b2i_project_phase_log (phase_i... |
Java | UTF-8 | 4,582 | 2.125 | 2 | [] | no_license | package com.maogousoft.logisticsmobile.driver.adapter;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.maogousoft.logisticsmobile.driver.Constants;
import com.maogousoft.logisticsmobile.driver.R;
import c... |
C# | UTF-8 | 2,875 | 3.09375 | 3 | [] | no_license | // <copyright file="Url.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace WebScrapingEngine
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
/// <summary>
... |
C++ | UTF-8 | 565 | 2.9375 | 3 | [
"MIT"
] | permissive | /**
* @file
*
* $Id: Hitbox.hpp $
* @author Bill Eggert
*/
#pragma once
#include <entityx/Entity.h>
class Position;
/**
* A hitbox component. Ships, bullets, black holes have these.
*/
class Hitbox : public entityx::Component<Hitbox>
{
public:
Hitbox(
const float width,
const float heigh... |
Python | UTF-8 | 5,194 | 2.96875 | 3 | [] | no_license | try:
from Tkinter import *
except ImportError:
from tkinter import *
from BaseGrid import *
import cPickle as pickle
class PLLGrid(BaseGrid):
selected_color = "light goldenrod"
def __init__(self, master):
BaseGrid.__init__(self, master)
self.selected = None
self.type = None
... |
TypeScript | UTF-8 | 579 | 2.5625 | 3 | [] | no_license | import { produce } from 'immer'
import { fetchProjectDataProducer } from './producers'
import { IProjectState } from 'reducerTypes/project'
import { IProjectAction } from 'actionTypes/project'
const initialState: IProjectState = {
name: '',
surname: '',
}
const project = (
state: IProjectState = initialState,... |
Shell | UTF-8 | 650 | 3.40625 | 3 | [
"MIT"
] | permissive | #!/bin/sh -f
#
# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
#
OPTS=" "
DBOPTS=" "
USAGE="usage: xfs_ncheck [-sfV] [-l logdev] [-i ino]... special"
while getopts "b:fi:l:svV" c
do
case $c in
s) OPTS=$OPTS"-s ";;
i) OPTS=$OPTS"-i "$OPTARG" ";;
v) OPTS=$OPTS"-v ";;
f) DBOPTS=$DBOPTS" -f";... |
Java | UTF-8 | 3,462 | 1.96875 | 2 | [] | no_license | package com.cubrid.cubridmanager.core.replication.task;
import com.cubrid.common.core.util.StringUtil;
import com.cubrid.cubridmanager.core.SetupEnvTestCase;
import com.cubrid.cubridmanager.core.SystemParameter;
import com.cubrid.cubridmanager.core.Tool;
import com.cubrid.cubridmanager.core.common.socket.MessageUtil;
... |
JavaScript | UTF-8 | 3,683 | 2.734375 | 3 | [] | no_license | const getNoradIdsFromLaunch = require('./norad-ids-from-launch')
const { ApolloServer, gql } = require('apollo-server')
const moment = require('moment')
const rawLaunches = require('./spacex_launches.json')
const launches = rawLaunches.map(launch => ({
launch_date_friendly: moment.unix(launch.launch_date_unix).toLoc... |
Java | UTF-8 | 4,983 | 2.765625 | 3 | [] | no_license | package br.ce.wcaquino.tasks.functional;
import java.net.MalformedURLException;
import java.util.concurrent.TimeUnit;
import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class TasksTest {
public... |
Java | UTF-8 | 424 | 1.648438 | 2 | [] | no_license | package com.youpin.item.vo;
import com.youpin.item.pojo.Sku;
import com.youpin.item.pojo.SpuDetail;
import lombok.Data;
import java.util.List;
/**
* @Author :cjy
* @description :
* @CreateTime :Created in 2019/9/17 9:18
*/
@Data
public class GoodsVo {
private String subTitle;
private Long brandId;
pr... |
Python | UTF-8 | 3,392 | 2.71875 | 3 | [] | no_license | from __future__ import division
import cv2
import time
import sys
img = cv2.imread("../chopi.png")
def detectFaceOpenCVDnn(net, frame):
frameOpencvDnn = frame.copy()
frameHeight = frameOpencvDnn.shape[0]
frameWidth = frameOpencvDnn.shape[1]
blob = cv2.dnn.blobFromImage(frameOpencvDnn, 1.0, (300, 300)... |
Markdown | UTF-8 | 6,091 | 3.265625 | 3 | [] | no_license | ---
layout: tminterface-docs
title: TMInterface Guide
---
## Working with triggers
Triggers are a part of the builtin TMInterface bruteforce script that allow you to optimize a section of a track that does not consist of a checkpoint or a finish. A trigger is a cube placed somewhere on the map that acts as a point of ... |
Markdown | UTF-8 | 908 | 2.640625 | 3 | [] | no_license | # TRAGDOR TRANSLATOR!!!!
## Description
This crazy translator was an excersise to practice adding event listeners to elements of the DOM. This project was also used to strengthen our existing understanding of objects, array's and loops.
I challenged myself to dynamically target JS object's based on the ID of the butt... |
PHP | UTF-8 | 1,168 | 3.1875 | 3 | [] | no_license | <?php
class ListSurveys
{
/**
* GetSurvey constructor.
*
* required call $getSurveys to get Surveys List
*/
public function __construct()
{
}
/**
* @return array return array with questions
*/
public function getSurveys(): array
{
$con = null;
... |
Python | UTF-8 | 806 | 4.21875 | 4 | [] | no_license |
'''
Search a sorted array for entry equal to its index
Design an efficient algorithm that takes a sorted array of distinct integers,
and returns an index i such that the element at i is equal to i.
For example
A = [-2, 0, 2, 3, 6, 7, 9]
returns 2 or 3
'''
# Notice that we can search a different array that is the di... |
JavaScript | UTF-8 | 433 | 3.34375 | 3 | [
"MIT"
] | permissive | export default function Queue() {
const arr = [];
//入队操作
this.push = function(element) {
arr.push(element);
return true;
};
//出队操作
this.pop = function() {
return arr.shift();
};
//清空队列
this.clear = function() {
arr = [];
};
//获取队长
this.size = function() {
return length;
};
... |
Ruby | UTF-8 | 139 | 3.046875 | 3 | [] | no_license | class String
def eight_bit_number?
/\A([0-9]|[1-8][0-9]|9[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\z/.match(self) ? true : false
end
end |
Python | UTF-8 | 4,867 | 2.765625 | 3 | [] | no_license | import pandas
import numpy as np
import matplotlib.pyplot as plt
import re
ph_fpositive=open('phone_positive.txt','r')
ph_positive=[line.strip() for line in ph_fpositive]
ph_fnegative=open('phone_negative.txt','r')
ph_negative=[line.strip() for line in ph_fnegative]
sys_fpositive=open('system_positive.txt','r')
sys_p... |
Python | UTF-8 | 3,215 | 3.453125 | 3 | [
"MIT"
] | permissive | # # Simple recursive approach. Time Limit Exceeded
# class Solution(object):
# def isInterleave(self, s1, s2, s3):
# """
# :type s1: str
# :type s2: str
# :type s3: str
# :rtype: bool
# """
# return self.isInterleaveHelper(s1, s2, s3, 0, 0, 0)
#
#
# def... |
Markdown | UTF-8 | 4,668 | 3.4375 | 3 | [
"MIT"
] | permissive | ---
metaTitle: "R - Random Numbers Generator"
description: "Random permutations, Random number generator's reproducibility, Generating random numbers using various density functions"
---
# Random Numbers Generator
## Random permutations
To generate random permutation of 5 numbers:
```r
sample(5)
# [1] 4 5 3 1 2
... |
Java | UTF-8 | 516 | 1.601563 | 2 | [] | no_license | package com.ssm.aop;
import com.ssm.bean.User;
import com.ssm.dao.UserMapper;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.beans.factory.annotation.Autowired;
impo... |
PHP | UTF-8 | 1,526 | 2.796875 | 3 | [] | no_license | <?php
// Headers
header('Access-Control-Allow-Origin: *');
header('Content-Type: application/json');
header('Access-Control-Allow-Methods: POST');
header('Access-Control-Allow-Headers: Access-Control-Allow-Headers, Content-Type, Access-Control-Allow-Methods, Authorization, X-Requested-With');
... |
Markdown | UTF-8 | 2,065 | 2.84375 | 3 | [] | no_license | ---
layout: post
title: 3 WordPress Security Plugins you must have to keep hackers at bay.
excerpt: WordPress has a bad reputation for getting hacked. It's opensource, so anyone can figure out how it works and where it's weaknesses are. And most new owners don't take very basic measures to protect themselves because th... |
Java | UTF-8 | 5,905 | 2.1875 | 2 | [] | no_license | package com.itechart.contacts.core.unit.attachment.service;
import com.itechart.contacts.core.utils.testutil.TestUtil;
import com.itechart.contacts.core.attachment.dto.AttachmentDto;
import com.itechart.contacts.core.attachment.dto.SaveAttachmentDto;
import com.itechart.contacts.core.attachment.entity.Attachment;
impo... |
Python | UTF-8 | 3,511 | 3.515625 | 4 | [] | no_license | import numpy as np
import logging
class KnnClassifier(object):
@staticmethod
def euclidean(x,y):
"""
Inputput
x: a 1-dimensional numpy array
y: a 1-dimensional numpy array
Output
A single number, the euclidean distance between x and y
""" ... |
JavaScript | UTF-8 | 2,764 | 2.75 | 3 | [] | no_license | import React, { Component } from "react";
import { connect } from "react-redux";
import {
VerticalBarSeries,
XAxis,
YAxis,
FlexibleWidthXYPlot
} from "react-vis";
import "./css/BarChart.css";
class BarChart extends Component {
constructor() {
super();
this.state = {
hour: null
};
}
rend... |
Markdown | UTF-8 | 676 | 2.875 | 3 | [] | no_license | # My Data Science Learning Journey
This is my repo to learning-by-doing Data Science.
## My Main Resources
I'm using multiple resources to study and apply what I learn here with examples. This is a list of **main** resources I use (_I will update this list whenever I use a new resource_):
* [Data Science Fundamental... |
Java | UTF-8 | 3,922 | 2.046875 | 2 | [] | no_license | package com.example.intern.giftest.effects;
import android.app.Activity;
import android.app.ProgressDialog;
import android.graphics.Bitmap;
import android.os.AsyncTask;
import com.example.intern.giftest.adapter.Adapter;
import com.example.intern.giftest.clipart.OnVideoActionFinishListener;
import com.example.intern.g... |
Java | UTF-8 | 1,078 | 2.359375 | 2 | [] | no_license | package edu.sysuedaily.cache;
import java.util.Date;
import android.content.Context;
import edu.sysuedaily.cachedatabase.JsonCacheDatabase;
public class WeiboJsonCache extends BaseJsonCache {
protected WeiboJsonCache(Context context) {
super(context);
// TODO Auto-generated constructor stub
}
public static... |
Markdown | UTF-8 | 4,751 | 3.140625 | 3 | [
"MIT"
] | permissive | # WhatIs: DefaultAction
A DefaultAction is a task performed by the browser. DefaultActions are **queued in the event loop**, and they are always **preceded by a native trigger event**. In this respect, DefaultActions very much resemble native CascadeEvents.
DefaultActions are *cancelable*. If you call `.preventDefaul... |
Python | UTF-8 | 1,773 | 4.28125 | 4 | [] | no_license | """ https://leetcode.com/problems/sort-characters-by-frequency/description/
451. Sort Characters By Frequency - Medium
08/11/2021 17:21 Accepted https://leetcode.com/submissions/detail/537086251/
Given a string s, sort it in decreasing order based on the frequency of characters, and return the sorted string.
Exam... |
JavaScript | UTF-8 | 1,239 | 2.59375 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
import journeyImage from "./images/the-Heroines-Journey-map-1024x770.jpg";
import { journeyAreas, quadrantToShow } from "./helpers/journeyAreas";
// this is the service which connects to the json API
import httpGet from "./services/journeyService";
// image and se... |
Python | UTF-8 | 517 | 2.921875 | 3 | [
"MIT"
] | permissive | def Monkey(n, M):
if n == 0 or M == 1:
return 0
L = list(map(list, list(enumerate([True] * n, start=1))))
counter = 0
while [L[i][1] for i in range(len(L))].count(True) > (M - 1):
for i in range(len(L)):
if L[i][1] == True:
counter += 1
if counter... |
Java | UTF-8 | 2,420 | 3.203125 | 3 | [] | no_license | package org.sugarcubes.serialization;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
/**
* https://github.com/stoklund/varint
*
* @author Maxim Butov
*/
public class IntegerVariableLengthEncoding {
/**
* Tests the long value fits 32 bits. I.e. the value can be cast ... |
JavaScript | UTF-8 | 1,753 | 2.734375 | 3 | [] | no_license | $( document ).ready(function(){
let $uploadfile = $('#register .upload-profile-image input[type="file"]');
$uploadfile.change(function(){
readURL(this);
});
$("#reg-form").submit(function(event){
let $password = $("#password");
let $confirm = $("#password_pwd");
let $error = $("#confirm_error")... |
Java | UTF-8 | 4,230 | 2.34375 | 2 | [
"Apache-2.0"
] | permissive | package com.messagebus.client.model;
import java.io.Serializable;
/**
* representation a node of the topology
*/
public class Node implements Serializable, Comparable<Node> {
private String nodeId;
private String secret;
private String name;
private String value;
private String parentId;
... |
C++ | UTF-8 | 511 | 2.609375 | 3 | [] | no_license | #ifndef __PhysicsObject_h_
#define __PhysicsObject_h_
class Explosion;
enum PHYSICS_OBJECT_TYPE {
UNDEFINED,
TOWER_CHUNK,
PLATFORM,
PLAYER,
ROCKET
};
class PhysicsObject
{
public:
PhysicsObject()
: type(UNDEFINED)
{}
PhysicsObject(PHYSICS_OBJECT_TYPE type)
... |
PHP | UTF-8 | 153 | 3.328125 | 3 | [] | no_license | <?php
$array = ["Andy", "Bety", "Carol"];
// aaray_reverse 要素を逆順にした配列を返す
$reverse = array_reverse($array);
print_r($reverse); |
Markdown | UTF-8 | 1,488 | 3.015625 | 3 | [] | no_license | # CS250
How do I interpret user needs and implement them into a program? How does creating “user stories” help with this?
User needs are first described using face to face interactions with the users, which I then break down into criteria that needs to be met by the product backlog. Creating user stories helps to org... |
C++ | UTF-8 | 2,989 | 2.96875 | 3 | [
"MIT"
] | permissive | //
// Created by Alex on 9/14/2018.
//
#pragma once
#include <stdio.h>
#include "types.hpp"
#include "vector_bit_ops.hpp"
namespace apollo {
typedef size_t FamilyID;
class Family {
private:
std::vector<bool> all_bits_;
std::vector<std::vector<bool>> one_bits_;
std::vector<bool>... |
Ruby | UTF-8 | 370 | 3.96875 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | # prereqs: iterators, hashes, conditional logic
# Given a hash with numeric values, return the key for the smallest value
def key_for_min_value(name_hash)
min_val=nil
name_hash.each {|key, value|
min_val=value if min_val==nil || value < min_val
}
name_hash.key(min_val)
end
# hash = {:blake => 500, :ashley... |
C# | UTF-8 | 2,478 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | using System.Data;
using System.Linq;
using System.Xml.Linq;
using System.Xml.XPath;
using Dapper;
using X4_DataExporterWPF.Entity;
namespace X4_DataExporterWPF.Export
{
/// <summary>
/// モジュール建造に関する情報抽出用クラス
/// </summary>
class ModuleProductionExporter : IExporter
{
/// <summary>
... |
C | UTF-8 | 3,498 | 3.03125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "answer07.h"
Image * Image_load(const char * filename)
{
int read_header;
int read;
//int read1;
int read2;
FILE * fptr = NULL;
ImageHeader header; //= NULL;
Image * img; //= NULL;
fptr = fopen(filename, "rb");
if ( fptr == NULL)
{
return NULL;
}
... |
C++ | UTF-8 | 1,978 | 3.09375 | 3 | [] | no_license | #include "Camera.h"
#include <glm/gtx/euler_angles.hpp>
#include <glm/gtc/matrix_transform.hpp>
//The up vector is inverted because of vulkans inverted y-axis
const glm::vec3 UP_VECTOR = glm::vec3(0.0f, -1.0f, 0.0f);
const glm::vec3 FORWARD_VECTOR = glm::vec3(0.0f, 0.0f, 1.0f);
Camera::Camera()
: m_Projection(1.0f... |
Java | UTF-8 | 257 | 1.820313 | 2 | [] | no_license | package com.ncu.outpatient.service;
import com.ncu.pojo.common.Employee;
/**
* @author : 城南有梦
* @date : 2020-07-17 22:13:19
* @description:
*/
public interface EmployeeService {
Employee findByNameAndDepart(String name,String departId);
}
|
C# | UTF-8 | 840 | 3 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
namespace PracticeHW6
{
public class CarSales
{
//vin,make,color,year,model,sale_price
public string vin { get; set; }
public string make { get; set; }
public string color { get; set; }
publi... |
Java | UTF-8 | 8,071 | 1.742188 | 2 | [] | no_license | /**
*/
package org.odysseus.models.socialnetwork.media.impl;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
import org.odysseus.models.socialnetwork.activity.Activ... |
Python | UTF-8 | 1,639 | 3.03125 | 3 | [] | no_license | #Format Data for frontend data from google/kaggle style output
import csv
confereceOrder = ("W", "X", "Z", "Y")
teams = {}
with open('kaggle_data/MTeams.csv') as file:
csv_reader = csv.reader(file, delimiter=',')
for line in csv_reader:
teams[str(line[0])] = str(line[1])
def format(data):
... |
Markdown | UTF-8 | 4,322 | 2.734375 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: 我的软件使用汇总
description: Some Description
date: 2014-03-04 11:16:24 +08:00
tags: "Software"
---
## 我的软件使用汇总
### 效率软件
**AutoHotkey**:AutoHotkey是简易而功能强大的热键脚本语言,由于十分的强大,所以我使用的也只是一部分而已,基本上是要用到才去学习。
目前使用:
* 快捷键打开软件。定义快捷键来批量打开和关闭软件,减少鼠标重复劳动。
* 便捷搜索:你只需要选取文本,使用Alt+b和Alt+g来打开网页进行百度和Google的搜索,不需要重复以前的打开网页... |
C++ | UTF-8 | 1,361 | 3.015625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <algorithm>
#include <queue>
#include <vector>
#include <memory.h>
using namespace std;
int N, M, res = 987654321;
int p[1001][1001]; // 0 : 지나갈 수 있음, 1 : 벽 또는 불
int visit[1001][1001];
int dx[4] = { -1,0,0,1 };
int dy[4] = { 0,-1,1,0 };
int jx, jy;
queue<pair<int, int>> q;... |
Java | UTF-8 | 4,197 | 3.015625 | 3 | [] | no_license | import java.util.Scanner;
public class pokerHands
{
private static Scanner scanner=new Scanner(System.in); static{scanner.useDelimiter(System.getProperty("line.separator"));}
public static void main(String[] args)
{
int numCards = 0;
int r1 = 0;
int r2 = 0;
int r3 = 0;
int r4 = 0;
int r5 = 0;
int s1 = 0;
int s2 = 0... |
Markdown | UTF-8 | 4,397 | 3.9375 | 4 | [] | no_license | # 创建具有不同类型项的列表
我们通常需要创建显示不同类型内容的列表。例如,我们可能正在处理一个列表,该列表显示一个标题,后面跟着几个与标题相关的项,然后是另一个标题,依此类推。
我们怎样才能创造出这样一种Flutter的结构呢?
## 指南
1、使用不同类型的项创建数据源
2、将数据源转换为小部件列表
## 1、使用不同类型的项创建数据源
为了在列表中表示不同类型的项,我们需要为每种类型的项定义一个类。
在本例中,我们将开发一个应用程序,它显示一个标题,后面跟着五个消息。因此,我们将创建三个类:`ListItem`、`HeadingItem`和`MessageItem`。
```dart
//可以包含的不同类型项... |
PHP | UTF-8 | 4,988 | 2.546875 | 3 | [] | no_license | <?php
include ROOT_PATH . '/plugin/wx-pay/index.php';
include_once ROOT_PATH . '/core/utils.php';
class Order extends WxPay {
private $empty;
private $cookieValid;
private $config;
public function __construct($config) {
parent::__construct($config['DB_NAME'], $config['DB_USR'], $config['DB_PWD']);
$this->coo... |
C | UTF-8 | 14,984 | 2.609375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../headers/util.h"
#include "../headers/syntactic.h"
#include "../headers/domain.h"
Token *crtTk, *consumedTk;
Symbols *symbols;
Symbol *crtFunc;
Symbol *crtStruct;
int crtDepth;
int expr();
int stm();
int stmCompound();
int declVar();
int typeName... |
Python | UTF-8 | 2,397 | 3.234375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
# Import the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the datasheet
dataset = pd.read_csv('Data.csv')
X = dataset.iloc[:, :-1].values
Y = dataset.iloc[:, 3].values
# Taking care of missi... |
Python | UTF-8 | 4,887 | 3.296875 | 3 | [
"MIT"
] | permissive | import Image
import ImageDraw
import random
import operator
from collections import defaultdict
import matplotlib.delaunay as triang
import argparse
def edge_color(edg):
'''Returns a valid edge coloring of the given graph in the mathematical
sense. No two edges that are connected by a node share the same colo... |
Java | UTF-8 | 2,285 | 2.390625 | 2 | [] | no_license | package com.hk.mechuri.dtos;
public class filterDto {
private String age10;
private String age20;
private String age30;
private String age40;
private String age50;
private String female;
private String male;
private String catelname;
private String catesname;
private String price;
pub... |
Python | UTF-8 | 2,638 | 3.46875 | 3 | [] | no_license | """"""
import pprint
import requests
import parsel
import csv
'''
1、明确需求:
爬取豆瓣Top250排行电影信息
电影名字
导演、主演
年份、国家、类型
评分、评价人数
电影简介
'''
# csv模块保存数据到Excel
f = open('file_output/豆瓣电影数据.csv', mode='a', encoding='utf-8', newline='')
csv_writer = csv.DictWriter(f, fieldnam... |
TypeScript | UTF-8 | 406 | 2.6875 | 3 | [] | no_license | export class Weather {
constructor(
public name: string,
public description: string,
public icon: string,
public temperature: WeatherTemperature,
public pressure: number,
public humidity: number,
public windSpeed: number
) {
}
}
export class WeatherTemperature {
constructor(
pu... |
Python | UTF-8 | 263 | 2.625 | 3 | [] | no_license | from pandas import DataFrame
def cleanData(dFrame, keys):
# remove useless columns
for key in keys:
dFrame = dFrame.drop(key,1)
# remove Null columns and rows
dFrame = dFrame.dropna(axis=0,how='all')
dFrame = dFrame.dropna(axis=1,how='all')
return dFrame |
C++ | UTF-8 | 298 | 3.078125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
float a = 0;
float b = 0;
float c = 0;
float calc = 0;
cout << "escreva o valor A: ";
cin >> a;
cout << "escreva o valor B: ";
cin >> b;
cout << "escreva o valor C: ";
cin >> c;
calc = b * b - 4 * a * c;
cout << calc;
}
|
Java | UTF-8 | 4,720 | 2.15625 | 2 | [
"MIT"
] | permissive | package stevekung.mods.moreplanets.planets.fronos.blocks;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockFaceShape;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft... |
Go | UTF-8 | 709 | 2.8125 | 3 | [] | no_license | package main
import (
"fmt"
"gopkg.in/mgo.v2"
)
// Connect connects to a MongoDB instance
func Connect(url string) (*mgo.Session, error) {
fmt.Println("Connecting to the DataBase...")
session, err := mgo.Dial(url)
if err != nil {
return nil, err
}
fmt.Println("Connected!!!\n")
return session, nil
}
//... |
C | UTF-8 | 1,340 | 3.21875 | 3 | [] | no_license | #include <stdio.h>
#include "definition.h"
int maxim (int *a, int n, int i, int j, int k) {
int m = i;
if (j < n && a[j] > a[m]) {
m = j;
}
if (k < n && a[k] > a[m]) {
m = k;
}
return m;
}
void downheap (dataArray *arr, int n, int k) {
while (1) {
int j = maxim(arr-... |
TypeScript | UTF-8 | 1,281 | 2.890625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import * as React from 'react';
import type { Theme, PartialTheme } from '@fluentui/theme';
import type { ICustomizerContext } from '@fluentui/utilities';
/* eslint-disable @typescript-eslint/naming-convention */
/**
* {@docCategory ThemeProvider}
* Props for the ThemeProvider component.
*/
export interface ThemeP... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.