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 |
|---|---|---|---|---|---|---|---|
JavaScript | UTF-8 | 1,974 | 2.59375 | 3 | [] | no_license | angular.module("supercoach")
.service('JsonService', function($http){
var self = this;
self.updateLiveData = updateLiveData;
self.writing = false;
self.writeToGameJson = function(data)
{
if(self.writing) return;
data = angular.toJson(data);
self.writing = true;
$http({
method:"POST",
... |
Python | UTF-8 | 5,733 | 3.203125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import numpy
from numpy import matrix
import time
import pickle
import matplotlib.pyplot as plt
import sklearn.linear_model as lin
#Question 1
###############################################################################
def multiply(matr_a, matr_b):
'''
:param matr_a: The matrix A ... |
JavaScript | UTF-8 | 4,506 | 2.9375 | 3 | [] | no_license | import dotenv from 'dotenv';
import jwt from 'jsonwebtoken';
import bcrypt from 'bcryptjs';
import nodemailer from 'nodemailer';
import stubTransport from 'nodemailer-stub-transport';
import sgTransport from 'nodemailer-sendgrid-transport';
dotenv.config();
/**
* @exports Helper
* @class Helper
* @description Helps... |
Python | UTF-8 | 522 | 2.6875 | 3 | [] | no_license | import re
import pandas as pd
import json
import sys
import requests
commandArgs = sys.argv
a = str(commandArgs[1]).lower()
# requests.put('https://dsci551-2-default-rtdb.firebaseio.com/.json', data = final_use3_json)
gotthis = requests.get('https://dsci551-2-default-rtdb.firebaseio.com/.json')
data1 = gotth... |
Java | UTF-8 | 285 | 2.234375 | 2 | [] | no_license | import org.junit.Assert;
import static org.junit.Assert.assertEquals;
public class Test {
@org.junit.Test
public void add() {
PerSon s1 = new PerSon("hung");
assertEquals("Hello hung", s1.hello());
assertEquals("Hello hai", s1.hello("hai"));
}
}
|
JavaScript | UTF-8 | 1,494 | 2.515625 | 3 | [] | no_license | import React, { useState, useEffect, useCallback } from "react";
import GetStargazerList from "../Services/GetStargazerList";
const StargazerList = ({ repos }) => {
const [stargazers, setStagazers] = useState(null);
const [pageStargazer, setPageStargazer] = useState(1);
const handleClick = useCallback(async () =... |
Java | UTF-8 | 2,742 | 2.75 | 3 | [] | no_license | package com.example.YT_8.cytrition.tools;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import andro... |
Java | GB18030 | 11,298 | 1.71875 | 2 | [] | no_license | /*
*@(#)xx.kgt.action
*@TkAction.java.java
*@ʱ:2011-8-208:12:10
*@ߣ
*@Copyright 2009-2010 ӱѧԺϢѧ빤ѧԺ
*/
package xx.kgt.action;
import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.R... |
Java | UTF-8 | 5,289 | 2.171875 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | package org.burningokr.service.okrUnit.departmentservices.unitServiceManagersTest;
import static org.mockito.AdditionalAnswers.returnsFirstArg;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.util.ArrayList;
import java.util... |
Python | UTF-8 | 1,435 | 2.578125 | 3 | [] | no_license | from instagram_private_api.instagram_web_api import Client
AUTH_USERNAME = ''
AUTH_PASSWORD = ''
TARGET_ACCOUNT = ''
# authenticate client
try:
api = Client(username=AUTH_USERNAME, password=AUTH_PASSWORD, authenticate=True)
except Exception as e:
print('auth error', e)
raise e
if api.is_authenticated:
... |
Java | UTF-8 | 768 | 2.359375 | 2 | [] | no_license | package com.zviproject.common.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "subject", catalog = "Student")
public class Subj... |
Java | UTF-8 | 3,947 | 2.140625 | 2 | [] | no_license | package tagbin.in.myapplication;
import tagbin.in.myapplication.util.SystemUiHider;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.location.Locatio... |
Rust | UTF-8 | 3,917 | 3.25 | 3 | [
"BSD-3-Clause"
] | permissive | use std::collections::HashMap;
extern crate uuid;
use self::uuid::Uuid;
use network::peer::{Peer};
use std::fs::{File,OpenOptions};
extern crate serde;
extern crate serde_json;
#[derive(Debug, Serialize, Deserialize)]
pub struct Node {
pub uuid: Uuid,
pub peers: HashMap<Uuid, Peer>,
}
impl Default for Node... |
C++ | UTF-8 | 3,329 | 2.90625 | 3 | [
"MIT"
] | permissive | #include "Particle.h"
BEGIN_NAMESPACE_COOLPHYSICS2D
Particle::Particle(bool overlappable,double radius,double mass,double elasticity,Vector position,Vector velocity,Vector acceleration,double lifeTime,Color color)
{
_particle=new raw::Particle(overlappable,radius,mass,elasticity,position,velocity,
... |
Markdown | UTF-8 | 583 | 2.671875 | 3 | [] | no_license | # cfg-website
The primary reason for creating this social enterprise website is to assist people living or visiting different London Boroughs in order to find information about support, social events and volunteering in the community more readily.
Although different boroughs have their own websites, it would be very us... |
Python | UTF-8 | 17,508 | 2.765625 | 3 | [] | no_license | #!/usr/bin/env python
# coding=UTF-8
'''
@Description: COMP7405 Assignment 3
@Author: CJJ && HXZ
@LastEditors: Cai Jiajun
@Date: 2019-04-02 17:12:19
@LastEditTime: 2019-04-11 16:28:38
'''
import numpy as np
import math
import scipy.stats as si
class OptionCalculation(object):
def __init__(self):
'''
... |
C | UTF-8 | 3,143 | 2.859375 | 3 | [] | no_license | float max_value1 = 0.00;
float max_value2 = 0.00;
float max_value3 = 0.00;
float max_value4 = 0.00;
float max_flag1 = 0;
float max_flag2 = 0;
float max_flag3 = 0;
float max_flag4 = 0;
int x;
int count = 0;
float sum_1 = 0;
float sum_2 = 0;
float sum_3 = 0;
float sum_4 = 0;
void setup() {
// put your setup code here, ... |
Python | UTF-8 | 2,552 | 2.703125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
import os
import glob
import h5py
import numpy as np
from torch.utils.data import Dataset
def download(data_dir):
if not os.path.exists(data_dir):
os.makedirs(data_dir)
if not os.path.exists(os.path.join(data_dir, 'modelnet40_ply_hdf5_2048')):
www = 'https://shapenet.cs.s... |
Java | UTF-8 | 1,371 | 2.21875 | 2 | [] | no_license | package com.android.systemui.statusbar.policy;
import android.content.Context;
import android.os.Handler;
import dagger.internal.Factory;
import javax.inject.Provider;
/* loaded from: classes.dex */
public final class HotspotControllerImpl_Factory implements Factory<HotspotControllerImpl> {
private final Provider<... |
Markdown | UTF-8 | 4,209 | 2.875 | 3 | [
"Apache-2.0"
] | permissive | # New Action Checklist
So you have decided (or been asked to) add a new action to Plywood. That is great!
Here are the general steps to do it. Written down to hopefully add some structure to your work.
Let's assume that you are adding an action called `foo bar`
1. Make sure your idea is sensible. Think about it and... |
Python | UTF-8 | 6,328 | 3.21875 | 3 | [] | no_license | '''
Qazi Umer Jamil
317920
NUST RIME SMME
'''
import pygame #for GUI framework
import copy
#Initialize PyGame Environment
pygame.init()
screen = pygame.display.set_mode((720, 480))
clock = pygame.time.Clock()
done = False #for quiting pygame window
#Fonts for dislaying various texts
font = pygame.font.SysFont("comi... |
C | UTF-8 | 357 | 3.28125 | 3 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
const int PIPE_READ = 0;
const int PIPE_WRITE = 1;
int myPipe[2];
int main()
{
if (pipe(myPipe) == 0)
{
char myArray[8];
write(myPipe[PIPE_WRITE], "hello!\n", 8);
read (myPipe[PIPE_READ], myArray, 8);
printf(myArray... |
Java | UTF-8 | 514 | 2.25 | 2 | [] | no_license | package com.zingking.bricks.event;
import com.zingking.bricks.entity.MathPoint;
/**
* Copyright (c) 2019, Z.kai All rights reserved.
*
* @author Z.kai
* @date 2019/3/14
* @description EventBus 小球碰撞事件
*/
public class BallCrashEvent {
/**
* 发生碰撞的砖块的数学坐标点
*/
private MathPoint mathPoint;
publ... |
C++ | UTF-8 | 1,535 | 3.234375 | 3 | [] | no_license | #include "Word.h"
#include "Tag.h"
const Word Word::And("&&", Tag::AND);
const Word Word::Or("||", Tag::OR);
const Word Word::eq("==", Tag::EQ);
const Word Word::ne("!=", Tag::NE);
const Word Word::le("<=", Tag::LE);
const Word Word::ge(">=", Tag::GE);
const Word Word::minus("minus", Tag::MINUS);
const Word ... |
JavaScript | UTF-8 | 4,396 | 3.125 | 3 | [
"MIT"
] | permissive | import { CSV_POSTFIX, XML_POSTFIX, TXT_POSTFIX } from '../../../consts';
function checkNumberOrStringTypeByFormat(subjectVariable, format) {
switch (format) {
case XML_POSTFIX:
return typeof subjectVariable['#text'] === 'string' || !Number.isNaN(parseInt(subjectVariable['#text'], 10));
default:
r... |
PHP | UTF-8 | 6,291 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: Kuylim
* Date: 12/28/2016
* Time: 08:12
*/
namespace App\Http\Controllers;
use App\Http\Model\Products;
use Illuminate\Routing\Controller as BaseController;
/**
* Class ProductController
*
* @package App\Http\Controllers
*/
class ProductController extends ApiControlle... |
Swift | UTF-8 | 9,861 | 2.78125 | 3 | [
"MIT"
] | permissive | //
// PrintInformationOperation.swift
//
// The MIT License (MIT)
//
// Copyright (c) 2016 Bartosz Janda
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, inclu... |
C# | UTF-8 | 4,195 | 2.84375 | 3 | [
"MIT"
] | permissive | using Microsoft.Xna.Framework;
using Relatus.Graphics;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
namespace Relatus.Debug
{
public class DebugEntry : IDisposable
{
#region Properties
/// <summary>
/// A unique name used fo... |
Python | UTF-8 | 5,097 | 2.65625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
from __future__ import division, absolute_import, print_function
"""
File list functions.
Provided functions
------------------
fullnames Filenames with absolute paths in local directories.
fullnames_dates Filenames with absolute paths and modifi... |
Ruby | UTF-8 | 97 | 2.515625 | 3 | [] | no_license | de hash = { : elemento1 => 1 , : elemento2 => 2 }
pone hash
hash.delete ( : elemento2 )
pone hash |
JavaScript | UTF-8 | 1,353 | 2.734375 | 3 | [] | no_license | window.onload=function(){
search();
secondkill();
};
/*头部搜索*/
var search=function(){
/*搜索框对象*/
var search=document.getElementsByClassName('jd_header_box')[0];
/*搜索框对象*/
var banner=document.getElementsByClassName('jd_nav')[0];
/*高度*/
var height=banner.offsetHeight;
window.onscroll=function(){
var top... |
SQL | UTF-8 | 21,178 | 3.15625 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `hibernate` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `hibernate`;
-- MySQL dump 10.13 Distrib 5.5.57, for debian-linux-gnu (x86_64)
--
-- Host: 127.0.0.1 Database: hibernate
-- ------------------------------------------------------
-- Server version 5.5.57-0ubuntu0.14.04.1
/*!40... |
Markdown | UTF-8 | 1,800 | 3.25 | 3 | [
"MIT"
] | permissive | # Cryptocurrencies
Quantiacs provides up-to-date hourly data - price and volume - for the following cryptocurrencies:
* Bitcoin (BTC);
* Bitcoin Cash (BCH);
* EOS;
* Ethereum (ETH);
* Litecoin (LTC);
* Ripple (XRP);
* Tether (USDT).
The available cryptocurrency data for the last 5 years can be loaded using:
```py... |
Java | UTF-8 | 842 | 3.53125 | 4 | [] | no_license | package lintcode;
import java.util.ArrayList;
import java.util.LinkedList;
/**
* @Author: Mr.M
* @Date: 2019-04-11 09:34
* @Description:
**/
class Stack11 {
/*
* @param x: An integer
* @return: nothing
*/
LinkedList<Integer> arrayList = new LinkedList<>();
public void push(int x) {
// write your code h... |
Java | UTF-8 | 652 | 3.390625 | 3 | [] | no_license | package com.hackerRank;
public class XXXandOOO {
public static void main(String[] args) {
String x = solution("XOXXXOOOXOOO");
System.out.println(x);
}
static String solution(String S) {
int countX = 0;
int countO = 0;
if (S.contains("XXX")) {
countX... |
Go | UTF-8 | 921 | 2.6875 | 3 | [
"MIT"
] | permissive | package main
import (
"bufio"
"flag"
"fmt"
"github.com/lain-dono/picol.go"
"io/ioutil"
"os"
)
var fname = flag.String("f", "", "file name")
func CommandPuts(i *picol.Interp, argv []string, pd interface{}) (string, error) {
if len(argv) != 2 {
return "", fmt.Errorf("Wrong number of args for %s %s", argv[0], ... |
Java | UTF-8 | 1,090 | 2.375 | 2 | [
"Apache-2.0",
"GPL-1.0-or-later"
] | permissive | // This file is part of CPAchecker,
// a tool for configurable software verification:
// https://cpachecker.sosy-lab.org
//
// SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
//
// SPDX-License-Identifier: Apache-2.0
package org.sosy_lab.cpachecker.util.ltl.formulas;
import static java.util.Ob... |
Markdown | UTF-8 | 2,179 | 3.78125 | 4 | [] | no_license | ### 301. Remove Invalid Parentheses
```
# class Solution:
# def removeInvalidParentheses(self, s: str) -> List[str]:
# left, right = 0, 0
# for ch in s:
# if ch == "(":
# left += 1
# elif ch == ")":
# if left == 0:
# right +... |
PHP | UTF-8 | 525 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace Kynda\Contracts;
use Psr\Container\ContainerInterface;
interface Container extends ContainerInterface
{
public function bound(string $abstract): bool;
public function bind(string $abstract, $concrete = null, bool $shared = false): void;
public function singleton(string $abstract, $concr... |
C# | UTF-8 | 783 | 2.65625 | 3 | [] | no_license | using System;
public class JoinMessage : IBitBufferSerializable, Message {
public int playerId { get; private set; }
public JoinMessage (int playerId) {
this.playerId = playerId;
}
public JoinMessage (BitBuffer buffer) {
Deserialize (buffer);
}
public void Apply (MessageListener listener) {
listener.o... |
Python | UTF-8 | 578 | 2.640625 | 3 | [] | no_license | class Solution:
def projectionArea(self, grid: List[List[int]]) -> int:
height = len(grid)
width = len(grid[0])
empty_top = 0
for i in range(height):
for j in range(width):
if grid[i][j] == 0:
empty_top += 1
top = heigh... |
Python | UTF-8 | 2,031 | 4.1875 | 4 | [] | no_license | # -*- coding: utf-8 -*-
from __future__ import print_function
class Solution(object):
def NumberOf1(self, n):
"""
输入一个整数,输出该数中1的个数。对于问题一定要有一定的敏捷程度,比如看到整数就需要立马意识到有正整数和
负整数,同时还存在0,在其它问题中也是一样,考虑问题不要太急,要思考全面一点。在这个题目中,题目介绍说对于
负数,需要考虑补码形式,因此对于补码这一简单的计算机概念需要有所了解。
原码:最高表示符号位,其余表示数... |
Java | UTF-8 | 1,078 | 1.601563 | 2 | [] | no_license | package p000;
/* renamed from: dmr */
/* compiled from: PG */
public final class dmr extends dje implements dkl {
/* renamed from: d */
public static final dmr f8860d;
/* renamed from: a */
public int f8861a;
/* renamed from: b */
public dmj f8862b;
/* renamed from: c */
public dmi ... |
Java | UTF-8 | 10,276 | 2.125 | 2 | [] | no_license | package org.developerworld.frameworks.weixin.handler.servlet;
import java.io.UnsupportedEncodingException;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import j... |
C# | UTF-8 | 1,551 | 2.59375 | 3 | [] | no_license | using UnityEngine;
using System.Collections;
public class Slingshot : MonoBehaviour {
//Fields seen in the Inspector panel
public GameObject prefabProjectile;
//Internal variable
private GameObject launchPoint;
private Vector3 launchPos;
private GameObject projectile;
bool aimingMode;
void Awake(){
Tran... |
C# | UTF-8 | 3,913 | 3.15625 | 3 | [
"MIT"
] | permissive | namespace AdventOfCode2022;
internal class Day18
{
private const char Lava = '#';
private const char Steam = '.';
private readonly record struct Point(int X, int Y, int Z)
{
public IEnumerable<Point> Neighbours
{
get
{
yield return this with { X ... |
Markdown | UTF-8 | 6,494 | 2.796875 | 3 | [] | no_license | 二三三
阴雪珠哂道:“公于乃堂堂武林男儿,避雨入庙,突问呼救之声,竟连兵刃也不带便循声而去,这已经不符常情;及至遍寻无获,猜疑方浓,忽然在庙里发现两匹无主之马,论情理,公子应该与那怪异的呼救声产生联想,岂会毫不在意,便匆匆上马而去?”
桑琼原是顺口编成的故事,万不料这阴雪珠分析入微,竟然轻易的抓住破绽,一番话,直问得他张口结舌,无言以对。
他本不善作谎,刹时间,面红耳赤,呐呐不能作答,只得撒赖使横,把头一仰,道:“当时在下确未细看,姑娘不信,那也是无可奈何的事。”
“小妹”阴美珠怒哼道:“你还想强词夺理,不说实话?”
桑琼道:“在下分明是说的实话,你们不信又怎么办?”
阴美珠... |
Python | UTF-8 | 1,222 | 2.8125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import scrapy
from challenge16.items import CourseItem
class CourseSpider(scrapy.Spider):
name = 'course'
allowed_domains = ['github.com']
@property
def start_urls(self):
url = 'https://github.com/shiyanlou?page={}&tab=repositories'
return (url.format(i) for i i... |
Python | UTF-8 | 174 | 4.1875 | 4 | [] | no_license | message = input("What message would you like to display? > ")
times = int(input("How many times would you like to print it? > "))
for i in range(0,times):
print(message)
|
JavaScript | UTF-8 | 2,125 | 3.140625 | 3 | [
"MIT"
] | permissive | /**
* Class constructor for representing atoms
* Defining atoms also adds the atom to a global atoms table in JRTS
*/
const Atom = (() => {
// Private registerAtom token
const registerAtom = Symbol("registerAtom");
const registered = Symbol("registered");
return class Atom extends ErlangDatatyp... |
C++ | UTF-8 | 7,823 | 2.546875 | 3 | [] | no_license | #include<iostream>
#include<cmath>
#include<string>
#include<cassert>
#include<fstream>
#include<cstdlib>
void tdma(int ibeg , int iend, double* aa, double* bb, double* cc, double* dd);
int main(int argc, char* argv[])
{
double pi;
pi= M_PI;
double delta_x, delta_y;
int nodes,r;
nodes = 50;
delta_x = d... |
Java | UTF-8 | 1,172 | 2.75 | 3 | [] | no_license | package com.shizhenqiang.design_gupao.design.delegate;
import org.springframework.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
public class Leader implements WorkTask {
/*private final static Map<String, WorkTask> clazzMap = new HashMap<>(3);
static {
clazzMap.put(WorkCategory... |
Shell | UTF-8 | 2,970 | 3.171875 | 3 | [] | no_license | export TMUX_SHELL="`which zsh`"
if [[ -o interactive && ! -o login && -z "$TMUX" ]]; then
SHELL=${TMUX_SHELL:-SHELL} tmux a -t workspace || SHELL=${TMUX_SHELL:-SHELL} tmux new -s workspace
fi
fpath=( "$HOME/.zsh/pure" $fpath )
autoload -U promptinit; promptinit
prompt pure
plugins=(zsh-completions)
autoload -U c... |
C# | UTF-8 | 3,957 | 3.09375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DAL
{
public class SQLDatabase
{
/// <summary>
/// Lấy chuỗi kết nối
/// </summary>
private static strin... |
Java | UTF-8 | 1,169 | 3.140625 | 3 | [] | no_license | import java.awt.Graphics;
import java.awt.Canvas;
import java.awt.Color;
import java.util.Date;
import java.io.FileInputStream;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
public class Renderer extends Canvas implements Runnable {
public BufferedImage image;
public Renderer() throws Exception... |
C++ | UTF-8 | 402 | 2.65625 | 3 | [] | no_license | // AcWing 868. 筛质数
// O(N)
#include <iostream>
using namespace std;
const int N = 1e6 + 6;
int pri[N], tp, v[N];
int n;
int main() {
cin >> n;
for(int i = 2; i <= n; i ++) {
if(!v[i]) pri[++tp] = i, v[i] = i;
for(int j = 1; j <= tp; j ++) {
if(pri[j] > v[i] || pri[j] > n/i) break;... |
Go | UTF-8 | 1,723 | 3.03125 | 3 | [
"MIT"
] | permissive | package login
import (
"encoding/json"
"log"
"net/http"
"github.com/snakesneaks/snakesneaks-go-game-server-test/go-game-server/service/auth"
"github.com/snakesneaks/snakesneaks-go-game-server-test/go-game-server/service/model"
)
// Handler handle request to game
type Handler struct {
}
// NewHandler instantiat... |
Java | UTF-8 | 5,430 | 2.6875 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package is.hi.tripPlanner.hotelPackage.HotelBookings;
import is.hi.tripPlanner.hotelPackage.Models.HotelRoom;
import java.sql.Connect... |
Shell | UTF-8 | 2,824 | 3.109375 | 3 | [] | no_license | #!/bin/bash
CD="$(pwd)"
rm -rf demo
mkdir demo
mkdir demo/js
ln -s -d $CD/node_modules/jquery/dist demo/js/jquery
ln -s -d $CD/node_modules/code-prettify/loader demo/js/code-prettify
mkdir demo/js/tinymce
ln -s -d $CD/node_modules/tinymce/skins demo/js/tinymce/skins
ln -s -d $CD/node_modules/tinymce/themes demo... |
Shell | UTF-8 | 308 | 2.84375 | 3 | [] | no_license | #!/bin/bash
cp config/server.properties server.properties
echo "Is there connect? ${ZOOKEEPER_CONNECT}"
if [ ! -z $ZOOKEEPER_CONNECT ]; then
sed -i 's/^zookeeper.connect=.*/zookeeper.connect='$ZOOKEEPER_CONNECT'/g' server.properties
fi
cat server.properties
bin/kafka-server-start.sh server.properties |
Java | UTF-8 | 42,523 | 1.757813 | 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 Views;
import Controllers.AreaJpaController;
import Controllers.ContactoJpaController;
import Controllers.DetalleOrdenJpaCont... |
C++ | UTF-8 | 814 | 2.640625 | 3 | [] | no_license | #ifndef DOS_JUGADORES_H
#define DOS_JUGADORES_H
#include <SFML/Graphics.hpp>
class Dos_Jugadores
{
public:
Dos_Jugadores();
sf::Texture cuadro1,cuadro2,cuadro3,cuadro4,cuadro5,cuadro6,cuadro7,cuadro8,cuadro9;
sf::Sprite sp1,sp2,sp3,sp4,sp5,sp6,sp7,sp8,sp9;
char tablero[3][3];
... |
C# | UTF-8 | 3,948 | 3.234375 | 3 | [
"MIT"
] | permissive | namespace _02_MatchMaker
{
using System;
using System.Collections.Generic;
using System.Linq;
public static class Program
{
private static readonly Dictionary<string, List<string>> interestNodes = new Dictionary<string, List<string>>();
private static readonly HashSet<string> boys ... |
JavaScript | UTF-8 | 393 | 3.25 | 3 | [] | no_license | function countingValleys(n, s) {
var levelBySea = 0,
valleysCount = 0;
for (var i = 0; i < n; i++) {
levelBySea = s.charAt(i) === "U" ? levelBySea + 1 : levelBySea - 1;
if (levelBySea === 0 && s.charAt(i) === "U")
valleysCount++;
}
return valleysCoun... |
Python | UTF-8 | 278 | 3.34375 | 3 | [] | no_license | # https://leetcode.com/problems/remove-element/
class Solution:
def removeElement(self, arr: List[int], val: int) -> int:
l = 0
for i in range(len(arr)):
if arr[i] != val:
arr[l] = arr[i]
l += 1
return l
|
Java | UTF-8 | 269 | 2.234375 | 2 | [] | no_license | package com.iconmaster.aec.aether.flattener;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class ItemFlattener implements IFlattenerHandler<Item> {
@Override
public ItemStack flatten(Item input) {
return new ItemStack(input);
}
}
|
Java | UTF-8 | 594 | 3.109375 | 3 | [] | no_license | package main.java.sw03;
public class BSTNode {
private int mData;
private BSTNode mLeft;
private BSTNode mRight;
public BSTNode(int pData) {
this.mData = pData;
this.mLeft = null;
this.mRight = null;
}
public int getData() {
return mData;
}
public BST... |
C++ | UTF-8 | 49,160 | 2.765625 | 3 | [] | no_license | #include "simulation.h"
int main(int argc, char const *argv[])
{
// check arguments number
try{
if(argc < 3){
ostringstream oStream;
oStream << "Error: Wrong number of arguments!" << endl;
oStream << "Usage: ./p2 <username> <logfile>" << endl;
throw Exception_t(INVALID_ARGUMENT, oStream.str());
... |
Python | UTF-8 | 1,589 | 2.625 | 3 | [] | no_license | import urllib.request, urllib.parse, urllib.error
import json
# import hidden
import twurl
import ssl
serviceurl = 'https://api.twitter.com/1.1/search/tweets.json?'
while True:
searchQuery = input('Enter the keyword you would like to lookup on twitter').strip(' ')
if len(searchQuery) < 1:
continue
... |
Shell | UTF-8 | 448 | 3.234375 | 3 | [] | no_license | #!/usr/bin/env bash
prefix=`LANG=C date +%Y-%m-%d-%H-%M-%S-`
for f in "a.cpp" "b.cpp" "c.cpp" "d.cpp" "e.cpp" "f.cpp"
do
if [ -f "$f" ]; then
mv $f $prefix$f
fi
done
for f in "a.cpp" "b.cpp" "c.cpp" "d.cpp" "e.cpp" "f.cpp"
do
echo -e \
"#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_... |
Rust | UTF-8 | 4,107 | 3.125 | 3 | [
"Apache-2.0"
] | permissive | use super::Signal;
use crate::error::{Error,
Result};
use libc::{self,
pid_t};
use log::{debug,
error};
use std::{ffi::OsString,
io,
os::unix::process::CommandExt,
path::PathBuf,
process::Command};
pub type Pid = libc::pid_t;
pub(crate) ty... |
C++ | UTF-8 | 562 | 2.71875 | 3 | [] | no_license | #ifndef TETRIMINO_H
#define TETRIMINO_H
#include <stdlib.h>
#define SQUARES_IN_TETRIMINO 4
enum shape {
I, J, L, O, S, T, Z
};
enum rotation{
zero_rad, half_rad, one_rad, three_halves_rad
};
class Tetrimino
{
public:
Tetrimino(shape type, rotation orientation, int centerXPosGrid, int centerYPosGrid, in... |
JavaScript | UTF-8 | 2,933 | 2.578125 | 3 | [] | no_license | let url = window.location.href;
const pageData = url.split("?")
const mainData = pageData[1];
const singleDetail = mainData.split("&");
const token = singleDetail[1].substring(14);
const bnum = singleDetail[2].substring(5);
const pnum = singleDetail[3].substring(5);
const adult = singleDetail[6].substring(7);
const ch... |
SQL | UTF-8 | 106,399 | 3.203125 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 11, 2020 at 12:35 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
Python | UTF-8 | 1,960 | 3.890625 | 4 | [] | no_license | #
# @lc app=leetcode.cn id=402 lang=python3
#
# [402] 移掉 K 位数字
#
# https://leetcode-cn.com/problems/remove-k-digits/description/
#
# algorithms
# Medium (32.53%)
# Likes: 756
# Dislikes: 0
# Total Accepted: 96.7K
# Total Submissions: 297.2K
# Testcase Example: '"1432219"\n3'
#
# 给你一个以字符串表示的非负整数 num 和一个整数 k ,移除这个... |
Markdown | UTF-8 | 6,501 | 3.0625 | 3 | [] | no_license | # 9. 일반적인 프로그래밍 원칙
## 지역변수의 범위를 최소화하라
* 지역변수의 범위를 줄이는 가장 강력한 기법은 '가장 처음 쓰일 때 선언하기' 다.
* 모든 지역변수는 선언과 동시에 초기화 해야 한다. try-catch 문은 예외다.
* 메서드를 작게 유지하고 한 가지 기능에 집중해야 한다.
<br/>
## 전통적인 for 문보다는 for-each 문을 사용하라
전통적인 for 문과 비교했을 때 for-each 문은 명료하고, 유연하고, 버그를 예방해준다.
성능 저하도 없으므로 가능한 모든 곳에서 for 문이 아닌 for-each 문을 사용... |
Markdown | UTF-8 | 545 | 3.1875 | 3 | [] | no_license | # 1158
## Python
```python
from collections import deque
N, K = map(int, (input().split()))
lst = [i for i in range(1, N+1)]
result = []
q = deque(lst)
while q:
q.rotate(-K+1)
result.append(q.popleft())
print(f'<{", ".join(map(str, result))}>')
```
index용 풀이
``` python
from collections import deque
N, ... |
Markdown | UTF-8 | 4,009 | 3.5 | 4 | [
"MIT"
] | permissive | # Chapter 1. The Big Picture
## Levels and Layers of Abstraction in a Linux System
* The kernel is the core of the operating system
* It is software residing in memory that tells the CPU what to do
* The kernel manages the hardware and acts primarily as an interface between the hardware and any running program
* ... |
Swift | UTF-8 | 2,292 | 2.671875 | 3 | [] | no_license | //
// ViewController.swift
// CameraApp
//
// Created by Vinay Ponnuri on 7/22/18.
// Copyright © 2018 Vinay Ponnuri. All rights reserved.
//
import UIKit
class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
@IBOutlet weak var imageView: UIImageView!
o... |
Java | UTF-8 | 4,389 | 2.078125 | 2 | [] | no_license | package com.example.mykitchen;
import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.support.v4.app.NavUtils;
import android.annotation.TargetApi;
import android.conten... |
C | UTF-8 | 1,843 | 2.921875 | 3 | [] | no_license | /*for compilation, link the following library: jsmn/libjsmn.a
jsmn library structures (documentation: https://github.com/zserge/jsmn):
typedef struct {
jsmntype_t type; // Token type
int start; // Token start position
int end; // Token end position
int size; // Number of child (nested) to... |
Swift | UTF-8 | 1,177 | 2.625 | 3 | [
"MIT"
] | permissive | //
// MainInterfaceController.swift
// WatchApp Extension
//
// Created by Massimiliano Bigatti on 20/07/15.
// Copyright © 2015 Massimiliano Bigatti. All rights reserved.
//
import WatchKit
import Foundation
class MainInterfaceController: WKInterfaceController {
@IBOutlet var table: WKInterfaceTable!
... |
Markdown | UTF-8 | 4,828 | 2.796875 | 3 | [
"MIT"
] | permissive | ---
title: 'Computing Innovations - Share, Reflection'
metaTitle: 'Computing Innovations - Share, Reflection'
order: 0
---
## Summary
### Materials
* [Day 11 PowerPoint deck](https://1drv.ms/w/s!AqsgsTyHBmRBkA4vRFCEM20mHtlF?e=y9rJsg)
* [Seeing AI app from Microsoft](https://youtu.be/bqeQByqf_f8)
* [Impact of a Compu... |
C++ | UTF-8 | 590 | 2.9375 | 3 | [
"MIT"
] | permissive | #include <iostream>
int main()
{
int primenum[10000] = {0};
bool prime[10000] = {true, true};
for (int i=2; i<10000; i++)
{
primenum[i] = primenum[i-1];
if (prime[i] == true) {
continue;
}
for (int j=i+i; j<10000; j+=i) {
prime[j] = tru... |
C++ | UTF-8 | 1,059 | 2.90625 | 3 | [] | no_license | #ifndef RIGIDBODY3D_H
#define RIGIDBODY3D_H
#include "../Rigidbody.h"
#include "glm/glm.hpp"
class Rigidbody3D : public Rigidbody {
private:
float m_Mass = 1;
glm::vec3 m_Velocity = glm::vec3(0, 0, 0);
glm::vec3 m_Acceleration = glm::vec3(0, 0, 0);
float m_Bounciness = 0.5f;
p... |
Python | UTF-8 | 5,804 | 2.71875 | 3 | [] | no_license | import os
import csv
import matplotlib.pyplot as plt
# root_directory = 'C:\\Users\\Jazz\\VSCODE\\Repo\\ASECP\\data\\thesis_data\\comparison_of_feature_weighting'
# root_directory = 'C:\\Users\\Jazz\\VSCODE\\Repo\\ASECP\\data\\thesis_data\\comparison_of_feature_transformations'
root_directory = 'C:\\Users\\Jazz\\VSC... |
Python | UTF-8 | 1,002 | 2.609375 | 3 | [] | no_license | import socket
import threading
import json
import sys
nickname = None
fail = False
addr = {}
with open('configs/cl-config.json','r') as f:
addr = json.load(f)
client = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
client.connect((addr['ip'],addr['port']))
def nick():
global nickname
nickname = input... |
C# | UTF-8 | 824 | 2.65625 | 3 | [] | no_license | using System;
using SpeechModulo4.speech;
using Microsoft.CognitiveServices.Speech;
using Microsoft.CognitiveServices.Speech.Audio;
namespace SpeechModulo4
{
class Program
{
static void Main(string[] args)
{
var cliente = SpeechClient.cliente;
Console.WriteLine("Habla e... |
C# | UTF-8 | 1,006 | 2.578125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Business.Entities
{
public class DocenteCurso:BusinessEntity
{
private string cargo;
private Persona docente;
private Curso curso;
public DocenteCurso(... |
Python | UTF-8 | 2,072 | 3.078125 | 3 | [] | no_license | #!/usr/bin/python
## Nicolae Erast - 10.05.2017
import sys, re, os
class mygrep():
def __init__(self, tipar):
self.path = os.getcwd()
print('Directory to search: "%s"' % self.path)
self.tipar = re.compile(tipar)
print(os.linesep + 'Searching for: "%s"' % self.tipar.pattern)
... |
Java | UTF-8 | 1,361 | 2.015625 | 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 View;
import Controller.ClientController;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
im... |
Python | UTF-8 | 3,311 | 2.671875 | 3 | [
"MIT"
] | permissive | from flake8.formatting import base
from junit_xml import TestSuite, TestCase
class JUnitXmlFormatter(base.BaseFormatter):
"""JUnit XML formatter for Flake8."""
# Override show_statistics to always print to stdout instead of to the file
def show_statistics(self, statistics):
for error_code in stat... |
Python | UTF-8 | 5,322 | 2.546875 | 3 | [
"MIT"
] | permissive | import numpy as np
import scipy.constants as cs
from numpy import pi, sqrt
import dataproc.print as dpr
import general as gen
import symmetric as sym
import asymmetric as asym
## Data
tl = np.array([[0.65, 14.06], [2.75, 17.29], [2.09, 17.86]]) # 5 Periods and 10 with beats
tr = np.array([[1.10, 15.01], [2.34, 16.90... |
C# | UTF-8 | 7,797 | 2.53125 | 3 | [] | no_license | using SSLS.Domain.Abstract;
using SSLS.Domain.Concrete;
using SSLS.WebUI.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.UI.HtmlControls;
namespace SSLS.WebUI.Controllers
{
public class ShelfController : Controller
{
/... |
Java | UTF-8 | 2,002 | 2.328125 | 2 | [] | no_license | package com.zxl.mycustomer;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import com.zxl.mycustomer.satellite.SatelliteMenu;
import java.util.Random;
public class MainActivity extends AppCompatActivity ... |
C++ | UTF-8 | 253 | 2.9375 | 3 | [] | no_license | #include "Card.hpp"
Card::Card(const std::string& name, const std::string& effect)
{
this->effect = effect;
this->name = name;
}
std::string Card::get_name()const
{
return this->name;
}
std::string Card::get_effect()const
{
return this->effect;
}
|
Python | UTF-8 | 1,295 | 3.875 | 4 | [
"MIT"
] | permissive | # Best Time to Buy and Sell Stock: https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
# You are given an array prices where prices[i] is the price of a given stock on the ith day.
# You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell... |
C++ | UTF-8 | 3,861 | 2.921875 | 3 | [] | no_license |
#include "huffman.h"
#include <vector>
#include <algorithm>
#include "outputbitstream.h"
namespace
{
unsigned int reverse(unsigned int x)
{
x = (((x & 0xaaaaaaaa) >> 1) | ((x & 0x55555555) << 1));
x = (((x & 0xcccccccc) >> 2) | ((x & 0x33333333) << 2));
x = (((x & 0xf0f0f0f0) >> 4) | ((x & 0x0f0f0f0f) << ... |
Rust | UTF-8 | 836 | 2.515625 | 3 | [] | no_license | extern crate crypto_pals;
fn main() {
use crypto_pals::ops::{bin_to_base64, hexstr_to_base64};
println!("{}", bin_to_base64("Test"));
println!("{}", bin_to_base64(&vec![ 0x49, 0x27, 0x6d, 0x20, 0x6b, 0x69, 0x6c, 0x6c,
0x69, 0x6e, 0x67, 0x20, 0x79, 0x6f, 0x75, 0x72,
... |
Java | UTF-8 | 502 | 2.578125 | 3 | [] | no_license | package robotturtles.g45.board;
import robotturtles.g45.BoardSprite;
import robotturtles.g45.Sprite;
public enum Void implements Sprite {
VOID;
private int posI;
private int posJ;
@Override
public Integer[] getPos() {
return new Integer[]{this.posI, this.posJ};
}
public void set... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.