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
35
2.546875
3
[]
no_license
# Aidan-Moore-ICS3U-Unit1-04-Python
Markdown
UTF-8
550
2.859375
3
[ "Unlicense" ]
permissive
# bbrot **bbrot** is a CLI [Buddhabrot](https://en.wikipedia.org/wiki/Buddhabrot) renderer. It's currently very basic; it has minimal options and only supports rendering to a png file. ### Sample output ![sample output](sample.png) That took about 10 seconds to render. ### Usage To build the executable, run the ...
Python
UTF-8
1,353
2.8125
3
[]
no_license
#!/usr/bin/python # coding: utf-8 import sys import subprocess from pprint import pprint COMMANDS = ['help', 'ping', 'whoami', 'areyoualive', 'listsocketclients'] class Command(): Name = ['ping', '-c', '15', '-w', '5', '8.8.8.8'] output = '' def __init__(self, socket): self.socket = socket ...
Ruby
UTF-8
1,338
2.8125
3
[]
no_license
require 'test_helper' class CartItemTest < ActiveSupport::TestCase test "cart item can calculate price" do cart =Cart.new p1= Product.create(name:'ruby', price:100) p2= Product.create(name:'php', price:50) 5.times do cart.add_item(p1.id) end 3.times do cart.add_item(p...
C
UTF-8
870
3.046875
3
[]
no_license
#include <stdio.h> int main() { int k,n,m; scanf("%d %d %d",&k,&n,&m); int min = k; int best = 0; int adj[20][30]; int i,j,A,v; for(i=0; i<20; i++) for(j=0; j<30; j++) adj[i][j]=0; for(i=0; i<m; i++) { int start,end,cat; scanf("%d %d %d",&start,&end,&cat); adj[cat][start] |= (1<<end); adj[cat]...
Ruby
UTF-8
343
3.09375
3
[]
no_license
N = gets.to_i h = gets.split().map(&:to_i) inf = 1000000000 dp = [] 1000000.times do dp.push(inf) end dp[0] = 0 def chmin(a, b) if a > b return b end return a end (1..N-1).each do |i| dp[i] = chmin(dp[i], (h[i-1]-h[i]).abs + dp[i-1]) if i > 1 dp[i] = chmin(dp[i], (h[i-2]-h[i]).abs + dp[i-2]) ...
Python
UTF-8
394
3.6875
4
[]
no_license
# coding: utf8 # 用一个栈实现另一个栈的排序 def sortStackByStack(stack): Help = [] while len(stack) > 0: cur = stack.pop() while len(Help) > 0 and Help[-1] < cur: stack.append(Help.pop()) Help.append(cur) while len(Help) > 0: stack.append(Help.pop()) return stack # # a = [...
Java
UTF-8
846
2.453125
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 app.domain.model; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWr...
Java
UTF-8
1,446
3.015625
3
[]
no_license
package com.nacorpio.nutilities.collection.natural; public class Leaf implements ILeaf { private String name; private IParental parent; private Object data; /** * Creates a new leaf. * @param par1 the name. * @param par2 the parent. * @param par3 the data. */ public Leaf(String par1, IParental par2...
C++
UTF-8
2,914
2.65625
3
[]
no_license
// // Poll.cpp // marstcp // // Created by meryn on 2017/08/02. // Copyright © 2017 marsladder. All rights reserved. // #include "KQueuePoll.h" #include <sys/socket.h> #include "log/Log.h" #include "Channel.h" net::KQueuePoll::KQueuePoll(){ this->pollFd = kqueue(); } int net::KQueuePoll::A...
Java
UTF-8
1,766
2.40625
2
[]
no_license
package fr.keuse.rightsalert.adapter; import java.util.ArrayList; import fr.keuse.rightsalert.entity.ApplicationEntity; import android.content.Context; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.widget.B...
PHP
UTF-8
849
2.515625
3
[]
no_license
<!DOCTYPE html> <html> <head> <title>Menu Colaborador</title> </head> <body> <?php session_start(); $dbconn = pg_connect("host=localhost port=5432 dbname=bd user=postgres password=tarea") or die('<h1>No se ha podido conectar: </h1>' . pg_last_error()); $sql = 'SELECT "nombr...
Markdown
UTF-8
1,205
3.171875
3
[ "MIT" ]
permissive
# typewriter.js typewriter.js is a Javascript module for emulating a type writer affect. [![Remix on Glitch](https://cdn.glitch.com/2703baf2-b643-4da7-ab91-7ee2a2d00b5b%2Fremix-button.svg)](https://glitch.com/edit/#!/join/b2ab7cab-7c58-49fa-bc8c-efa05a51500c) ## Example See demo [Glitch](https://typewriter-js.glitc...
C
UTF-8
12,054
2.734375
3
[ "LicenseRef-scancode-public-domain", "BSD-2-Clause", "BSD-3-Clause" ]
permissive
/* This file records outlaw ratings * I have to warn you, don't try to understand it. * All other comments are meant for me, so my head doesn't explode.. * /Scarblac */ mapping ratings = ([ ]); /* ratings consists of: "name" : ({ rating, ... }) if rating = 0 (no rating yet) the '...' part is name1,e...
C++
UTF-8
3,490
3.4375
3
[]
no_license
#include<iostream.h> #include<conio.h> #include<stdlib.h> #include<string.h> #include<fstream.h> class account { public : char name[20]; char type[15]; char branch[20]; float acc,amount; void add(); void show_all(); void search(); void edit(); }; fstream file; account obj; void ac...
Python
UTF-8
2,991
2.84375
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Fri Feb 5 17:56:44 2016 @author: Huang Hongye <qrqiuren@users.noreply.github.com> This is a simulation program for acoustic signal tracking. Reference: [1] Zhong, X., Prekumar, A. B., and Madhukumar, A. S., "Particle filtering for acoustic source tracking in impulsive noi...
Java
UTF-8
1,719
2.234375
2
[ "Apache-2.0" ]
permissive
/* * RegistrationEntryDaoHibernate.java * * Copyright © 2008-2009 City Golf League, LLC. All Rights Reserved * http://www.citygolfleague.com * * @author Steve Paquin - Sage Software Consulting, Inc. */ package com.sageconsulting.dao.hibernate; import java.util.List; import com.sageconsulting.dao.Registratio...
Java
UTF-8
3,142
3.421875
3
[]
no_license
package code.day13; import code.day1to5_7.Customer; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class CustomerMain { static Scanner sc = new Scanner(System.in); static List<Customer>customersList=new ArrayList<Customer>(); public static void main(String[] args) { ...
TypeScript
UTF-8
524
2.5625
3
[]
no_license
export class Product { id?:string; usersummited?:string; serialnumber?:string; modelname?:string; custumername?:string; datesubmit?:Date; status?:string; waittingday?:string; constructor(data: any) { this.id = data.id; this.usersummited = data.usersummited; this.serialnumber = data.serial...
JavaScript
UTF-8
282
2.5625
3
[]
no_license
const reducer = (state={ text : '你好!访问者', name : '访问者' },action)=>{ switch (action.type){ case 'change': return { name:action.payload, text:'您好'+ action.payload } default: return state } } export default reducer
JavaScript
UTF-8
1,240
2.703125
3
[]
no_license
"use strict"; /** * @constructor * @param {string} label The label. */ var UIButton = function(label){ this.label = label; }; /** * @return {Element} The button element. */ UIButton.prototype.DOM = function(){ var button = document.createElement("button"); button.innerText = this.label; return bu...
C++
UTF-8
654
2.5625
3
[]
no_license
#include <iostream> #include <string> #include <algorithm> #include <cstring> #define MAX 1000 using namespace std; string str1, str2; int cache[MAX][MAX]; int getCnt(int idx1, int idx2) { if(idx1 == str1.size() || idx2 == str2.size()) return 0; int& ret = cache[idx1][idx2]; if(ret != -1) return ret...
Markdown
UTF-8
1,367
2.734375
3
[]
no_license
<img src = https://img.shields.io/badge/Team_Kosk-DID-yellow></a> # Decentalized id project of Team Kosk ## Ideas to leverage DID by Team Kosk We are a team of four South Korean blockchain developers - we are beginner-level blockchain programmers yet, but have worked hard to get our feet to next level. In this rep...
C++
WINDOWS-1251
1,602
2.84375
3
[]
no_license
using namespace std; class Array { int *a; int size_a; public: Array() { a = NULL; size_a = 0; } // Array(int *a1, int size_a1); // // size_a1, a1 void Print(); // int & a_i(int i); // i- Array(Array & ar); // ~Array(){ delete []a; } // Array Union(Array...
Java
UTF-8
747
1.664063
2
[]
no_license
package com.sun.jmx.snmp.agent; import com.sun.jmx.snmp.SnmpOid; import com.sun.jmx.snmp.SnmpStatusException; import javax.management.ObjectName; public abstract interface SnmpTableCallbackHandler { public abstract void addEntryCb(int paramInt, SnmpOid paramSnmpOid, ObjectName paramObjectName, Object paramObject, S...
C#
UTF-8
16,758
2.546875
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
//----------------------------------------------------------------------------- // // Copyright by the contributors to the Dafny Project // SPDX-License-Identifier: MIT // //----------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Diagno...
Java
UTF-8
517
2.3125
2
[]
no_license
package com.test.mytest.service.powermock; import com.test.mytest.dao.powermock.EmployeeDao; import com.test.mytest.model.powermock.Employee; public class EmployeeService { private EmployeeDao employeeDao; public EmployeeService(EmployeeDao employeeDao) { this.employeeDao = employeeDao; } /** * 获取所有员工的数量....
Java
UTF-8
2,214
3.5625
4
[]
no_license
package com.lolo.juc.notifyWait; /** * 现在4个线程,可以操作初始值为零的一个变量, * 实现2个线程对该变量加1,2个线程对该变量减1 * * 编程思路: * 1. 线程 操作 资源类 * 2. 高内聚(空调资源制冷和制热) 低耦合(每个人使用空调资源) * * 3. 判断(while) * 4. 干活 * 5. 通知 * * Object: * hashCode() * equals() * toString() * notify() * wait() * getClass(...
C++
UTF-8
1,218
3.359375
3
[]
no_license
#include <iostream> #include <vector> #include <algorithm> #include <functional> #include <numeric> using namespace std; class print{ public: print(): count(0){ } void operator()(int v){ count++; cout << v << endl; } int count; }; void test01(){ vector<int> v; for(int i=0; i< 10; i++){ v.push_back(i); ...
Java
UTF-8
9,028
2.40625
2
[]
no_license
/* * Copyright (C) 2016 Toby Scholz 2016 * * 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 prog...
Java
UTF-8
2,070
2.328125
2
[]
no_license
package com.wuk.fastorm.bean; import com.wuk.fastorm.annontation.FastormColumn; import com.wuk.fastorm.annontation.FastormTable; import com.wuk.fastorm.proxy.DefaultLastOperateFeatureFactory; import com.wuk.fastorm.proxy.LastOperateFeature; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Has...
Java
UTF-8
738
1.664063
2
[]
no_license
package com.viewnext.admin.servicio; import java.util.List; import com.viewnext.admin.bean.BusquedaLibro; import com.viewnext.admin.bean.Categoria; import com.viewnext.admin.bean.FiltroBusqueda; import com.viewnext.admin.bean.Libro; import com.viewnext.admin.bean.RespuestaBusqueda; public interface Catalog...
Python
UTF-8
2,179
2.640625
3
[]
no_license
#!/usr/bin/env python import rospy import roslib from sensor_msgs.msg import Image from cv_bridge import CvBridge, CvBridgeError import cv2 import numpy as np import copy class Camera: def __init__(self): print('Camera Initialized') self.bridge_ros2cv = CvBridge() self.image = None ...
Java
UTF-8
8,739
2.5
2
[]
no_license
package Application; /** * @author jmalafronte * Controls all GUIs */ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Arrays; import java.util.Comparator; import java.util.EventObject; import java.util.Observable; import java.util.Observer; import java.util.concurrent.Time...
SQL
UTF-8
424
3.859375
4
[]
no_license
SELECT AVG(cal) FROM (SELECT M.menu_id as menu_id, SUM(MR.amount / 100 * RM.amount / 100 * MA.cal) as cal FROM menus M INNER JOIN menu_recipe MR ON M.menu_id = MR.menu_id INNER JOIN recipe_material RM ON MR.recipe_id = RM.recipe_id ...
Markdown
UTF-8
589
3.328125
3
[]
no_license
# 797. All Paths From Source to Target ## Solution 1 (time O(n*2^n), space O(n)) ```python class Solution(object): def allPathsSourceTarget(self, graph): """ :type graph: List[List[int]] :rtype: List[List[int]] """ self.ans = [] n = len(graph) def dfs(cur_n...
Markdown
UTF-8
3,013
2.734375
3
[]
no_license
# semantic-journal # Проект semantic-journal ## Сущности - Статья - Тайтл - Дата создания - Дата изменнения - Список тегов - Тег - Имя - Список тегов - Поиск - Запрос: Список тегов через запятую - Результат - Список статей которые роднятся с тегами (через граф метатегов) - Список т...
Java
UTF-8
1,679
2.84375
3
[ "Apache-2.0" ]
permissive
package com.contentful.tea.java.markdown; import org.commonmark.node.AbstractVisitor; import org.commonmark.node.Block; import org.commonmark.node.Document; import org.commonmark.node.Node; import org.commonmark.node.Paragraph; import org.commonmark.parser.Parser; import org.commonmark.renderer.html.HtmlRenderer; impo...
Shell
UTF-8
491
3.640625
4
[ "Apache-2.0" ]
permissive
#!/bin/bash set -x set -o nounset # -u FOO="FOO" #BAR="BAR" echo "FOO=$FOO" # this will fail when -u is set #echo "BAR=$BAR" # From: # http://stackoverflow.com/questions/874389/bash-test-for-a-variable-unset-using-a-function # test if a var is set or not when -u opt is set if [ ! ${!BAR[@]} ]; then echo "FALSE...
PHP
UTF-8
1,302
2.875
3
[]
no_license
<?php class Database { public function dbConnect(){ try{ $database_conn = new PDO('mysql:host=localhost;dbname=jona;charset=utf8mb4','root',''); return $database_conn; }catch(PDOException $e){ return NULL; } } } /*$username = 'developer'; $password = 'Dri@2016';*/ //var_dump($db); ...
Rust
UTF-8
5,567
2.640625
3
[ "MIT", "Apache-2.0" ]
permissive
//! An instance represents an instance of Vulkan application. use std::{ ffi::{CStr, CString}, fmt::{Debug, Error, Formatter}, ops::Deref, os::raw::c_char }; use ash::{extensions::ext::DebugUtils, vk}; use crate::{entry::Entry, memory::host::HostMemoryAllocator, physical_device::PhysicalDevice, prelude::Vrc, uti...
SQL
UTF-8
5,053
3.203125
3
[ "MIT" ]
permissive
-- -------------------------------------------------------- -- Host: 192.168.33.10 -- Server version: 5.5.52-MariaDB - MariaDB Server -- Server OS: Linux -- HeidiSQL Version: 9.4.0.5125 -- -------------------------------------------------------- /*!4...
Python
UTF-8
716
2.84375
3
[]
no_license
class Solution: def maximumMinimumPath(self, A: List[List[int]]) -> int: R, C = len(A), len(A[0]) heap = [(-A[0][0], 0, 0)] visited = [[0 for _ in range(C)] for _ in range(R)] visited[0][0] = 1 directions = [(0, 1), (1, 0), (-1, 0), (0, -1)] while heap: ...
Java
UTF-8
65,537
1.992188
2
[]
no_license
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package PeriodicTable; import java.awt.event.KeyEvent; /** * * @author MKS */ public class Silicon extends javax.swing.JFrame { /** * Creates new form Silicon */ public Silicon() { initCom...
C++
UTF-8
909
3.25
3
[]
no_license
#include <iostream> #include <string> using namespace std; int len = 0; int insert = 0; int queue[10000]; int head = 0; int push(int x) { queue[insert] = x; insert++; len++; return 0; } void pop() { if (!len) { cout << -1 << endl; return; } cout << queue[head] << endl; head++; len--; return; } void f...
Python
UTF-8
254
3.734375
4
[]
no_license
dict = {} array = [1, 7, 5, 9, 2, 12, 3] count = 0 for i in range(len(array)): for j in range(i+1, len(array)): if abs(array[i]-array[j]) == 2: dict[count] = f'{array[i]},{array[j]}' count += 1 print(len(dict))
Java
UTF-8
1,200
3.65625
4
[]
no_license
//Hassan M. Khan //Principles of Programming Languages //Lab 1 package Lab1; import java.util.*; import java.io.*; //This class will read the input file, and then return an Array of Strings, //with each element of the Array being one line of the input file. //The code for reading and writing to a file h...
Java
UTF-8
4,924
3.09375
3
[]
no_license
package oldHomeWorkAssignment; import newHomeworkAssignment.people.*; import java.util.ArrayList; public class Prog { ArrayList<User> usersAndEmployees; // общий лист ArrayList<User> peopleWithMailGmailMail; // лист для почты @gmail и @mail ArrayList<User> mailEmployeesWomen; public Prog() { ...
Java
UTF-8
2,379
2.359375
2
[]
no_license
package ru.netis.bird.develop.dialogfragment; import android.app.DialogFragment; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Toast; public class MainAc...
C++
ISO-8859-1
698
2.8125
3
[]
no_license
#include <iostream> #include <locale.h> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char** argv) { setlocale(LC_ALL,""); int notas[3]; float media; printf("\t\t Programa de notas escolares 2021!"); for(int i = 1; i <= 4; i++){ printf("\n\n ...
Python
UTF-8
186
2.796875
3
[]
no_license
import numpy as np m=np.zeros(10**3+1) for a in range(1,10**3): for b in range(1,a+1): h=(a**2+b**2)**0.5 if h%1==0 and a+b+h<=10**3: p=a+b+int(h) m[p]+=1 print(np.argmax(m))
C++
UTF-8
3,827
2.96875
3
[]
no_license
#include "catch.hpp" #include "Enum.h" #include "ItemQ1.h" #include "SaleQ1.h" #include "ItemQ2.h" #include "SaleQ2.h" #include "ItemQ3.h" #include "SaleQ3.h" #include "ItemQ4.h" #include "ItemQ5.h" #include "saleCreator.h" #include "SaleAbstractQ4.h" #include "SaleAbstractQ5.h" #include "saleCreatorQ5.h" using namesp...
Python
UTF-8
2,156
2.953125
3
[ "Apache-2.0" ]
permissive
from elasticsearch_dsl import field def test_custom_field_car_wrap_other_field(): class MyField(field.CustomField): @property def builtin_type(self): return field.Text(**self._params) assert {'type': 'text', 'index': 'not_analyzed'} == MyField(index='not_analyzed').to_dict() def t...
PHP
UTF-8
1,947
2.765625
3
[ "MIT" ]
permissive
<?php namespace Tunacan\Bundle\Controller; use Tunacan\Bundle\Component\UIComponent\CardListNode; use Tunacan\Bundle\Service\UIComponentServiceInterface; use Tunacan\MVC\BaseController; use Tunacan\Bundle\Service\CardServiceInterface; use Tunacan\Bundle\DataObject\CardDTO; class ListController extends BaseController ...
TypeScript
UTF-8
1,775
3.015625
3
[ "MIT" ]
permissive
import { State } from "state/state_system/State"; /** * This class extends the Map class to allow for state tracking * It notifies subscribers of key changes as if it where `stateProperties`. */ export class StateMap<K, V> extends State implements Map<K, V> { private map: Map<K, V> = new Map<K, V>(); publi...
Java
UTF-8
336
2.4375
2
[]
no_license
package ua.dp.mign.locale.format; import java.util.Date; import java.text.SimpleDateFormat; class PatternFormatDate { public static void main(String[] args) { String pattern = "dd-MM-yy"; SimpleDateFormat formatter = new SimpleDateFormat(pattern); System.out.println(formatter.format(new Da...
Shell
UTF-8
1,043
4.03125
4
[]
no_license
#!/bin/bash # Tell the script to fail if an attempt is made to use an un-set (null) variable. # This helps prevent accidental breakages. set -u # Tell the script to exit if any statement returns a non-true return value. # The benefit of using -e is that it prevents errors snowballing into serious # issues when they c...
Java
UTF-8
1,245
3.765625
4
[ "Apache-2.0" ]
permissive
public class Solution { public int romanToInt(String s) { if (s.length() < 1) { return 0; } int current = 0;//当前位 int pre = singleRomanToInt(s.charAt(0));//前一位 int temp = pre;//临时值 int result = 0; for (int i = 1; i < s.length(); i++) { ...
Markdown
UTF-8
8,094
3.09375
3
[]
no_license
--- layout: post title: Ruby's other ternary operator type: post published: true status: publish categories: [] tags: - Ruby author: Dan Bernier date: 2007-06-11 23:02:27.000000000 -04:00 comments: - author: Reg Braithwaite content: "This is a well known Ruby trick, but it is not exactly the same thing as the ter...
PHP
UTF-8
521
2.65625
3
[]
no_license
<?php namespace EventoOriginal\Core\Persistence\Repositories; use EventoOriginal\Core\Entities\Customer; class CustomerRepository extends BaseRepository { public function save(Customer $customer, bool $flush = true) { $this->getEntityManager()->persist($customer); if ($flush) { $t...
Markdown
UTF-8
1,110
3.28125
3
[]
no_license
# HAVING-A-BEST-FRIEND A story tells that two Friends👬 were walking through the desert🏜️. During some point of the journey they had an argument,and one friend slapped the other one in the face. The one who got slapped was hurt💔,but without saying anything, wrote in the sand; "Today my best friend slapped me in t...
Java
UTF-8
2,148
2.5
2
[ "MIT" ]
permissive
package mage.cards.a; import java.util.UUID; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.search.SearchLibraryGraveyardPutInHandEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.cons...
C++
UTF-8
3,640
3.140625
3
[ "MIT" ]
permissive
#pragma once #include <cstdint> #include <functional> #include <vector> #include "common.h" namespace pathplanner { struct PathAndCosts { Path path; float finalCosts; }; /** * @brief Weighted A* implementation */ class AStarPlanner { public: struct RoverModelConfig { /** * Signatu...
Java
UTF-8
20,432
2.171875
2
[ "Apache-2.0" ]
permissive
package controllers; import com.avaje.ebean.Ebean; import com.avaje.ebean.SqlQuery; import com.avaje.ebean.SqlRow; import models.*; import play.Logger; import play.data.*; import play.mvc.*; import views.html.*; import plugins.com.feth.play.module.pa.PlayAuthenticate; import java.lang.String; import java.util.*; imp...
C#
UTF-8
5,381
2.859375
3
[ "MIT" ]
permissive
using System.Collections.Generic; using System.Text.RegularExpressions; using TriggersTools.IO.Windows.Internal; namespace TriggersTools.IO.Windows { partial class FileFind { #region EnumeratePath /// <summary> /// Returns an enumerable collection of file paths that matches a specified search pattern /// a...
C#
UTF-8
4,492
2.515625
3
[]
no_license
using System; using System.Collections.Generic; using System.Data; using System.Data.Entity; using System.Linq; using System.Net; using System.Web; using System.Web.Mvc; using MVCELB1.Data; namespace MVCELB1.Controllers { public class HomeController : Controller { private SampleDBContext db = new Samp...
C++
UTF-8
300
2.59375
3
[]
no_license
#include<iomanip> #include<iostream> #include<vector> #include<algorithm> #include<string> #include<map> #include<math.h> using namespace std; int summ(int a[],int pos) { if(size==1) return a[size-1]; return max(summ(a,pos),summ(a,pos+1)) } int main() { int a[5] = {}; summ(a,0); }
Shell
UTF-8
4,232
3.609375
4
[]
no_license
#!/bin/sh CAT="/bin/cat" CHMOD="/bin/chmod" MKDIR="/bin/mkdir" TOUCH="/usr/bin/touch" github_base='https://raw.githubusercontent.com/' repo_path='PeterDaveHello/Unitial/master/' os="$(uname)" if [ "$os" = "FreeBSD" ]; then ECHO="echo" ${ECHO} -e "\n\e[1;36;40mYour operating system is $os\n\e[0m" ${ECHO} -e "\n...
Markdown
UTF-8
1,058
2.875
3
[]
no_license
### Python dir(对象) , 遍历对象属性 对象.__dict__ 对象的字典键值对 vim : i 插入 :+W+Q 关闭当前文件 #coding:utf-8 告诉Python解释器 当前文件 编码格式 Python 创建类是 class Foo (object) 里面有object 说明是新式类, 否则是jiushilei cookie 以键值对的格式 存储在浏览器当中的一段文本信息 , 再次请求这个网站时这个cookie信息就会自动加到请求报文的头里面发送到服务器里面 ​ break/continue只能用在循环中,除此以外不能单独使用 break/continue在嵌...
Python
UTF-8
1,499
2.921875
3
[]
no_license
#!/usr/bin/env python3 from Model.loader import get_all_lm from Model.loader import load_fastai_lm from abc import abstractmethod, ABCMeta import logging class LanguageAdapter(metaclass=ABCMeta): """Base adapter for language model to enable using models trained in different frameworks""" def __init__(self): ...
Shell
UTF-8
1,513
2.796875
3
[]
no_license
#!/bin/bash METHOD="Partition" EPSILON=10 PARTITIONS=1 CORES=1 CAPACITY=250 LEVELS=5 DEBUG="" while getopts "m:e:p:c:a:f:l:n:t:u:d" OPTION; do case $OPTION in m) METHOD=$OPTARG ;; e) EPSILON=$OPTARG ;; p) PARTITIONS=$OPTARG ;; c) CORES=$OPTARG ;; ...
Markdown
UTF-8
1,219
2.59375
3
[]
no_license
# Employee-CRUD-Application-Using (REACT-js & SpringBoot) # Instructions to Run the application: # Softwares Needed are: 1. Spring Tool Suit 4 or Eclipse for running the JAVA SPRING MVC application(backend). 2. Postman for testing the server API. 3. Node js & React framework for the frontend. 4. Editor of you...
JavaScript
UTF-8
867
2.953125
3
[]
no_license
var heaDer = document.getElementById('header'); /* The first */ var sizeBrowser = window.innerWidth; var headerFix = document.getElementsByClassName('header__fix'); var checkClass = headerFix.length; if ((sizeBrowser < 1024) && (checkClass == 0)) { heaDer.classList.add('header__fix'); } if ((sizeBrowser >= 1024)...
Markdown
UTF-8
643
2.8125
3
[ "MIT" ]
permissive
# Backbone-Weather-App Backbone.js Weather A Backbone.js app that grabs live weather data. This is an example of what I can make using Backbone.js and was created to get some more experience integrating it with a live API. It uses Backbone.js, Underscore.js, Open Weather Maps API, the Google Static Maps API, and Ba...
C
UTF-8
1,784
3.609375
4
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <limits.h> #include <time.h> #include <assert.h> typedef struct { unsigned int n_rows; double* elements; } t_asm; //short for anti symmetric matrix //maping formula: col+row*n_rows - (row+1)(row+2)*0.5 double getElement(t_asm m, unsigned int r, u...
Java
UTF-8
1,351
2.609375
3
[]
no_license
package com.tienda.productos.testDominio; import com.tienda.productos.dominio.modelo.entidad.Categoria; import com.tienda.productos.dominio.modelo.entidad.Producto; public class ProductoDataBuilder { private static final Long ID=1l; private static final String NOMBRE="TENIS"; private static final String ...
Python
UTF-8
1,940
3.203125
3
[]
no_license
# **************************************************************************** # # # # ::: :::::::: # # operations.py :+: :+: :+: ...
Python
UTF-8
1,798
3.984375
4
[]
no_license
def checkPossibility(nums=[4,2,5,4]): ''' Because of the condition nums[i] <= nums[i+1], we iterate through array and have knowledge of two parts: 1.following Increasing order(Non decreasing) element (start from the left) 2. unknown ordering (start at the current i) On the left checked part, we hav...
C++
UTF-8
2,745
3.15625
3
[]
no_license
#pragma once #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> class Camera { glm::vec3 position; glm::vec3 target; glm::mat4 viewMatrix; void updateViewMatrix() { viewMatrix = glm::lookAt(position, target, glm::vec3(0.0f, 1.0f, 0.0f)); } public: Camera() {}; Camera(glm::vec3 position, glm::vec3 t...
Python
UTF-8
5,683
2.828125
3
[]
no_license
import os import subprocess import codecs # codecs.open() handles unicode import datetime CURRDIR = os.getcwd() + '/' DEFCOLOR = 'COLOR_LIGHT_BLUE' C_N = '$none' C_LG = '$lgreen' C_G = '$green' C_B = '$blue' C_LB = '$lblue' C_R = '$red' C_GY = '$gray' C_P = '$purple' C_LP = '$lpurple' C_Y = '$yellow' #-------------- F...
JavaScript
UTF-8
876
3.4375
3
[]
no_license
// BOX // Map is a type of composition. // Composition is good at unnesting expressions. // Box is not always better, use it as it fits. const Box = (x) => ({ map: fn => Box(fn(x)), fold: fn => fn(x), inspect: () => `Box(${x})` }) const moneyToFloat = (str) => Box(str) .map(s => s.replace(/\$/g, '')) ....
Python
UTF-8
1,039
3.0625
3
[]
no_license
class Solution(object): def rotatedDigits(self, N): """ :type N: int :rtype: int """ def isMagic(n): lstn = [int(i) for i in str(n) ] #print "isMagic lstn",lstn for i in range(len(lstn)): if lstn[i] == 3 or lstn[i] == 4 or l...
Python
UTF-8
1,084
3.640625
4
[]
no_license
#.................................................. # OOP_magic_method : #.................................................. # Everything in python is an object # __init__ called automatically when instantiated class # self.__class__ the class to which class instance belong # __str__ gives a human readable output of th...
Java
UTF-8
16,280
3.078125
3
[]
no_license
package edu.sapi.mestint; import java.util.Scanner; public class Amoba { public static int X; public static int O; public static int EMPTY; private int n; private int line; private int[][] table = new int[][] { new int[]{0, 0, 0, 0, 0, 0, 0, 0}, ...
Java
UTF-8
610
2.171875
2
[]
no_license
package org.denis.wix.test.pageobject; import java.util.List; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; public class GoogleResults { @FindBy(css="div.g div.rc h3 > a") private List<WebElem...
C++
UTF-8
263
2.578125
3
[]
no_license
#include <iostream> using namespace std; int main() { int nomor = 0; cout<<"contoh for\n"; cout<<"oleh ADE NEVIYANI\n\n"; cout<<"tampilkan perhitungan sampai : "; cin>>nomor; for(int i=1;i<=nomor;i++){ cout<<i<<endl; } return 0; }
Java
UTF-8
1,358
3.09375
3
[]
no_license
package lt_500_599; import java.util.HashSet; import java.util.Set; /** * [547] Friend Circles * union-find */ public class LC_547 { /** * union-find * @param friends * @param id * @return */ private int topFriends(int[] friends, int id) { if (friends[id] == id) { ...
Java
UTF-8
779
2.28125
2
[]
no_license
package domain.mediator.patient; import java.io.IOException; import java.rmi.Remote; import java.rmi.RemoteException; import java.util.ArrayList; import domain.model.patient.Patient; public interface RemotePatientModel extends Remote { public void LoadFromDB(String name) throws IOException, RemoteExceptio...
Markdown
UTF-8
887
2.515625
3
[]
no_license
# CCI-Computational-Environments Unit 6 Exam Guided Frequencies is a virtual environment built with Three.js to help people relax, practice mindfulness and meditation. It uses PoseNet a machine learning model that uses real-time human pose estimation to allow the user to personalise their experience within the digital ...
C++
UTF-8
19,503
2.71875
3
[]
no_license
#include "chinesechesslogic.h" #include <QDebug> #define ROW 10 #define COL 9 #define NUL 0 #define RED 1 #define BLACK 2 //十行九列 // 小写黑 大写红 unsigned char arryChessBoard[ROW][COL]={ 'c','m','x','s','j','s','x','m','c', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'p', 0, 0, 0, 0, 0,'p', 0, 'b', 0,'b', 0...
Java
UTF-8
3,544
1.929688
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 zw.co.hitrac.support.business.domain.Pysch; import java.io.Serializable; import javax.persistence.Entity; import javax.persist...
C
UTF-8
1,377
2.671875
3
[]
no_license
/** * @file kernel/spinlock.c */ #include <kernel/spinlock.h> #include <kernel/sched.h> #include <kernel/proc.h> #include <arch/atomic.h> #include <arch/irq.h> #include <assert.h> /* TODO memory barriers */ static inline void __lock(struct spinlock *s) { int my_ticket; // FIXME: spinlock rely on overflow to cor...
Python
UTF-8
6,027
3
3
[]
no_license
#!/usr/bin/env python3 import re def split_line(line): return re.sub('"|\n', '', line).split(",") def get_func_indexes(schema, func): return [[schema.index(x) for x in func[y]] for y in range(2)] def FuncDep(filepath, func): schema, data = load_relation(filepath) indexes = get_func_indexes(schema, ...
Markdown
UTF-8
2,088
2.671875
3
[]
no_license
> rdkafka.h rdkafka_partition.h 1. topic_partition_list 操作 ``` // 表示一个topic+partition typedef struct rd_kafka_topic_partition_s { char *topic; /* Topic name */ int32_t partition; /* Partition */ int64_t offset; /* Offset */ void *metadata; ...
Python
UTF-8
1,199
2.921875
3
[]
no_license
from copy import copy, deepcopy def check_constraints(a): l1 = [a[0],a[1],a[2],a[3]] l2 = [a[3],a[4],a[5],a[6]] l3 = [a[6],a[7],a[8],a[0]] l4 = [a[9],a[1],a[8],a[11]] l5 = [a[9],a[2],a[4],a[10]] l6 = [a[10],a[5],a[7],a[11]] l = [l1,l2,l3,l4,l5,l6] for line in l: if(sum(line)!=26 and (0 not in line))...
Java
UTF-8
5,558
1.914063
2
[ "Apache-2.0" ]
permissive
package com.redhat.demo.optaplanner; import java.io.IOException; import java.util.Properties; import com.redhat.demo.optaplanner.model.Cache; import org.infinispan.client.hotrod.RemoteCache; import org.infinispan.client.hotrod.RemoteCacheManager; import org.infinispan.client.hotrod.RemoteCounterManagerFactory; import...
Java
UTF-8
1,099
2.765625
3
[]
no_license
public class MSD { private static int R = 256; // private static String[] aux; public static String[] sort(String[] a){ return sort(a,0,a.length,0); } private static String[] sort(String[] a,int start,int end,int pos){ int N = end - start; if(N==0)return null; String[] aux = new String[N]; int[] count ...
Java
UTF-8
1,162
3.640625
4
[]
no_license
package Shildt.Collection.ThreadCol.TreadEx; class MyRun implements Runnable { Thread t; public MyRun() { t = new Thread(this); t.start(); } @Override public void run() { try { for (int i = 1; i <= 10; i++){ System.err.println(i); ...
C++
UTF-8
1,948
2.640625
3
[ "MIT" ]
permissive
/* Copyright 1995-2008 ibp (uk) Ltd. created: Mon Nov 18 12:05:02 GMT+0100 1996 Author: Lars Immisch <lars@ibp.de> */ #ifndef _INTERFACE_H_ #define _INTERFACE_H_ #include <list> #include <map> #include <sstream> #include "text.h" #include "configuration.h" class Sequencer; class InterfaceConnection : public So...
PHP
UTF-8
1,034
2.828125
3
[ "MIT" ]
permissive
<?php declare(strict_types=1); namespace BEAR\Resource; use BEAR\Resource\Exception\UriException; final class Uri extends AbstractUri { /** * @throws \BEAR\Resource\Exception\UriException */ public function __construct(string $uri, array $query = []) { $this->validate($uri); if...