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
Java
UTF-8
602
3.046875
3
[]
no_license
// n=4 // 1 // 23 // 345 // 4567 import java.util.Scanner; public class PT00024 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int count = 1; int num = 1; for (int i = 1; i <= n; i++) { int tempCount = cou...
C#
UTF-8
1,533
3.5
4
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Matrici_OOP { class Program { static void Main(string[] args) { //afisarile matricelor Matrici a1 = new Matrici(2, 2); ...
C
UTF-8
1,545
2.734375
3
[]
no_license
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* main.c :+: :+: :+: ...
Shell
UTF-8
556
3.46875
3
[ "Apache-2.0" ]
permissive
#!/usr/bin/env bash MODEL_DIR=model MODEL_FILE=mobilenet_v2_1.4_224_frozen.pb MODEL_ARCHIVE=mobilenet_v2_1.4_224.tgz MODEL_URL=https://storage.googleapis.com/mobilenet_v2/checkpoints/$MODEL_ARCHIVE if [ ! -d "$MODEL_DIR" ]; then echo "Creating model dir" mkdir model fi cd $MODEL_DIR if [ ! -f $MODEL_FILE ]...
Rust
UTF-8
2,197
3.09375
3
[ "Apache-2.0" ]
permissive
use serde::{Deserialize, Serialize}; /// Types that are supported by [Typesense](https://github.com/typesense/typesense/blob/v0.19.0/include/field.h#L8). #[derive(Debug, Serialize, Deserialize, PartialEq, Clone, Copy)] #[serde(rename_all = "lowercase")] pub enum FieldType { /// string String, /// int32 ...
Python
UTF-8
348
4.375
4
[]
no_license
# -*- coding: utf-8 -*- ''' ex050 -> Crie um programa que leia seis números e faça um soma de todos os pares. Caso o número lido seja ímpar, desconsidere-o. ''' sum = 0 for c in range(1,7): num = int(input('Digite um número: ')) if num%2 == 0: sum += num print(f'A soma dos número pares d...
Python
UTF-8
1,091
3.328125
3
[]
no_license
# coding:utf-8 #邮递员送快递,运输时间与运送次数和里程之间的关系 from numpy import genfromtxt import numpy as np from sklearn import datasets, linear_model dataPath = r"C:\Users\ning\workspace\regressionFile\Delivery.csv" #r indicates that the following characters remains the original style, do not transfer. such as "\n" represents line ...
Python
UTF-8
3,641
2.546875
3
[ "MIT" ]
permissive
import d3rlpy import numpy as np import gym import pandas as pd from d3rlpy.metrics.scorer import evaluate_on_environment from d3rlpy.algos import BC, BCQ, BEAR, CQL def poison_hopper(): dataset, env = d3rlpy.datasets.get_d4rl('hopper-medium-expert-v0') scorer = evaluate_on_environment(env) cql = CQL.from...
Shell
UTF-8
2,674
3.953125
4
[]
no_license
#!/usr/bin/env bash # BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" . "${BASE_DIR}/utils.sh" function pre_install() { if ! command -v systemctl &>/dev/null; then command -v docker >/dev/null || { log_error "$(gettext 'The current Linux system does not support systemd management....
Python
UTF-8
2,494
2.78125
3
[]
no_license
import requests from interfaceChapter.delivery_system.libs.login import Login from interfaceChapter.delivery_system.configs.config import HOST class Shop: # 1- 需要操作商铺--需要token def __init__(self, inToken): self.header = {'Authorization': inToken} # 请求头 # 2- 列出商铺 def shop_list(self, inData): ...
C++
UTF-8
4,099
2.796875
3
[ "MIT" ]
permissive
/* Copyright 2018 Ian Rankin * * 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, including without limitation the rights to use, copy, modify, merge, * publish, distri...
Python
UTF-8
13,430
3.0625
3
[ "MIT", "Apache-2.0", "LicenseRef-scancode-public-domain", "BSD-2-Clause", "CC0-1.0", "BSD-3-Clause" ]
permissive
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2020, empress development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
Java
UTF-8
11,514
2.3125
2
[]
no_license
package flappybird; import java.io.FileInputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurr...
Python
UTF-8
936
3.109375
3
[]
no_license
import sys from collections import deque def solution(): get_input = sys.stdin.readline t: int = int(get_input().strip()) for i in range(t): n: int = int(get_input().strip()) graph = [[float('inf')] * (n + 2) for _ in range(n + 2)] dist = [] for j in range(n + 2): ...
Python
UTF-8
1,850
3.609375
4
[]
no_license
# coding: utf-8 def k_least_numbers(arr, k): if k < 0: return None length = len(arr) if length <= k: return arr head, tail = 0, length - 1 n = (arr[0] + arr[-1]) / 2 idx = partition(arr, head, tail, n) while idx != k - 1: if idx > k - 1: tail = idx -...
C#
UTF-8
9,066
2.9375
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ERDBArch.Modules.PhoneBook.BLL { /// <summary> /// Provides CRUD for model object with Entity framework /// </summary> class EntityDAL { /// <summary> /// Gets all persons from DB ...
Python
UTF-8
1,365
3.21875
3
[]
no_license
import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import numpy as np from scipy import stats df = pd.read_csv('intro/data_analysis_with_pandas/automobile.csv') df.head() df.describe() df['num-of-doors'].value_counts() sns.boxplot(x='num-of-cylinders',y='price',data=df) plt.scat...
Java
UTF-8
7,420
2.0625
2
[]
no_license
/* * The MIT License * * Copyright 2014 hdunsford. * * 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, including without limitation the rights * to use, copy, modif...
C#
UTF-8
1,904
2.640625
3
[ "MIT" ]
permissive
using System; namespace Vk.Api.Schema.Common.User { /// <summary> /// Интерфейс для представления информации о карьере <see cref="IUser"/> /// </summary> public interface ICareer { /// <summary> /// Идентификатор сообщества (если доступно), /// иначе <see langword="null"/> ...
Shell
UTF-8
4,034
3.109375
3
[ "MIT", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
#!/usr/bin/env bash # # Copyright (C) 2018 TAQTIQA LLC. <http://www.taqtiqa.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option...
Markdown
UTF-8
2,052
3.125
3
[ "BSD-3-Clause", "CC-BY-SA-4.0", "CC-BY-4.0" ]
permissive
--- id: bad87fee1348bd9aec908849 title: Додавання елементів у Bootstrap Wells challengeType: 0 forumTopicId: 16636 dashedName: add-elements-within-your-bootstrap-wells --- # --description-- Наразі є декілька елементів `div` у кожному стовпчику рядка. Саме така кількість елементів є необхідною для наступного кроку. Те...
Rust
UTF-8
1,000
3.625
4
[]
no_license
pub fn step(x: f64) -> f64 { if x > 0.0 { 1.0 } else { 0.0 } } pub fn identity(x: f64) -> f64 { x } pub fn sigmoid(x: f64) -> f64 { 1.0 / (1.0 + (-x).exp()) } // Rectified Linear Unit pub fn relu(x: f64) -> f64 { if x > 0.0 { x } else { 0.0 } } pub fn ...
Java
UTF-8
913
1.789063
2
[]
no_license
package com.ecotourism.manage.product.service; import com.ecotourism.manage.common.domain.DictDO; import com.ecotourism.manage.common.utils.R; import com.ecotourism.manage.line.domain.LineManagementDO; import com.ecotourism.manage.product.domain.CarTicketDO; import org.springframework.web.multipart.MultipartFile; imp...
Java
UTF-8
785
2.40625
2
[]
no_license
package uk.ac.ebi; import org.junit.Test; import static org.junit.Assert.*; /** * Created by chojnasm on 13/06/2016. */ public class UtilsTest { @Test public void convertFlatJsonArrayToCsv() throws Exception { String inputJSON = "" + "[{\"city\":\"Cambridge\",\"elevation\":11}," + ...
Java
UTF-8
751
2.5
2
[]
no_license
package com.divus.academia.android.GC2ExemploAula2; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; import com.divus.academia.android.GC2ExemploAula2.R; public class TelaSegundaActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super...
C
UTF-8
1,749
2.84375
3
[]
no_license
#ifndef neobeewifi_h #define neobeewifi_h #include <Arduino.h> #include "neobeeTypes.h" typedef struct wifi_network { uint8_t reserved; // Wifi flags char ssid[31]; // 0-terminated name of the wifi network char password[31]; // 0-terminated password u...
Python
UTF-8
734
3.734375
4
[]
no_license
# Solved only A, B, C. # Greedy strategy is followed in this question T = int(input()) for _ in range(T): n, m = map(int, input().split()) # total games == total wins as no draws totwins = n*(n-1)//2 # AP sum of wins given to first m-1 teams: n-1 + (n-2) + (n-3).. + (n-m+1) # Formula: n(...
Java
UTF-8
5,929
2.015625
2
[]
no_license
package com.example.payapp; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; import android.widget.Toast; import androidx.annota...
Shell
UTF-8
523
2.875
3
[]
no_license
#!/bin/bash nomeModulo="iicRaspberry.ko" if [ -z "$I2C_ATIVADO" ] then echo "Probing I2C modules" # modprobe i2c-bcm2708 # modprobe i2c-dev lsmod | grep i2c i2cdetect -y 1 export I2C_ATIVADO=1 fi cd /home/pi/iicRaspberry/ echo 8 > /sys/bus/i2c/devices/i2c-1/delete_device rmmod $nomeModulo rmmod industrialio make...
PHP
UTF-8
1,392
2.53125
3
[ "BSD-3-Clause" ]
permissive
<?php namespace app\models; use Yii; /** * This is the model class for table "dia". * * @property integer $dia_id * @property string $descripcion * @property string $created * @property string $updated * @property integer $createby * @property integer $updateby * @property string $active * * @property Hor...
Markdown
UTF-8
2,380
3.171875
3
[]
no_license
What is concurrency? What is parallelism? What's the difference? concurrency is when different tasks run in overlapping time. paralellism is when tasks are executed in the excact same time (needs multiple cores). Difference is paralellism is about doing several things at once, and concurrency helps deal wi...
Java
UTF-8
677
2.328125
2
[]
no_license
package com.xiaoyi.xycnews.adapter; import android.content.Context; import com.xiaoyi.xycnews.bean.RobotMSGBean; import com.zhy.adapter.recyclerview.MultiItemTypeAdapter; import java.util.List; /** * Created by 徐宜程 on 2017/2/28. */ public class RobotAdapter extends MultiItemTypeAdapter<RobotMSGBean> { private...
Swift
UTF-8
533
4.03125
4
[ "MIT" ]
permissive
//: [Previous](@previous) import Foundation var str = "Hello, Protocol" print(str) protocol myProtocol { // defination of protocol } protocol FullName { // defination of protocol var firstName: String { get set } var lastName: String { get set } } struct name : FullName { var firstName = "" ...
Python
UTF-8
3,010
2.734375
3
[]
no_license
import re import cipher import Encryption import crack # 1a with open('./output/1a.out', 'w') as w: with open('./input/1a.in') as file: for line in file: tokens = line.split('|') tokens[0] = re.sub(r'\s', '', tokens[0]) tokens[2] = re.sub(r'\s', '', tokens[2]) ...
TypeScript
UTF-8
413
2.546875
3
[ "MIT" ]
permissive
import { Moment } from 'moment'; export interface IGradeSchoolClass { id?: number; applicationDate?: Moment; value?: number; historyId?: number; studentId?: number; } export class GradeSchoolClass implements IGradeSchoolClass { constructor( public id?: number, public applicationDate?: Moment, ...
Java
UTF-8
791
2.515625
3
[]
no_license
import org.junit.*; import static org.junit.Assert.*; import hanoi.*; import hanoi.util.*; /** * Test class plateau * * @author : Eddy El Khatib */ public class PlateauTest { @Test public void testPlateauCreation() { Plateau somePlateau = new Plateau(5); assertNotNull(somePlateau); ...
Java
UTF-8
8,063
1.976563
2
[ "Apache-2.0" ]
permissive
/* * Copyright © 2021 Apple Inc. and the ServiceTalk project authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless requi...
Java
UTF-8
143
1.734375
2
[]
no_license
package iut.ipi.runnergame.Game.Level.Loader; import iut.ipi.runnergame.Game.Level.Level; public interface LevelLoader { Level load(); }
Markdown
UTF-8
6,031
3.25
3
[]
no_license
# HTML ## HTML 속성 * 글로벌속성 : 모든 태그에 포함된 속성 <=> 지역속성 : 특정 태그에만 포함된 속성 * 필수속성 : 해당 태그에서 반드시 사용해야 하는 속성 <=> 선택속성 : 반드시 사용하지 않아도 되는 속성 * id와 class는 글로벌 속성 ```html <h1 id="title" class="main">Hello, HTML</h1> ``` ## 빈태그 * 빈 태그는 내용이 없어서 종료 태그가 필요하지 않음 ```html <br> <img src=""> <input type=""> ``` ## 텍스트 표현 태그 * b 태그 :...
Python
UTF-8
1,234
2.78125
3
[]
no_license
import logging import logging.config from argparse import ArgumentParser import yaml LOG_PATH = '/code/logging.conf.yml' with open(LOG_PATH) as config_fin: logging.config.dictConfig(yaml.safe_load(config_fin)) logger = logging.getLogger(__name__) def get_train_args(): """Parse arguments from command line"""...
Java
UTF-8
700
1.890625
2
[]
no_license
package com.avito.android.shop.list.presentation; import dagger.internal.Factory; public final class ShopListDataChangeListenerImpl_Factory implements Factory<ShopListDataChangeListenerImpl> { public static final class a { public static final ShopListDataChangeListenerImpl_Factory a = new ShopListDataChan...
C++
UTF-8
1,446
2.8125
3
[ "MIT" ]
permissive
//Language: GNU C++ #include <iostream> #include <cstdlib> #include <cstring> #include <queue> #include <vector> using namespace std; struct state { int x, y, t; vector<vector<char> > b; state(int x, int y, int t, vector<vector<char> > b) : x(x), y(y), t(t), b(b) {} }; typedef pair<int, int> pii; int main() ...
TypeScript
UTF-8
1,289
2.796875
3
[]
no_license
import * as t from 'io-ts'; import uuid from 'uuid'; import { Instrument } from '@/core/instrument/instrument'; import { Serializable } from './serializable'; import { Note, NoteType } from './scheduled/note'; const ScoreTypeRequired = t.type({ instrumentId: t.string, id: t.string, }); const ScoreTypePartial = t....
C#
UTF-8
4,454
2.640625
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Quobject.SocketIoClientDotNet.Client; using Microsoft.Kinect; using Newtonsoft.Json; namespace KinectClient { class MedianBuffer<T> { const int size = 10; private List<T> buf ...
C++
GB18030
1,240
2.890625
3
[]
no_license
#include<iostream> //#include"cyclicqueueobj.h" #include"queueprocess.h" #include"cycalgorithm.h" using namespace std; //void CycObjTest() { // CyclicQueue cycquee; // cycquee.Init(); // // for (int i = 1; i <= 99; i++) { // cycquee.InQuene(i); // } // // //Զ // cycquee.InQuene(24); // int temp; // //ɾ // for (int j...
C#
UTF-8
3,092
3.265625
3
[]
no_license
using System; using System.Collections.Generic; using System.IO; using System.Linq; namespace _TestApp_Sparkybit { public class ManipuleWithFile { public event MessageHandler FileMessage; List<string> outputFile = new List<string>(); List<string> listFile = new List<string>(); ...
Python
UTF-8
3,029
3.171875
3
[ "Apache-2.0" ]
permissive
#!/usr/bin/env python3 import tensorflow as tf import collections import math import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # import tensorflow.contrib.graph_editor as ge def normal_distribution_pdf(x, mean, sd): var = float(sd)**2 denom = (2*math.pi*var)**.5 num = math.exp(-(float(x)-float(mean))*...
Java
UTF-8
1,265
2.234375
2
[]
no_license
package com.gpualgo.service.dto; import com.gpualgo.domain.OverlockSetting; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; @Getter @Setter @Builder @AllArgsConstructor @NoArgsConstructor public class OverlockSettingDTO { priva...
TypeScript
UTF-8
251
2.65625
3
[]
no_license
enum MemberShip { Simple, Standard, Premium } const memberShip = MemberShip.Premium console.log(memberShip); enum SocialMedia { VK = 'VK', INST = 'INST', FB = 'FB' } const socialMedia = SocialMedia.VK console.log(socialMedia);
C++
UTF-8
152
2.84375
3
[]
no_license
#include <iostream> int main(int argc, const char * argv[]) { for (int x=0;x < 10;++x) // ++x VS x++ { std::cout << x; } return 0; }
Python
UTF-8
4,602
2.890625
3
[]
no_license
'''To quickly see what open positions I currently have - using my xls file "TradingJournal (FX) (2020).xlsx ''' import pandas as pd import numpy as np df = pd.read_excel(r"/Users/sanduo/Documents/Trading/TradingJournal (FX) (2020).xlsx", \ sheet_name = 'Trade Log', \ skiprows = 2)...
Python
UTF-8
2,462
2.609375
3
[]
no_license
import http.server import socketserver import http.client import json PORT = 8002 # HTTPRequestHandler class class serverRequestHandler(http.server.BaseHTTPRequestHandler): # GET def do_GET(self): r_web = self.path #request from web page print(r_web) if 'label' in r_web or 'limi...
JavaScript
UTF-8
1,303
3.171875
3
[ "MIT" ]
permissive
'use strict' // exposes an async function suitable for profiling module.exports = someCodeToBeProfiled const createDeferred = require('../lib/deferred') async function someCodeToBeProfiled (options = {}) { const { verbose = false, count = 5, delay = 10 } = options const log = verbose ? consoleLog : () => {} ...
C++
UTF-8
860
3.421875
3
[]
no_license
#include <iostream> using namespace std; string a (int arabic) //arabico a romano { string roman=""; //resultado for(int i=1; i<=3 && arabic>0; i++, arabic/=10) { char ten,five,one; switch(i) { case 1: ten='X'; five='V'; one='I'; break; case 2: ten='C'; five='L'; one='X'; break; case 3: ten='M'; fi...
Markdown
UTF-8
4,990
3.3125
3
[]
no_license
> layout其实分为`el-row`和`el-col`,也就是行和列 先头脑风暴一下,如果要你设计一个layout组件,可能要实现什么样的功能呢? 1. 要**基础布局**吧 2. 分栏太紧了,支持配置**分栏间隔**就好了 3. 有些分栏我希望可以横跨几个块,有没有**混合布局** 4. 有些分栏我不需要顶格,想要一点**偏移** 5. 分栏有时想要左浮,右浮和居中。那也得有**对齐方式** 6. 最好在浏览器缩放时,能支持**响应式布局** 带着这些点去看代码~ #### 函数式组件 首先`el-row`和`el-col`都是函数式组件,也就是说是没有`template`的,全靠`render`来渲染函数 ...
C#
UTF-8
3,549
2.859375
3
[]
no_license
using System; using System.Collections.Generic; using System.Windows; using System.Windows.Media; using System.Windows.Shapes; namespace LinearRegressionLeastSquaresCriterion { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { ...
Python
UTF-8
1,967
3.90625
4
[]
no_license
"""Solution to problem 105 It's a pretty simple solution: For each set, I go from longest possible subsets to smallest lengths. I get all combinations and take the sum. If I already have a subset with the sum, I check if they are disjoint. If they're not, I continue, if they are, the test fails. For the second condi...
PHP
UTF-8
705
2.890625
3
[]
no_license
<?php // to start the session. session_start(); // to include the required file require_once 'user.php'; // crate new connection object $conn = new user(); if(isset($_POST['submit'])) { $username = $_POST['user']; $password = $_POST['pass']; $check = $conn->login($username, $password); // to make sure if the co...
Java
UTF-8
473
2.28125
2
[]
no_license
package com.example.swebnb.ui.communicate; import androidx.lifecycle.LiveData; import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.ViewModel; public class CommunicateViewModel extends ViewModel { private MutableLiveData<String> mText; public CommunicateViewModel(){ mText = new Mut...
C#
UTF-8
12,416
2.546875
3
[]
no_license
namespace ZetaHelpDesk.Main.Code.DBObjects { #region Using directives. // ---------------------------------------------------------------------- using System; using System.Data; using System.Data.OleDb; using System.Collections.Generic; using System.Text; using System.Collections; using ZetaLib.Core.Common;...
Markdown
UTF-8
10,271
3.296875
3
[ "MIT" ]
permissive
I grew up in New York City, between Harlem and the Bronx. Growing up as a boy, we were taught that men had to be tough, had to be strong, had to be courageous, dominating -- no pain, no emotions, with the exception of anger -- and definitely no fear; that men are in charge, which means women are not; that men lead, an...
Java
UTF-8
15,626
1.867188
2
[]
no_license
package com.eray.thjw.produce.control; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import net.sf.jasperreports.engine.JRDataSource; import net.sf.jasperreports.engine.data...
Java
UTF-8
1,417
2.015625
2
[]
no_license
package dk.au.cs.tapas.cfg.node; import com.intellij.psi.PsiElement; import dk.au.cs.tapas.lattice.HeapLocation; import dk.au.cs.tapas.lattice.TemporaryHeapVariableName; import dk.au.cs.tapas.lattice.TemporaryVariableName; import java.util.Set; /** * Created by budde on 4/27/15. */ public class ArrayReadLocationSe...
Swift
UTF-8
1,354
2.8125
3
[ "MIT" ]
permissive
// // DefaultTheme.swift // dopravaBrno // // Created by Thành Đỗ Long on 07/04/2019. // Copyright © 2019 Thành Đỗ Long. All rights reserved. // import Foundation import UIKit struct DefaultTheme: ThemeStrategy { var fonts: FontScheme var colours: ColourScheme var barStyle: UIBarStyle = .default ...
Java
UTF-8
48,523
1.953125
2
[ "LicenseRef-scancode-unknown-license-reference", "MIT", "UPL-1.0" ]
permissive
package org.clyze.doop.soot; import com.google.common.collect.Lists; import java.util.*; import java.util.concurrent.ConcurrentHashMap; import org.clyze.doop.common.*; import org.clyze.utils.TypeUtils; import soot.*; import soot.jimple.*; import soot.jimple.internal.JimpleLocal; import soot.jimple.toolkits.typing.fas...
Java
UTF-8
9,021
1.90625
2
[ "MIT" ]
permissive
package com.fbasegizi.statusgizi.makan; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.ProgressBar; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.appcompat.app.ActionB...
Python
UTF-8
544
3.140625
3
[]
no_license
from typing import List class Solution: def lengthOfLIS(self, nums: List[int]) -> int: if not nums: return 0 n = len(nums) dp = [1] * n result = 0 for i in range(n): for j in range(i): if nums[i] > nums[j]: dp[i] = ...
C
UTF-8
6,698
3.359375
3
[]
no_license
#include <collect/list_algos.h> #include <dbg.h> typedef int (*List_compare)(void *lhs, void *rhs); int List_bubble_sort(List *list, List_compare comparator) { // 1. for each item in the list: // a) if the item is greater than the next item, swap them // 2. repeat until a pass through the list where no swaps are ...
Python
UTF-8
2,065
2.859375
3
[]
no_license
from random import randint class Chromosome: def __init__(self, problParam): self.__problParam = problParam self.__repres = [] self.__fitness = 0.0 self.__communities=[] def initRepres(self): repres=[] for node in range(self.__problParam['noDim']): ...
Java
UTF-8
451
1.921875
2
[]
no_license
package com.example.byron.vrviewer.widget; import android.content.Intent; import android.widget.RemoteViewsService; /** * Created by Byron on 11/28/2016. */ public class WidgetService extends RemoteViewsService { @Override public RemoteViewsFactory onGetViewFactory(Intent intent) { WidgetListProv...
C
UTF-8
2,336
2.578125
3
[]
no_license
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* spaces.c :+: :+: :+: ...
Java
UTF-8
21,196
2.1875
2
[ "Apache-2.0" ]
permissive
package com.cached; import java.lang.ref.WeakReference; import java.nio.ByteBuffer; import java.nio.channels.SocketChannel; import java.util.ArrayList; import java.util.List; import java.util.concurrent.locks.LockSupport; import com.amef.AMEFObject; import com.amef.AMEFResources; public class JDBOperations { ...
Python
UTF-8
741
2.671875
3
[]
no_license
import lvgl as lv from lib.widgets.base import Base class Gauge(Base): def __init__(self, w, h, x, y, **kwargs): needle_count = kwargs.get('count', 1) needle_colors = kwargs.get('colors', [lv.color_make(0x0,0x0,0x0)]) gauge = lv.gauge(lv.scr_act(), None) gauge.set_needle_count(need...
Markdown
UTF-8
67,855
3.6875
4
[]
no_license
# 《C++ Primer Plus 6th》 《C++ Primer Plus 第六版》 的学习笔记。 ## 第1章 预备知识 C++在C的基础上增加了以类为代表的`OOP`编程、以及基于`模板`的泛型编程。 `OOP`强调数据,设计出与问题本质相对应的数据格式(即自定义数据类型),它与内置类型的使用是一样的。 - 对象、类、封装、数据隐藏、接口、多态、继承 - 多态: - 继承: 复用代码、通过对基类进行派生,产生更加契合问题的派生类,派生类继承基类已有的功能 - `OOP`的本质就是设计并且拓展自己的数据类型,让设计的类型与现实数据相匹配 泛型编程:强调独立于特定的数据类型,创建出独立于类型的代码 ## 第2章 ...
C
UTF-8
4,467
4.25
4
[]
no_license
/* * FILE: linked_list.c */ #include <stdio.h> #include <stdlib.h> #include "memcheck.h" #include "linked_list.h" /* * create_node: * Create a single node and link it to the node called 'n'. */ node * create_node(int data, node *n) { node *result = (node *) malloc(sizeof(node)); if (result == NULL...
Python
UTF-8
988
2.53125
3
[]
no_license
import xml.etree.ElementTree as ET from tqdm import tqdm from Scraper import CourseScraper, ReviewScraper SCRAPE_COURSE = False SCRAPE_REVIEW = True if SCRAPE_COURSE: courses_xmlroot = ET.parse('sitemap/courses.xml').getroot() courses_urls = [url[0].text for url in courses_xmlroot] course_scraper = Cours...
C++
UTF-8
3,884
3.390625
3
[]
no_license
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), le...
C#
UTF-8
567
2.640625
3
[]
no_license
var relatedActivities = new List<TActivity>(); bool found = false; foreach (var item in activities.OrderBy(a => a.ActivityDate)) { int count = relatedActivities.Count; if ((count > 0) && (relatedActivities[count - 1].ActivityDate.Date.AddDays(1) != item.ActivityDate.Date)) { ...
C++
WINDOWS-1251
1,736
3.296875
3
[]
no_license
#include "ShellSort.h" int main() { setlocale(LC_CTYPE, "Russian"); int n = 0, d; int k = 0;// ( ) cout<<" .\n"; cin>>n; int *a = new int[n]; int *b = new int[n]; srand((signed int)time(0)); cout<<"\n---------------------\n"; cout<<" 1) \n"; cout<<" 2) "; do { cout<<"\n ...
C
UTF-8
6,370
2.546875
3
[]
no_license
/* object operations. */ #include <jni.h> #include <jni-private.h> #include <assert.h> #include <stdlib.h> #include "compiler.h" /* for likely()/unlikely() */ #include "../java.lang/class.h" /* for fni_class_isInterface */ /* Allocates a new Java object without invoking any of the constructors * for the object. Ret...
SQL
UTF-8
1,272
3.46875
3
[]
no_license
CREATE EXTENSION IF NOT EXISTS plpythonu; CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE; DROP TYPE IF EXISTS datapoint CASCADE; DROP TYPE IF EXISTS result_type CASCADE; CREATE TYPE datapoint AS ( time TIMESTAMP WITHOUT TIME ZONE, d DOUBLE PRECISION ARRAY); CREATE TYPE result_type AS ( time TIMESTAMP WITHOUT TIME...
JavaScript
UTF-8
2,178
2.765625
3
[]
no_license
const fs = require('fs'); const ffprobe = require('ffprobe'); const ffprobeStatic = require('ffprobe-static'); const _ = require('lodash'); function sleep(time = 0) { return new Promise((resolve, reject) => { setTimeout(() => { resolve(); }, time); }) }; function getVideoSize(link) { return new Pr...
Java
UTF-8
620
1.882813
2
[]
no_license
package com.go1ove.atcrowdfunding.service.impl; import com.go1ove.atcrowdfunding.dao.TestDao; import com.go1ove.atcrowdfunding.service.TestService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.HashMap; import java.util.Map; /** * @aut...
Python
UTF-8
1,007
2.734375
3
[ "MIT" ]
permissive
# Sends binary data from AWS S3 to API Gateway via AWS Lambda function through lambda proxy integration import json import base64 import boto3 def lambda_handler(event, context): s3 = boto3.client("s3") # for lambda proxy integration bucket_name = event['pathParameters']['bucket'] file_...
Markdown
UTF-8
1,354
2.65625
3
[]
no_license
# Fedora Module Build System Plugin This plugin interacts with Fedora's Module Build System to submit new module build requests and to query the status of existing requests. For more info on MBS, please see https://fedoraproject.org/wiki/Infrastructure/Factory2/Focus/MBS # How it works This plugin currently provide...
C
UTF-8
3,618
2.890625
3
[]
no_license
/** Name : ktourXVI.c Copyright : none Author : ted perez Created : 04/22/08 0703 Revised : 04/10/16 1906 Description : knight's tour */ #include <stdio.h> #include <time.h> int Moves[512][4], sq[9][9], depth = 0, maxRows = 0, maxCols = 0, maxDepth = 0; int nrow = 0, ncol = 0, orow =...
Markdown
UTF-8
924
3.125
3
[]
no_license
# Notes from the Gynvael stream on Chip-8 VM - Usually in VMs or even older machines, you have a frame buffer, and you address a specific point like a pixel and turn it on/off, but for Sprites, you have a register which you have to set, and another set of registers which basically you say you want to place the sprite ...
Java
UTF-8
389
2.0625
2
[]
no_license
package com.antogeo.service.export; import com.antogeo.pojo.WeatherReport; import java.io.IOException; public interface ExportService { /** * Prints a txt file containing the weather report info. * * @param weatherReport The weather report object. * @throws IOException */ void expor...
Markdown
UTF-8
557
2.75
3
[]
no_license
# pdf_a4_two_months This is a simple script to create pdf file with 2 months. ![Pdf screenshot](https://upload.bessarabov.ru/bessarabov/Q2T5GyXtwro_pKrNbZLhbVhvqJw.png) ## How to use it You need to [install Docker](https://docs.docker.com/installation/). Then you need to build image: ./build And then start i...
Markdown
UTF-8
3,846
3.09375
3
[]
no_license
# Multiplayer Slider Pub Sub with AWS AppSync This is a simple project to showcase how you can use an AWS AppSync API to facilitate realtime pub/sub interactions over websockets. The demo client application (built with React) has two sliders on a web page. Whenever a user updates the value in one of the sliders, the ...
Java
UTF-8
5,334
2.1875
2
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.sg.flashcardapp.model; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgn...
C
UTF-8
3,169
3.78125
4
[]
no_license
#include "list.h" #include <stdio.h> void new_list(list *list, size_t element_size) { list->length = 0; list->element_size = element_size; list->head = NULL; list->tail = NULL; } void delete_list(list *list) { node *element = list->head; while (element != NULL) { if (list->deallocate_n...
Markdown
UTF-8
13,055
2.5625
3
[ "MIT" ]
permissive
<p align="center"> <img src="http://i.imgur.com/BjOnHzT.png" width="350"/> </p> # opsApi OpsAPI is a lightweight API/HTTP framework in Tornado which allows users to extend and prototype mid complexity API designs and process solutions -- hours not weeks. I promise. This is intended to empower systems engineers an...
Python
UTF-8
942
2.734375
3
[ "MIT" ]
permissive
import plot import model import sys import os.path as path import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import sklearn.decomposition vecs = model.load(path.realpath(sys.argv[1])) model = sklearn.decomposition.PCA() PCs = model.fit_transform(vecs) print('variance explain...
JavaScript
UTF-8
852
2.6875
3
[]
no_license
// ==UserScript== // @name Flooder // @namespace vipul // @description flood any number via freesms8 :) // @include http://www.freesms8.com/* // ==/UserScript== var number="9051950944"; // change this value to the number you want to flood var text="You will go boom in 10 seconds! " + M...
Python
UTF-8
7,052
2.5625
3
[ "MIT" ]
permissive
import iso8601 import unittest from datetime import tzinfo class ISO8601(unittest.TestCase): """Test cases for ISO 8601.""" def testIso8601Regex(self): self.assertIsNotNone(iso8601.ISO8601_REGEX.match("2006-10-11T00:14:33Z")) self.assertIsNotNone(iso8601.ISO8601_REGEX.match('2012-07-04T19:00:00')) ...
Shell
UTF-8
463
2.515625
3
[]
no_license
#!/bin/bash trap 'printf "\e[K";printf "[ \e[32mOK\e[0m ]\n";exit' 1 2 3 4 6 9 15 p=("[\e[31m*\e[0m ]" "[\e[1;31m*\e[0m\e[31m*\e[0m ]" "[\e[31m*\e[1;31m*\e[0m\e[31m*\e[0m ]" "[ \e[31m*\e[1;31m*\e[0m\e[31m*\e[0m ]" "[ \e[31m*\e[1;31m*\e[0m\e[31m*\e[0m ]" "[ \e[31m*\e[1;31m*\e[0m\e[31m*\e[0m]" "[ \e[31m...
Java
UTF-8
309
2.734375
3
[]
no_license
package decorator; abstract class DekoratorWniosek implements InterfaceWniosek { private InterfaceWniosek interfaceww; DekoratorWniosek(InterfaceWniosek interfaceww) { this.interfaceww = interfaceww; } @Override public void zloz() { interfaceww.zloz(); } }
Markdown
UTF-8
4,172
2.734375
3
[]
no_license
# Easycontroller (this is for v2 from 2023, for old version files switch to branch v1) Application for using midi-controllers in an easy and convinient way across max/msp and Openframeworks (Only for Mac users). The idea is to be able to master your midi-controller in live music and visual, independently of the platfor...
C++
UTF-8
2,101
2.65625
3
[ "Apache-2.0" ]
permissive
// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required...