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
TypeScript
UTF-8
3,206
2.90625
3
[]
no_license
import axios from 'axios'; export default class Api { static create() { return new Api(); } // static requestErrorHandler(error) { // throw Api.parseError(error); // } // static parseError(error) { // let message = error.message; // let stack = error.stack; // let errorData = error; ...
Java
UTF-8
2,666
1.9375
2
[]
no_license
/* * @Copyright: 江西金磊科技发展有限公司 All rights reserved.Notice 仅限于授权后使用,禁止非授权传阅以及私自用于商业目的。 */ package com.jeecms.front.controller; import com.jeecms.auth.service.CoreUserService; import com.jeecms.common.base.controller.BaseController; import com.jeecms.common.exception.GlobalException; import com.jeecms.commo...
Python
UTF-8
2,197
2.875
3
[]
no_license
import gym import tensorflow as tf import random import numpy as np random.seed() env = gym.make('CartPole-v1') all_times= [] for i_episode in range(20000): observation = env.reset() observations = [] actions = [] for t in range(100): # env.render() action = random.randint(0,1) o...
Markdown
UTF-8
6,659
2.8125
3
[]
no_license
<script type="text/javascript"> var head = document.getElementsByTagName('head')[0]; cssURL = '/public/liao.css'; linkTag = document.createElement('link'); linkTag.href = cssURL; linkTag.setAttribute('type','text/css'); linkTag.setAttribute('rel','stylesheet'); head.appendChild(linkTag); </s...
Java
UTF-8
1,329
1.960938
2
[]
no_license
package ru.georgeee.bachelor.yarn.dict.ya; import com.google.gson.annotations.SerializedName; import lombok.Getter; import lombok.Setter; import java.util.List; @Getter @Setter public class LookupResponse { private List<Def> def; @Getter @Setter public static class Def { private String text;...
Markdown
UTF-8
1,700
2.515625
3
[]
no_license
--- title: Serverless Cheatsheet category: cloud tags: python dotNET --- # Serverless Cheatsheet [Serverless home page](https://serverless.com/) ## Install ```bash npm install -g serverless ``` ## Examples [Serverless Examples](https://github.com/serverless/examples) [Serverless Starter](https://github.com/serve...
Python
UTF-8
6,349
2.578125
3
[]
no_license
# llia.keytab.registry # 2016.03.18 from __future__ import print_function import json from llia.generic import is_keytable, dump from llia.keytab.keytable import KeyTable import llia.keytab.eqtemp as eqt import llia.keytab.just as jst class KeyTableRegistry(dict): """KeyTableRegistry provides dictionary of Key...
Python
UTF-8
725
4.03125
4
[]
no_license
mystring = "My Name is Pratik" print(mystring) # Slicing print(mystring[0:]) # Starting to the End print(mystring[:5]) #Starting upto specified index print(mystring[0:6]) #From specified starting index to specified ending index print(mystring[::-1]) # Printitng the reversea a string print(mystring[0:-1:2]) # printi...
JavaScript
UTF-8
2,071
3.03125
3
[]
no_license
import React, {useState, useEffect} from 'react'; import logo from './logo.svg'; import './velha.css'; import './jogoVelha' function jogoVelha() { const empytBoard = Array(9).fill(""); const [bord, setBord] = useState(empytBoard); const [currentPlayer, setCurrentPlayer] = useState("O"); const [winner, setWinner] = ...
Markdown
UTF-8
1,680
2.875
3
[]
no_license
# Fotobox A "photobooth"-application for Raspberry Pi and dslr. It lets you capture images and sort them in albums from a web interface. I use a Raspberry Pi 3, but it will probably work on other versions as well. The site interface is in norwegian. ## Beware This program will mercilessly delete all files on your ds...
C++
UTF-8
827
3.40625
3
[]
no_license
#include <cassert> #include <mutex> #include <gtest/gtest.h> // // This example demonstrates resource acqusition in C++. // The lifetime of the guard object determines when // the mutex is being acquired and released. // auto func(std::mutex& m, int val, bool b) { auto&& guard = std::lock_guard<std::mutex>{m}; // T...
C
UTF-8
2,395
3.421875
3
[]
no_license
#include <sys/types.h> #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <time.h> const int LOADING_WIDTH = 30; int main(int argc, char *argv[]) { // check args if (argc < 2) { printf("Usage: %s [file]\n", argv[0]); return 1; } // attempt to open file FILE *file = fopen(argv[1], "...
C#
UTF-8
1,713
2.828125
3
[]
no_license
using System; using System.Diagnostics.Contracts; using Autofac; namespace GraphLabs.CommonUI.Configuration { /// <summary> IOC-контейнер </summary> internal static class DependencyResolver { /// <summary> Экземпляр IOC-контейнера </summary> public static IContainer Current ...
C++
UTF-8
1,500
2.515625
3
[]
no_license
#if !defined(_SCENE_H_) #define _SCENE_H_ #include <list> #include "Iw2DSceneGraph.h" using namespace Iw2DSceneGraphCore; using namespace Iw2DSceneGraph; class SceneManager; class Scene : public CNode { protected: unsigned int m_NameHash; bool m_IsActive; bool m_IsInputActive; SceneManager* m_Manager; int Scen...
Python
UTF-8
2,830
3.9375
4
[ "MIT" ]
permissive
"""Bass class for all objects on the game board.""" from bricks.types.point import Point class GameObject: """ Bass class for all objects on the game board. Abstract class only to be used with inheritance. Attributes ---------- top_left: Point Top left coordinate of the game objec...
C++
UTF-8
1,207
2.96875
3
[]
no_license
//----------------------------------------------------------------------------- // media-h.cc //----------------------------------------------------------------------------- #include <iostream> // std::cout std::endl #include <limits> // std::numeric_limits #include <numeric> // std::accumulate //--------------...
JavaScript
UTF-8
2,686
2.59375
3
[]
no_license
/* 1. 鼠标移入显示,移出隐藏 目标: 手机京东, 客户服务, 网站导航, 我的京东, 去购物车结算, 全部商品 2. 鼠标移动切换二级导航菜单的切换显示和隐藏 3. 输入搜索关键字, 列表显示匹配的结果 4. 点击显示或者隐藏更多的分享图标 5. 鼠标移入移出切换地址的显示隐藏 6. 点击切换地址tab 7. 鼠标移入移出切换显示迷你购物车 8. 点击切换产品选项 (商品详情等显示出来) 9. 点击向右/左, 移动当前展示商品的小图片 10. 当鼠标悬停在某个小图上,在上方显示对应的中图 11. 当鼠标在中图上移动时, 显示对应大图的附近部分区域 */ /* 1)对哪些元素绑定监听--2)对...
Markdown
UTF-8
5,669
3.078125
3
[]
no_license
+++ date = "2016-07-04T07:07:55-07:00" title = "TaskPaper + Vim + Dropbox + Editorial = GTD & Checklist Perfection" slug = "taskpaper-+-vim-+-dropbox-+-editorial-checklist-perfection" +++ I have tried worryingly many methods for tracking my personal and professional projects, some of which I have written about here b...
Java
UTF-8
22,093
1.664063
2
[]
no_license
package com.nd.hilauncherdev.app; import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFil...
JavaScript
UTF-8
762
2.890625
3
[]
no_license
//WATSON FILE IN MODELS FOLDER const ToneAnalyzerV3 = require('watson-developer-cloud/tone-analyzer/v3'); const { iam_apikey, url } = require('../config'); const toneAnalyzer = new ToneAnalyzerV3({ version_date: '2017-09-21', iam_apikey, url }); const text = 'omg what'; const analyseTone = text => { const ton...
Java
UTF-8
1,015
2.265625
2
[]
no_license
package com.lee.neihanduanzi.bean; import java.util.List; /** * Created by u on 2017/6/30. */ public class DataBeanX extends BaseBean { private boolean has_more; private int min_time; private String tip; private double max_time; private List<DataBean> data; public boolean isHas_more() { ...
Markdown
UTF-8
1,052
2.578125
3
[]
no_license
## WorkspaceApp This app allows you to signup for premier work-spaces and events, whether you need a pass for a day, a dedicated desk for your business, or an office suite for your entire company. Developed using Typescript, CSS3, HTML 5 and .NET CORE REST API. The app can perfom all the CRUD operations-for creating, ...
Python
UTF-8
905
2.75
3
[]
no_license
# -*- coding: UTF-8 -*- import requests import lxml from bs4 import BeautifulSoup # FT中文 首页内容 ft = requests.get('http://www.ftchinese.com/') source = BeautifulSoup(ft.text,"lxml"); # 获取头条文章链接 article = source.find('div',class_="XL8").find('a',class_='item-headline-link')['href'] # 每日头条文章 全文模式 newFt = requests.get('htt...
Java
UTF-8
897
3.484375
3
[]
no_license
package exer9; import java.lang.reflect.Constructor; /** * 2. 利用反射和重载完成以下功能 * 1)创建Student类,类中有属性name和age并封装属性 * 2)重载Student的构造函数,一个是无参构造并,另一个是带两个参数的有参构造,要求在构造函数打印提示信息 * 3)创建带main函数的NewInstanceTest类,利用Class类得到Student对象 * 4)通过上述获取的Class对象分别调用Student有参函数和无参函数 * @author: 86173 * @date: 2021/4/26 19:25 */ ...
C
UTF-8
12,023
2.609375
3
[ "MIT" ]
permissive
/* Catalog routines (no swapping) */ /* Translated to C: 12/10/96 at 11:37 */ /* Translator Version: 0.000 */ /* Catalog routines: . VALID_FILECHAR (c): returns TRUE if character C is valid in a filename . VALID_FILENAME (name): returns TRUE if passed filename is valid . CLEAN_FILENAME (name, fcb_na...
Python
UTF-8
750
3.328125
3
[]
no_license
"""Parse python-style keyword args from a text config file, one key-value pair per line. """ import ast from typing import Any, Dict def config_parser(fname: str) -> Dict[str, Any]: """ Args: fname (str): Name of the config file Returns: (Dict[str, Any]): Dictionary of parsed config ar...
Python
UTF-8
3,004
3.265625
3
[]
no_license
# importing needed libaries import os import csv # Getting to the file path with my needed csv. One directory backwards and then into resources PyPoll = os.path.join('..','Resources', 'PyPoll_Resources_election_data.csv') # Declaring all my needed variables and lists total_votes = 0 khan_count = 0 correy_count = 0 to...
Markdown
UTF-8
1,412
2.8125
3
[]
no_license
dcdumper ======== Adding tools to the dotcloud CLI which make it easier to do backups. ## Installation `pip install https://github.com/metalivedev/dcdumper/archive/master.zip` ## Use The first addition is `sshconf` which is super-useful for working directly with `ssh`, `scp` and `rsync` ``` $ dcdumper sshconf -A ...
Ruby
UTF-8
814
2.671875
3
[ "MIT" ]
permissive
module Groupdate class Series attr_accessor :magic, :relation def initialize(magic, relation) @magic = magic @relation = relation end # clone to prevent modifying original variables def method_missing(method, *args, &block) # https://github.com/rails/rails/blob/master/activerec...
C++
UTF-8
2,341
2.875
3
[]
no_license
#include "duckcrud.h" DuckCRUD::DuckCRUD(QObject *parent) : QObject(parent), db(nullptr), con(db), counter(1) // counter(1) { qDebug() << "called"; // Create a table in constructor and insert some default values con.Query("CREATE TABLE people(id INTEGER, name VARCHAR)"); con.Query("CREATE TABL...
C++
UTF-8
814
3.78125
4
[]
no_license
//标准库中的模板类vector< > x vector类中定义了x.size() 返回值为vector<>模板类中定义 //的vector<int>::size_type 无符号整形 unsigned //<algorithm>标准库中的算法头文件 //x.push_back(num) 将num放在向量x的末尾 x.begin() x.end()分别为向量x的第一和末尾 // #include<iostream> #include<string> #include<vector> #include<algorithm> using namespace std; int main() { typedef vecto...
Markdown
UTF-8
356
2.515625
3
[]
no_license
# Christmas Card This is a 3d representation of the popup Christmas card I made for my grandma a couple years ago. It is built with ThreeJS. I learned ThreeJS for fun one week when I was bored at work! You can zoom in and move the card around! ![Screenshot of page](https://github.com/HannahRipley17/christmascard/bl...
Java
UTF-8
1,650
1.789063
2
[ "Apache-2.0" ]
permissive
package com.guli.guliproduclt.service; import com.baomidou.mybatisplus.extension.service.IService; import com.guli.common.utils.PageUtils; import com.guli.guliproduclt.entity.CategoryEntity; import com.guli.guliproduclt.vo.Catelog2Vo; import java.util.List; import java.util.Map; /** * 商品三级分类 * * @author fry * @e...
Java
UTF-8
942
2.0625
2
[]
no_license
package tw.com.pershing.databean; import java.util.List; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name="Response") public class ETLresponse { private String msg; private List<String> logs; private String error; private String fil...
Markdown
UTF-8
1,476
2.75
3
[]
no_license
# RESTFUL-API This RestFul API project is written in C# and ASP.NET Core 2.1 using SQL Server and Entity Framework Code First a. What is required for running the project - Open from Visual Studio - Change the database Server in appsetting.json to be your server b. Steps how to run scripts that will setup database for...
Java
UTF-8
332
1.921875
2
[]
no_license
package com.whatsapp; import com.whatsapp.VoiceService.VoiceServiceEventCallback; class so implements Runnable { final VoiceServiceEventCallback a; so(VoiceServiceEventCallback voiceServiceEventCallback) { this.a = voiceServiceEventCallback; } public void run() { this.a.bufferQueue.a...
Python
UTF-8
292
4.03125
4
[]
no_license
names = ["Alice", "Charlie", "Bob"] print(sorted(names, key=len)) names.sort(key=len) print(names) # sortieren nach dem zweiten Buchstaben names.sort(key=lambda name: name[1]) print(names) def get_second_letter(name): return name[1] names.sort(key=get_second_letter) print(names)
Shell
UTF-8
418
2.515625
3
[]
no_license
#!/usr/bin/env sh # 發生錯誤時執行終止指令 set -e # 打包編譯 npm run build # 移動到打包資料夾下,若你有調整的話打包後的資料夾請務必調整 # cd dist # 部署到自定義網域 # echo 'www.example.com' > CNAME git init git add -A git commit -m 'VueCLI 切換頁面' # 部署到 https://<USERNAME>.github.io/<REPO> git push -f git@github.com:kaiachun/PetPal.git master:main cd -
Java
UTF-8
291
1.617188
2
[]
no_license
package com.yc.mapper; import java.util.List; import com.yc.entity.TempPage; import com.yc.entity.UserRole; public interface UserRoleMapper { TempPage<UserRole> findUserRoles(int page, int size); int deleteById(int id); List<UserRole> findRoleByuid(int user_id); }
C++
UTF-8
1,549
3.671875
4
[]
no_license
/* For each tree the program checks if it can be placed to the left by comparing the last position occupied by the previous tree and its height. If this cannot be done it checks if the tree can be place to the right in a similar way. The first tree can alway be placed to its left. This works...
Rust
UTF-8
878
3.984375
4
[]
no_license
fn main() { let x = 123; println!("x is {}", x); { let x = 456; println!("x is {}", x); } println!("x is {}", x); let mut y = 123; println!("y is {}", y); { y = 456; println!("y is {}", y); } println!("y is {}", y); // DOESN'T WORK: must be `...
C#
UTF-8
2,030
2.59375
3
[]
no_license
using EjemploApi.Common.Logic; using EjemploApi.DataAccess.Redis; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Threading; using System.Threading.Tasks; using System.Web.Http; namespace EjemploApi.Business.Facade.Logic.Controllers { public...
Java
UTF-8
1,255
2.515625
3
[]
no_license
package com.openclassrooms.realestatemanager; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.TextView; public class MainActivity extends AppCompatActivity { private TextView textViewMain; private TextView textViewQuantity; @Override protected void on...
SQL
UTF-8
887
3.765625
4
[]
no_license
SELECT * FROM `dreamhome-db`.staff ORDER BY fname ASC; Select salary, fname, lname, salary from staff -- Produce a list of all properties that have been views(at least once). showing only the propery number. select viewDate from viewing where viewdate >1; -- Produce a list of monthly Salaries for all staff, sho...
Swift
UTF-8
569
2.859375
3
[]
no_license
// // Photo.swift // Lots of Images // // Created by Vince Kearney on 12/06/2017. // Copyright © 2017 vince. All rights reserved. // import UIKit class Photo: NSObject { // MARK: Properties public var imageData : Data? public var imageTitle : String? public var imageIdentifier : String? o...
C#
UTF-8
1,790
2.59375
3
[]
no_license
using System.Linq; using CQSS.Promotion.DataContract; using PromotionData = CQSS.Promotion.DataContract; namespace CQSS.Promotion.DataService.PromotionSettingValidator { public abstract class ValidatorBase : IValidator { /// <summary> /// 保证 Promotion 不为空, /// 保证 Promotion 必须...
C++
UTF-8
3,143
2.921875
3
[]
no_license
// // main.cpp // 417.Pacific Atlantic Water Flow // // Created by stevenxu on 12/28/19. // Copyright © 2019 stevenxu. All rights reserved. // #include <iostream> #include <vector> using namespace std;; class Solution { vector<int> dirs = {0, -1, 0, 1, 0}; vector<vector<int>> res; vector<vector<int>> ...
Markdown
UTF-8
2,718
2.8125
3
[ "MIT", "CC-BY-4.0" ]
permissive
--- title: Una questione di equilibrio slug: giusto-mezzo dateCreated: 2022-11-15 00:11 dateUpdated: 2022-11-15 00:11 visible: true tags: - filosofia --- ## <span class="newthought">In un mondo</span> sempre più polarizzato è importate evitare estremi dogmatici. Uno strumento che ci viene in aiuto è il principio de...
C#
UTF-8
963
3.5625
4
[]
no_license
using System; using System.Collections.Generic; public class Game { public string name; public float price; public Genres genre; public List<DLC> dlcs = new List<DLC>(); public Game(string n, float p, Genres g) { name = n; price = p; genre = g; } public Game(s...
JavaScript
UTF-8
688
2.640625
3
[]
no_license
import React from 'react'; import './randomquote.scss'; export default class RandomQuote extends React.Component { generateQuote() { fetch('https://api.kanye.rest').then(response => { return response.json(); }).then(response => { response = response.quote; console.log(response); docu...
C#
UTF-8
3,036
2.703125
3
[]
no_license
using System.Collections.Generic; using System.Globalization; using System.Linq; namespace System.Web.Routing { public class DictionaryRouteValueTranslationProvider : IRouteValueTranslationProvider { public IList<RouteValueTranslation> Translations { get; private set; } ...
Markdown
UTF-8
1,699
2.703125
3
[]
no_license
Title: Personalizar y añadir color a la consola de Linux Date: 2012-06-20 15:17 Author: ramborg Category: GNU/Linux Tags: Customize Slug: personalizar-y-anadir-color-a-la-consola-de-linux Actualmente la mayoria de distribuciones de linux ya vienen con un poco de color, al menos el ls, pero a veces no. Para añadir col...
Python
UTF-8
200
2.8125
3
[]
no_license
import yaml # 读取YAML # 加载配置项 with open('python01.yaml',encoding='utf-8') as f: # 先打开文件 data = yaml.load(f.read(), Loader=yaml.FullLoader) # 全量加载 print(data)
Python
UTF-8
1,858
4.125
4
[]
no_license
import random # Password Generator Project letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y',...
Python
UTF-8
2,381
3.125
3
[ "Python-2.0", "BSD-3-Clause", "MIT" ]
permissive
import unittest import error_handling as er from test_utils import FileLike class ErrorHandlingTest(unittest.TestCase): def test_throw_exception(self): with self.assertRaisesWithMessage(Exception): er.handle_error_by_throwing_exception() def test_return_none(self): self.assertEqu...
Java
UTF-8
269
2.734375
3
[]
no_license
package training; public class Parser { public static void addToInt(int x, int y){ x = x+y; } public static void main(String[] args) { int a = 15; int y = 10; Parser.addToInt(a, y); System.out.println(a); } }
Python
UTF-8
4,589
2.796875
3
[]
no_license
#!/usr/bin/python # -*- coding: utf-8 -*- """ Plot frame differences and print YouTube Video IDs @author: ghowa """ import sys import scipy.stats import pylab import guess_language from HTMLParser import HTMLParser class MLStripper(HTMLParser): def __init__(self): self.reset() self.fed = [] ...
Markdown
UTF-8
5,078
2.703125
3
[]
no_license
## 2019.7.19 字节跳动一面 :turtle: 1. 介绍项目。 2. Redis 缓存刚删除,来了很大流量读取订单信息(直接打数据库上),怎么处理? 面试官:不删缓存,先减缓存中的数量,然后每100ms同步一次数据库。(透过缓存的请求遇到并发更改失败怎么办?只能把缓存中的数量调得比实际大一些,具体看乐观锁失败的比例,允许少量数据不一致)。 3. 一致性hash算法主要解决了什么问题?(数据均匀分布,容错性) 4. MySQL 引擎,与MyISAM的区别。 B+树, B树区别。 5. 秒杀场景中怎么迅速通知用户失败或者是成功?(市面上也有不立即通知成功的,跑小人排队那种情况) 面试官:……….....
Python
UTF-8
544
3.21875
3
[]
no_license
import sqlite3 import pandas as pd dbpath = 'test.sqlite' conn = sqlite3.connect(dbpath) while True: print('과일명 ?') fruit = input() if fruit=='x': break print('가격은 ?') price = int(input()) sql = "insert into items(name, price) values(?,?)" cur = conn.cursor() cur.execute(sql,(fru...
Java
UTF-8
361
1.984375
2
[]
no_license
package com.practice.springJPAMongo.entity; import lombok.Data; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.Document; @Data @Document(value="student") public class Student { @Id private String id; private String firstName; private String lastN...
C
UTF-8
424
3.234375
3
[]
no_license
#include <stdio.h> #include <stdlib.h> int main() { printf("Hello world!\n"); int numar; int max =-1000000; int cont; do{ scanf("%d", &numar); if(numar == -1) continue; cont++; if(numar>max) max=numar; }while(numar != -1); if (cont) printf("Cel mai mare n...
C++
UTF-8
263
2.640625
3
[]
no_license
#ifndef MAN #define MAN #include "iostream" #include "Person.h" using namespace std; class Man:public Person { public: Man(string name):Person(name) { } void goHome() { cout<<"Man:"; Person::goHome(); } }; #endif // MAN
Markdown
UTF-8
1,450
2.640625
3
[ "MIT" ]
permissive
--- layout: page title: Identifying Airplane Parts for Aeronautical Engineering subtitle: Case Study at Greater Brighton Metropolitan College permalink: /case-studies/aeronautical-engineering categories: [case_studies] --- <a data-fancybox data-type="iframe" href="https://www.thinglink.com/mediacard/106561871344251699...
Python
SHIFT_JIS
1,063
2.953125
3
[ "Unlicense" ]
permissive
# ABC154e def main(): import sys import math input = sys.stdin.readline sys.setrecursionlimit(10 ** 6) # ċA֐gȂPypyŏo n = int(input()) ns = str(n) k = int(input()) keta = len(ns) if keta < k: print(0) exit(0) # dp[i+1][smaller][j]=iڂ܂łŁAtOsmallerA0̌j ...
C#
UTF-8
3,414
3.015625
3
[]
no_license
using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.IO; namespace Gdp_problem { public class Program { private static string convertJsonPath = "../../../../data/convertcsv.json"; private static string outputPath = "../../../../../act...
Ruby
UTF-8
370
2.640625
3
[]
no_license
class Product < ActiveRecord::Base has_many :orders #Product model has_many orders--because many orders have the same product on them has_many :comments #Comments model has_many comments--because one product can have many comments or reviews validates :name, presence: true def average_rating ...
Java
UTF-8
519
2.34375
2
[]
no_license
package it.iad2.dto4; public class RichiediMessaggiDto { private String sessione; public RichiediMessaggiDto() { } public RichiediMessaggiDto(String sessione) { this.sessione = sessione; } public String getSessione() { return sessione; } public void setSessione(Strin...
Python
UTF-8
873
3.625
4
[]
no_license
import re def password(value): flag = 0 while True: if len(value) < 9: print('password length should be atleast 8 character long!') flag = 1 break elif re.search('[A-Z]',value) is None: print("password should have atleast one character capital") ...
Python
UTF-8
496
3.484375
3
[ "MIT" ]
permissive
# Runtime: 20 ms, faster than 98.27% of Python3 online submissions for Pascal's Triangle II. # Memory Usage: 13.9 MB, less than 7.69% of Python3 online submissions for Pascal's Triangle II. class Solution: def getRow(self, rowIndex: int) -> List[int]: '''memory-efficient DP: Time O(k^2) Space O(k)''' ...
Java
UTF-8
2,392
3.3125
3
[]
no_license
package bazam; import java.util.*; /** * An aggregation of all the match statistics, mapping trackID's to their respective histograms of matches. * @author Brook * */ public class MatchResults { /** The file matched for this MatchResults */ private String fileMatched; /** The results of the matching process. T...
C++
UTF-8
1,392
3.21875
3
[]
no_license
#include <gtest/gtest.h> #ifdef __cplusplus extern "C" { #endif #include "libft.h" #ifdef __cplusplus } #endif class RemoveListNodeTest: public ::testing::Test { protected: t_list list; virtual void SetUp() { init_list(&list); } virtual void TearDown() { clear_list(&list); } }; TEST_F(RemoveListNodeTest, e...
TypeScript
UTF-8
2,701
2.765625
3
[ "MIT" ]
permissive
import Phaser from "phaser"; import Monster from "./monster"; const MIN_SPEED = 200; const DRAG = 1000; const INIT_SPEED = 1500; class Spear extends Phaser.Physics.Arcade.Sprite { id: string; _angle: number; _velocity: any; _initSpeed: number; _maxSpeed: number; _wallHit: boolean; _monstersHit: Phaser.G...
Java
UTF-8
2,282
2.59375
3
[]
no_license
package net.calzoneman.TileLand.gui; import net.calzoneman.TileLand.ResourceManager; import net.calzoneman.TileLand.gfx.Font; import net.calzoneman.TileLand.gfx.Screen; import net.calzoneman.TileLand.util.Delegate; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.Display; import org.newdawn.slick.Color; publ...
PHP
UTF-8
2,645
2.515625
3
[]
no_license
<?php /** * Base module helper. * * PHP Version 5 * * @category Class * @package Symantec_NortonShoppingGuarantee * @author Symantec Corporation * @copyright 2016 Symantec Corporation, All Rights Reserved. */ /** * Class declaration * * @category Class_Type_Helper * @package Symantec_NortonShopp...
Shell
UTF-8
543
3.609375
4
[ "BSD-3-Clause" ]
permissive
#!/usr/bin/env bash SCRIPT="`pwd`/getPackageInfo.py" CLASSFILE="`pwd`/ROSGenMsg" # on my machine, messages are located in: echo "// This is an auto-generated file." >> "$CLASSFILE.h" echo "#import \"ROSMsg.h\"" > "$CLASSFILE.h" echo "// This is an auto-generated file." >> "$CLASSFILE.m" echo "#import \"$CLASSFILE....
PHP
UTF-8
2,242
2.53125
3
[]
no_license
<?php session_start(); if (isset($_SESSION['login_valid'])&&(isset($_SESSION['login_name']))): header("Location: panel.php"); endif; $startChecking=true; $con=null; if (isset($_POST['submit_login'])): if (isset($_POST['input_box'])): $input = $_POST['input_box']; for ($i=0; $i<count($input); $i++): ...
C++
UTF-8
23,453
2.5625
3
[ "MIT" ]
permissive
#include "stdafx.h" #include "Server.h" #include "SocketWrappers.h" //#include <WinBase.h> #include <string> #include <thread> #include <iostream> #include <string.h> #include <iterator> #include <fstream> #pragma comment(lib, "Ws2_32.lib") #pragma warning(disable: 4996) //using namespace std; using std::cerr; using...
Java
UTF-8
37,472
2.3125
2
[ "Apache-2.0" ]
permissive
/* * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free ...
Python
UTF-8
5,087
2.90625
3
[ "MIT", "LGPL-3.0-only", "BSD-3-Clause" ]
permissive
# -*- coding: utf-8 -*- """ Validation Utils ~~~~~~~~~~~~~~~~ :copyright: Copyright 2019 Autodesk, Inc. :license: MIT, see LICENSE for details. """ import attr NUMERIC_TYPES = (int, float) def Boolean(**kwargs): _add_validator_to_kwargs(kwargs, instance_of(bool)) return attr.ib(**kwargs) d...
Java
UTF-8
6,078
2.015625
2
[]
no_license
package com.chinamobo.ue.course.restful; import java.lang.reflect.InvocationTargetException; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.ws.rs.BeanParam; import javax.ws.rs.DefaultValue; import javax.ws.rs.GET; import javax.ws.rs.POST...
C
UTF-8
493
2.828125
3
[]
no_license
#include <stdio.h> #include "final_ex1.h" #include <math.h> #include <string.h> #include <stdlib.h> int main(){ Team Teams [POPULATION_TEAMS]; printf ("Bem vindo ao programa que analisa pontos de times.\nPor favor, insira dados dos times:\n\n"); populate_teams (Teams); //geraltable_ex2(Teams);...
Markdown
UTF-8
1,053
2.65625
3
[]
no_license
# nm-otool Toy implementation of nm & otool bsd commands. The general idea was to learn how a binary file work and how to parse it properly. These tools only support mach-o files. ## Build & run Just run `make`, it will generate `ft_nm` and `ft_otool`. #### Tests You can test nm with some system binaries by launching...
Rust
UTF-8
2,104
3.59375
4
[]
no_license
use std::thread; use std::time::Duration; fn simulated_expensive_calculation(intensity: u32) -> u32 { // ゆっくり計算します println!("calculating slowly..."); thread::sleep(Duration::from_secs(2)); intensity } fn main() { let simulated_user_specified_value = 10; let simulated_random_number = 7; ge...
C
UTF-8
375
3.59375
4
[]
no_license
#include <stdio.h> void main(){ int i,vT[10],nExiste; for(i = 0;i<10;i++){ printf("(%d/10)Digite um numero: ",i+1); scanf("%d",&vT[i]); } for(i = 0;i < 10;i++){ if(vT[i] > 50){ printf("O numero %d e maior que 50 e esta na posicao %d\n",vT[i],i); nExiste++; } } if(nExiste == 0){ pr...
JavaScript
UTF-8
2,361
2.8125
3
[]
no_license
const { response } = require("express"); const express = require("express"); const jsonfile = require('jsonfile') const fetch = require('node-fetch'); var cors = require('cors'); //create express app const app = express(); app.use(cors()); const file = 'data.json' var globalData = ''; //port at which the server will r...
Java
UTF-8
5,727
3.40625
3
[]
no_license
package UI_seminarska; import java.io.File; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Scanner; import java.util.Stack; public class Main { /** * @param filename name of the input file * @return 2d char array */ private static char[][] readFile(String fi...
PHP
UTF-8
2,840
2.75
3
[]
no_license
<?php class AalLink { var $id; var $link; var $keywords; var $medium; var $hooks = array(); function AalLink($id = '',$link,$keywords,$medium) { $this->id = $id; $this->link = $link; $this->keywords = $keywords; $this->medium = $medium; } function showAll($medium = '') { global ...
Java
UTF-8
1,263
2.515625
3
[]
no_license
package inSeongJo.aHenIntoTheWild.view; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.Image; import java.awt.Toolkit; import java.awt.image.ImageObserver; import java.awt.image.ImageProducer; import javax.swing.JLabel; import javax.swing.JPanel; public class LoadingPage exten...
Swift
UTF-8
575
3.3125
3
[ "MIT" ]
permissive
// // Monoid.swift // Pods // // Created by José Manuel Sánchez Peñarroja on 31/5/17. // // import Foundation public struct Monoid<T> { public var empty: T public var semigroup: Semigroup<T> public var combine: (T, T) -> T { return semigroup.combine } public init(empty: T, semigroup: Semigroup<T>) { s...
Rust
UTF-8
10,804
3.3125
3
[ "Unlicense" ]
permissive
use std::mem; // Day 11 - Seating System static ADJACENT_SEATS: [(isize, isize); 8] = [ (-1, 0), (-1, -1), (0, -1), (1, -1), (1, 0), (1, 1), (0, 1), (-1, 1), ]; #[derive(Copy, Clone, Eq, PartialEq)] pub enum SeatingSystem { Empty, Floor, Occupied, } impl std::str::FromStr...
SQL
UTF-8
670
3.921875
4
[]
no_license
--Câu truy vấn tương đương viết inner join SELECT distinct s.MaSach, s.TenSach FROM Sach s INNER JOIN Sach_TacGia stg ON s.MaSach = stg.MaSach WHERE stg.SoGio > 10; --cho biết tổng số giờ viết mỗi cuốn sách SELECT s.TenSach, truyvancon1.tong_so_gio_viet FROM Sach s, (SELECT stg.MaSach, SUM(stg.SoGio) AS to...
Java
UTF-8
531
1.953125
2
[]
no_license
package com.example.restapi.repository; import com.example.restapi.entity.AirCompany; import com.example.restapi.entity.Flight; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; import java.util...
JavaScript
UTF-8
1,007
3.1875
3
[]
no_license
function Device(id, name, room, properties) { this.id = id; this.name = name; this.properties = properties; this.roomID = room; } function Room(id, name) { this.id = id; this.name = name; } function HashMap() { var array = []; this.get = function get(key) { for(i = 0; i < array.length; ++i) { var obj =...
Ruby
UTF-8
589
3.796875
4
[ "WTFPL" ]
permissive
# Parent class for objects that hold cards class CardHolder attr_reader :pile def initialize @pile = [] end # Add a card to this CardHolder def append(card) @pile << card end # remove the top card from the pile def pop @pile.pop end # reveals the top card from the pile def peek ...
Java
UHC
2,595
3.671875
4
[]
no_license
package crypto; import java.util.Scanner; public class CaesarCipher { // ȣ ΰ? // ޼ ְޱ (ȣ ä ) // ȣȭ(Encryption) // (Ϲ ޼) ȣ( ޼) ٲٴ // ȣȭ(Decryption) // ȣ ǵ // Ű(key) // ȣȭ ȣȭ Ǵ // (ī̻縣) ȣ // ĺ Ű(key) ŭ ̵Ű ȣ // ȣȭ : Ű ŭ ̵Ŵ // ȣȭ : ȣ Ű ŭ ̵Ŵ // /ȣȭ // ABCDEFGHI...
Markdown
UTF-8
1,735
4.375
4
[]
no_license
# Smallest Difference In this activity you will be writing code to create a function that takes in two sorted arrays of integers. Your function should return a new two element array containing one number from each sorted array with the smallest difference. ## Instructions - Open [Unsolved/smallest-difference.js](Uns...
PHP
UTF-8
445
2.640625
3
[]
no_license
<?php namespace Admin\Controller; use Hdphp\Controller\Controller; /** * 商品详细管理控制器 */ class GoodsDetailController extends CommonController{ // 定义一个商品属性,为了全局调用 private $model; // 构造方法 public function __construct(){ // 防止父级构造方法被覆盖 parent::__construct(); // 实例化\Common\Model(命名空间)下的控制器Goods $this->model = new ...
Java
UTF-8
11,969
2.015625
2
[]
no_license
/* * Copyright (C) 2014 omar * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed i...
Java
UTF-8
594
2.359375
2
[]
no_license
package com.khtn.npuzzle.model; public class TopUserScore { private String Nickname; private int TongDiem; public String getNickname() { return Nickname; } public void setNickname(String nickname) { Nickname = nickname; } public int getTongDiem() { return TongDiem; } public void setTongDiem(int tongDiem...
Java
UTF-8
30,635
2.25
2
[]
no_license
package com.karlo.gui; import com.karlo.bl.AppointmentsHandler; import com.karlo.bl.GeneralPhysiciansHandler; import com.karlo.bl.MedicalPerscriptionsHandler; import com.karlo.bl.PatientsHandler; import com.karlo.bl.SpecialistsHandler; import com.karlo.bl.TestsHandler; import com.karlo.model.Appointment; import com.ka...