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
2,336
2.8125
3
[ "MIT" ]
permissive
package com.salama.workflow.core.util; import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.lang.reflect.InvocationTargetException; import org.apache.log4j.Logger; public class BeanUtil { private final static Logger logger = Logger.get...
JavaScript
UTF-8
1,716
3.640625
4
[]
no_license
/** * Created by pl on 5/12/15. */ //Standalone functions x=[4, 15, 6, 3]; y=[7, 1, 3, 6, 2]; function sum(x, y){ var temp = 0; for (var i in x){ temp += x[i]; } for (var j in y){ temp += y[j]; } console.log(temp); } function minimum(x){ var temp=x[0]; for (var i in x)...
C#
UTF-8
1,534
3.359375
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace AL_13_01 { class Program { static StringBuilder wynik = new StringBuilder(1000000); static void Main(string[] args) { int Q = int.Parse(Console.Rea...
C++
UTF-8
833
3.390625
3
[]
no_license
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
Python
UTF-8
3,560
2.71875
3
[ "MIT", "Elastic-2.0", "Apache-2.0", "BSD-3-Clause" ]
permissive
# # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # import inspect from abc import ABC, abstractmethod from typing import Any, Callable, Dict, Generator, List, Mapping, Tuple from airbyte_cdk.models import AirbyteStream, ConfiguredAirbyteCatalog, ConfiguredAirbyteStream, SyncMode from airbyte_cdk.sources.ut...
Python
UTF-8
515
3.0625
3
[]
no_license
class Solution(object): def longestPalindrome(self, s): """ :type s: str :rtype: int """ table = {} result = 0 for ss in s: if not table.has_key(ss): table[ss] = 1 else: table[ss] += 1 for v in ta...
Markdown
UTF-8
6,271
3.03125
3
[ "MIT" ]
permissive
# Fabric ![Project Status](https://img.shields.io/badge/status-experimental-rainbow.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/FabricLabs/fabric.svg?branch=master&style=flat-square)](https://travis-ci.org/FabricLabs/fabric) [![Coverage Status](https://img.shields.io/codecov/c/github/FabricLab...
PHP
UTF-8
13,193
2.609375
3
[ "MIT" ]
permissive
<?php namespace App\Classes\Pedidos; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; class ImportarPedidos { public function importar() { //$ORDER_ID = $this->input->post("idped"); $arquivo = "arquivoML"; //$ACCESS_TOKEN = $t...
Markdown
UTF-8
53,350
3.484375
3
[]
no_license
# 你不知道的Javascript学习笔记 ## 上册 ### 作用域和闭包 #### 引擎查询 LHS/RHS:变量在赋值操作左边(LHS)、在赋值操作右边(RHS) ```js a = 2 //LHS b = a // ..=a RHS ``` 嵌套作用域:作用域发生嵌套,引擎会在外层作用域中继续查找,直到找到或者抵达全局作用域。 #### 异常 RHS中若找不到,则抛出**ReferenceError** LHS找不到,则会在全局作用域中创建该变量,**注意!**若采用**'use strict'** (ES5中引入) 则不会创建,同样抛出**ReferenceError** RHS若查找到但进行了不合理操...
C++
UTF-8
787
3.09375
3
[]
no_license
#include "TextureManager.h" TextureManager* TextureManager::m_Instance = new TextureManager(); TextureManager::TextureManager(){} TextureManager::~TextureManager(){} TextureManager* TextureManager::getInstance(){ return m_Instance; } // Returns a textue, if the texture dont exist then try to load the texture sf::...
PHP
UTF-8
1,479
2.53125
3
[ "MIT" ]
permissive
<?php /** * TransportStatus. * * PHP version 5 * * @author Stefan Neuhaus / ClouSale */ /** * Selling Partner API for Fulfillment Inbound. * * The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network. ...
Python
UTF-8
856
3.0625
3
[]
no_license
import unittest from X18_4Sum import Solution class TestSum(unittest.TestCase): def test1(self): sol = Solution() self.assertListEqual(sorted(sol.fourSum([1, 0, -1, 0, -2, 2], 0)), sorted([ [-1, 0, 0, 1], ...
Shell
UTF-8
211
3.4375
3
[]
no_license
#!/usr/bin/bash NUM=5 target=$(($RANDOM % $NUM)) read -p "Guess the number between 1 to 5 =" guess if [[ ${guess} = ${target} ]];then echo "Correc.t you won!!" else echo "try again" fi
C
UTF-8
290
3.703125
4
[]
no_license
#include <stdio.h> #define LEN 5 int main(int argc, char **argv) { int my_array[LEN] = {1,2,3,4,5}; int size = sizeof(my_array); int len = sizeof(my_array)/sizeof(my_array[0]); printf("size of array in bytes: %d, number of elements: %d\n", size, len); return 0; }
Java
UTF-8
487
2.984375
3
[]
no_license
package aqa.core.lesson11.RomanovYevgen; public class Test { public static void main(String[] args) { Company GL = new Company("GL", "Lviv, UA", "+3805023255__"); GL.addNewEmployee("A", "+3805023255__", 700); GL.addNewEmployee("B", "+3805023255__", 450); GL.addNewEmployee("C", "+...
Go
UTF-8
1,507
3.140625
3
[]
no_license
package util import ( "net/url" "testing" "github.com/stretchr/testify/assert" ) func TestSetQuery(t *testing.T) { url1, err := url.Parse("http://example.com/foo?that=thing") assert.NoError(t, err) assert.Equal(t, "thing", url1.Query().Get("that")) SetQuery(url1, "that", "random thing") assert.Equal(t, "ran...
Markdown
UTF-8
380
2.828125
3
[]
no_license
# Aggregate When you use GROUP_BY, you can only select aggregates or columsn in the GROUP_BY #### Count - `COUNT(*)` /`COUNT(1)`counts all rows - `COUNT(column)` counts non-NULLs only ```sql SELECT COUNT(*) FROM orders GROUP BY ds; ``` #### Max Even works for strings where later in the alphabet is more #### Min...
C++
UTF-8
403
2.71875
3
[]
no_license
#include <iostream> #include <iomanip> using namespace std; //https://e-tutor.itsa.org.tw/e-Tutor/mod/programming/view.php?id=2667 int main(int argc, char *argv[]) { int x = 0; int y = 0; while(cin >> x >> y) { for(int i=1;i<=x;i++) { for(int j=1;j<=y;j++) { cout << i <<" x "<< j << " = " << i*j << e...
C#
UTF-8
3,562
2.71875
3
[ "MIT" ]
permissive
using System; using System.Numerics; using System.Runtime.CompilerServices; using Box2D.NetStandard.Common; using Math = Box2D.NetStandard.Common.Math; namespace Box2D.NetStandard.Collision.Shapes { /// <summary> /// /// The chain has one-sided collision, with the surface normal pointing to the right of the edge. ...
JavaScript
UTF-8
7,245
2.8125
3
[]
no_license
function ShellUI() { console.log("in shell"); var self = this; self.shellUserDropdown = null; self.shellNavDropdown = null; self.shellNavTab = null; self.shellToggle = null; // Breakpoint between small and large devices self.breakpoint = 899; // Throttle resize events to avoid firing a lot of resize hand...
Java
UTF-8
6,148
2.03125
2
[]
no_license
package mybaby.action; import android.app.Activity; import android.webkit.WebView; import com.umeng.socialize.controller.UMSocialService; import org.json.JSONArray; import org.json.JSONException; import org.xutils.common.util.LogUtil; import java.io.Serializable; import java.util.Map; import mybaby.Constants; impo...
Java
UTF-8
2,244
2.296875
2
[]
no_license
package sroom_pkg.ui.view; import javax.swing.*; import java.awt.event.*; public class AddSlotInterfaceDialog extends JDialog { private JPanel contentPane; private JButton buttonOK; private JButton buttonCancel; private JTextField tfInterfaceName; private JComboBox cbDeviceSlots; private JButt...
C++
UTF-8
299
2.671875
3
[]
no_license
#include<iostream> #include<vector> #include<set> #include<cmath> using namespace std; int main(){ int N; cin>>N; float n1,n2; float max=0; for(int i=0;i<N;i++){ cin>>n1>>n2; if((n1*n1+n2*n2)>max){ max= n1*n1 + n2*n2; } } float res = sqrt(max); printf("%0.2f",res); return 0; }
JavaScript
UTF-8
10,585
2.5625
3
[]
no_license
'use strict'; /** * This module provides useful functions that wrap around Sequelize to perform * certain tedious things for us. */ var debug = require('debug')('zotago:ormHelpers'); var dataHelpers = require('./dataHelpers'); var util = require('./.'); var models = require('../models'); var Promise = require('bl...
Python
UTF-8
763
2.796875
3
[]
no_license
import requests import csv import json response = requests.get("https://jsonplaceholder.typicode.com/users") users = json.loads(response.text) def flattenjson(b, delim): val = {} for i in b.keys(): if isinstance( b[i], dict ): get = flattenjson( b[i], delim ) for j in get.keys(...
C#
UTF-8
1,241
3.546875
4
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Step199_BooleanLogic { class Program { static void Main(string[] args) { Console.WriteLine("Hi, let's find out if you are qualified for our auto insurance."...
Python
UTF-8
139
3.453125
3
[]
no_license
a = int(input()) b = int(input()) c = int(input()) d = int(input()) sum = a + b + c + d m = sum % 3600 // 60 s = sum % 60 print(m) print(s)
Java
UTF-8
6,225
2.328125
2
[]
no_license
package io.walter.realmcrud; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.support.design.widget.Snackbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.wi...
Java
UTF-8
1,271
2.3125
2
[]
no_license
package com.iseven.learn.xdlearn.configuration; import com.iseven.learn.xdlearn.interceptor.CorsInterceptor; import com.iseven.learn.xdlearn.interceptor.LoginInterceptor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframewo...
JavaScript
UTF-8
8,580
2.640625
3
[]
no_license
//柱状图 比例 (function (name, definition) { // this is considered "safe": var hasDefine = typeof define === 'function'; var hasExports = typeof module !== 'undefined' && module.exports; if (hasDefine) { // AMD Module or CMD Module define(definition); } else if (hasExports) { // Node.js Module mod...
Markdown
UTF-8
5,717
2.640625
3
[ "Apache-2.0" ]
permissive
**Elasticsearch Sink** The sink reads events from a channel, serializes them into json documents and batches them into a bulk processor. Bulk processor batches the writes to elasticsearch as per configuration. The elasticsearch index and type for each event can be defined statically in the configuration file or can b...
Python
UTF-8
321
2.75
3
[]
no_license
# Written by Charlie Vrattos import pandas as pd def generateComplement(sequence): sequence.columns = ['T', 'A', 'G', 'C'] sequence = sequence[::-1].reset_index(drop=True) return sequence def main(): with open('control/GAME.json') as f: game = pd.read_json(f) generateComplement(game) if __name__ == "__main__...
Python
UTF-8
1,200
4.1875
4
[ "MIT" ]
permissive
""" Numerical integration. """ def next_step(a, b, h): x = a + h while x < (b - h): yield x x = x + h def trapezoidal(left, right, steps): """ Trapezoidal Rule: int(f) = h/2 * (f1 + 2f2 + ... + fn) :param left: left end of searching range :param right: right end of searching ...
C++
UTF-8
2,173
3.234375
3
[]
no_license
#include <iostream> using namespace std; template <typename T, int stack_size> class Stack { int top = 0; T ara[stack_size]; public: void push(T a) { if(top >= stack_size) { cout << "Error: Stack is FULL!" << endl; exit(1); } else ...
Markdown
UTF-8
3,986
2.875
3
[]
no_license
--- layout: blog-single title: Creating Grafana Annotations with InfluxDb description: When reviewing historical data it's useful to overlay a timeline of key events. Here, we'll look at creating annotations for InfluxDb Grafana visualizations. date: August 08, 2016 tags: [Monitoring, Grafana, InfluxDB] related_posts: ...
C
UTF-8
705
3.6875
4
[]
no_license
#include<stdio.h> #include<stdlib.h> struct linked{ char d; struct linked *next; }; typedef struct linked ELEMENT; typedef ELEMENT*LINK; LINK string_to_list(char s[]) { int i=1; LINK head; LINK temp; LINK head2; head=malloc(sizeof(ELEMENT)); head->d=s[0]; head2=head; while(s[i]!='\0') ...
Java
UTF-8
188
2.296875
2
[]
no_license
public class EmptyHeapException extends RuntimeException { public EmptyHeapException(){ super(); } public EmptyHeapException(String msg) { super(msg); } }
Java
WINDOWS-1252
1,656
2.40625
2
[]
no_license
package com.gc.hr.po; import org.hibernate.Hibernate; import org.hibernate.proxy.HibernateProxy; import com.gc.util.CommonUtil; /** * ù * @author hsun * */ public class RegType { private RegTypePK id; private Double no; private Integer active; public RegType() { } public RegType...
Java
UTF-8
440
1.695313
2
[]
no_license
package com.xinmiao.back.mapper; import com.xinmiao.back.domain.Img; import com.xinmiao.back.util.MyMapper; import org.apache.ibatis.annotations.ResultMap; import org.apache.ibatis.annotations.Select; import java.util.List; public interface ImgMapper extends MyMapper<Img> { @Select("select * from img where scene...
JavaScript
UTF-8
2,237
3.53125
4
[]
no_license
const input = 'uugsqrei'; const reverse = (list, index, num) => { const len = list.length; const copy = list.slice(index, Math.min(index + num, len)) .concat(list.slice(0, Math.max(0, index + num - len))) .reverse(); for (let i = 0; i < num; i++) { list[(index + i) % len] = copy[i]; } } const kno...
Java
UTF-8
546
3.4375
3
[]
no_license
import java.util.Scanner; public class A { public static void main(String[] args) { Scanner console = new Scanner(System.in); int stairs = Integer.parseInt(console.next()); int multiplier = Integer.parseInt(console.next()); int answer = 0; if (stairs %2 == 1){ answer = (stairs / 2) + 1; } else{ a...
Rust
UTF-8
2,600
3.421875
3
[]
no_license
use std::collections::HashMap; fn main() { let mut neighboring_sums: HashMap<(i64, i64), i64> = HashMap::new(); neighboring_sums.insert((0, 0), 1); for (n, (x, y)) in SquareSpiral::new().take(347992).enumerate() { let n = n + 1; let mut sum = 0; for i in x-1..x+2 { for ...
PHP
UTF-8
970
2.953125
3
[]
no_license
<?php /** * Created by IntelliJ IDEA. * User: capitanjovi * Date: 4/2/17 * Time: 2:29 PM */ class Conexion { private static $conexion; public static function abrirConexion() { if (!isset(self::$conexion)) { try { include_once "config.inc.php"; self::$c...
C++
UTF-8
1,029
3.0625
3
[]
no_license
#include<iostream> #include<future> #include<string> using namespace std; using namespace std::placeholders; namespace nm21 { double div1(double x, double y) { return x / y; } void main() { cout << "1/4=" << div1(1, 4) << endl; cout << "2/4=" << div1(2, 4) << endl; cout << "3/4=" << div1(3, 4) << endl; ...
Java
UTF-8
1,228
2.28125
2
[]
no_license
package com.demo.asm.model.location; import javax.persistence.*; import java.io.Serializable; @Entity @Table(name = "physical_location") @SequenceGenerator(name = "physical_location_seq", sequenceName = "physical_location_seq", allocationSize = 1) public class PhysicalLocation extends Location implements Serializable...
Java
UTF-8
85
1.890625
2
[]
no_license
package videogames; public interface TwoD { int mapHeight(); int mapWidth(); }
Python
UTF-8
1,206
2.828125
3
[]
no_license
""" This script provides sending emails through a configured mailserver """ import smtplib import datetime from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import config def create_mail(recipient, content): """ Create Mail from content with all necessary Headers Param...
C++
UTF-8
1,417
2.953125
3
[]
no_license
/* * LightMaterial.h * * Created on: Sep 21, 2016 * Author: colin */ #ifndef LIGHTMATERIAL_H_ #define LIGHTMATERIAL_H_ #include "RGB.h" #include "Singular.h" class Light { private: RGB rgb = RGB(-1, -1, -1); Point position = Point(); bool notAmbient = true; public: Light(); Light(double red, double g...
Java
UTF-8
3,844
2.875
3
[]
no_license
package app; import java.awt.Dimension; import java.awt.GridLayout; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; import javax.swing.JPanel; import model.Note; class Piano extends JPanel { private static final long ser...
PHP
UTF-8
743
2.734375
3
[ "MIT", "BSD-3-Clause" ]
permissive
<?php namespace AppBundle\Entity; use Symfony\Component\Validator\Constraints as Assert; class ArchivierungsUpload { /** * @Assert\NotBlank(message="Bitte Laden Sie die Archivierungsliste als CSV-Datei hoch.") * @Assert\File( * mimeTypes={ "application/csv", "text/csv", "application/vnd.ms-e...
C#
UTF-8
5,156
2.8125
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; using System.Text; using Xunit; using MathExpr.Syntax; using System.Linq; using MathExpr.Utilities; namespace MathExprTests { public class ParserTests { [Fact] public void TokenizeString() { var tokens = Tokenizer.Tokenize("a...
Java
UTF-8
5,186
2.140625
2
[]
no_license
package com.ths.domain; import java.math.BigDecimal; import java.util.Date; /** * * 同花顺的概念个股数据 * **/ public class StockThsGnInfo implements java.io.Serializable { private static final long serialVersionUID = 1L; /****/ private Long id; /**概念名**/ private String gnName; /**概念的code**/ pri...
C#
UTF-8
3,893
3.109375
3
[]
no_license
using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LinqDemo { class Program { static void Main(string[] args) { DataTable dt = ToSql.CreateDataTable(); ToSql.QueryByName(dt); ...
Markdown
UTF-8
2,565
2.65625
3
[]
no_license
# Circuito El circuito consiste en una lona blanca de PVC con una o dos líneas negras que indican la trayectoria que debe seguir el robot. Estas líneas al mismo tiempo se utilizarán como guías que el robot podrá leer para conocer su posición. La utilización de una o dos líneas en el trazado queda a elección de la orga...
Java
UTF-8
714
2.953125
3
[]
no_license
package ru.zvezdov.ocprof.chapter_4.FunctionalProgramming.Test; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.stream.Collectors; /** * Created by Dmitry on 26.06.2017. */ public class _5_Collectors_groupingBy { public static void main(String[] args) { List<String...
Markdown
UTF-8
24,707
3.875
4
[]
no_license
#PROGRAMING FOR PROBLEM SOLVING LAB PRACTICAL #MY PROGRAMS ##My Details:- **Name-** Gurjot Singh **CRN-** 1915025 **Branch-** Cse **Year-** 1st **Submitted to-** prof. Hardeep Singh Kang ####1. Hello Budding Engineers #include<stdio.h> int main() { puts("Hello Budding Engineers\n"); ret...
Python
UTF-8
657
2.671875
3
[]
no_license
import datetime import re import matplotlib.pyplot as plt NUM_PACKS_TO_REACH = 100000 PYPI = 'https://pypi.python.org/pypi' DATA = './data.txt' if __name__ == "__main__": dates = [] counts = [] re_pattern = re.compile(r'(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2}):(\d+)') with open(DATA) as data_file: ...
C#
UTF-8
3,018
2.5625
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace ProjetoForm1 { public partial class Atividade7 : Form { public A...
C++
UTF-8
520
3.015625
3
[]
no_license
#include "graph_helper.h" namespace GraphHelper { UndirectedGraph<> createLinearGraph(int nVertices) { UndirectedGraph<> result( nVertices ); for (int i = 0; i < nVertices - 1; ++i) result.add_edge(i, i + 1); return result; } UndirectedGraph<> createSimpleCycleGrap...
Java
UTF-8
379
1.8125
2
[ "Apache-2.0" ]
permissive
package com.github.devmix.sample.undertow.microservice.core; import org.glassfish.jersey.server.ResourceConfig; import javax.ws.rs.ApplicationPath; /** * @author Sergey Grachev */ @ApplicationPath("/api/*") public final class JaxRsApplication extends ResourceConfig { public JaxRsApplication() { packag...
C
UTF-8
960
3.84375
4
[]
no_license
#include <stdio.h> #define MAX 1000 int maxGCD(int m, int n) { // 求最大公约数 // 欧几里得方法计算两个数的最大公约数 if(n == 0) return m; return maxGCD(n, m % n); } int main() { int a, b, k; int al[MAX] = {}; scanf("%d %d %d", &a, &b, &k); int num = maxGCD(a, b); int j = 0; for(int i = 1; i <= num; i++){ // 优化:从最开...
Python
UTF-8
5,835
2.796875
3
[]
no_license
import pygame from pygame import * import sys import math from pyquaternion import Quaternion import examples from polytope import cross_product class Cam: def __init__(self, pos=(0,0,0), rot=(0,0,0)): self.pos = list(pos) self.rot = list(rot) self.quat = Quaternion(axis=[1, 0, 0], degrees...
Java
UTF-8
5,447
2.78125
3
[]
no_license
package com.maid; import com.maid.android.Android; import com.maid.form.FormDaftar; import com.maid.web.Web; import java.util.ArrayList; import java.util.Scanner; public class Main { Scanner scanner = new Scanner(System.in); public static void main(String[] args) { Android android = null; W...
Markdown
UTF-8
3,930
4
4
[]
no_license
# stringAndArrayMethods charAt -- returns a new string that contains a character at a specific index. Time complexity O(1) ie let sring - "i love pie" sring.charAt(1) = (space) sring.charAt(4) = v sring.charAt(2) = l charCodeAt -- returns an integer between 0 and 65535 (code tha...
Java
UTF-8
1,550
2.890625
3
[]
no_license
package com.logicalkip.bitingdeath.bitingdeath; import java.util.LinkedList; import java.util.List; import com.logicalkip.bitingdeath.bitingdeath.mapping.Zone; import com.logicalkip.bitingdeath.bitingdeath.survivor.Survivor; /** * Showing WHOM the player decided will go WHERE. * Could possibly be saved a...
PHP
UTF-8
2,405
2.515625
3
[]
no_license
<?php /** * @file * CA_Gallery admin system, which overrides the default feature settings. * * Will allow us to make visual changes to the feature without overriding the * actual feature. */ /** * Defines the menu for overriding news feature settings. * * @return * Fully formed Form API array. */ func...
PHP
UTF-8
2,399
2.625
3
[ "MIT" ]
permissive
<?php function get_featured_programs(){ if(!isset($_SESSION["programs"])){ get_programs(); } $featured = []; foreach ($_SESSION["programs"] as $program) { if($program["featured"] == '1') { $featured[$program["id"]] = $program; } } return $featured; } function generate_carousel_items(){ $output = ''; ...
Java
UTF-8
1,298
2.21875
2
[]
no_license
package indi.shine.boot.base.model; import indi.shine.boot.base.model.api.resp.PageInfo; import indi.shine.boot.base.model.search.QueryCondition; import java.util.List; public interface BaseService<T, PK> { /** * 保存 * @author xiezhenxiang 2019/6/13 * @param var1 插入数据 * @return 保存的数据 **/ ...
Java
UTF-8
2,507
2.515625
3
[]
no_license
package com.jeincrementer.incrementer; import java.util.Optional; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DataAccessException; import org.springframework.stereotype.Service; impor...
C++
UTF-8
7,246
2.671875
3
[]
no_license
// Fuzz 2 injections with 2 symbols, e.g. SELECT[XX]1[XX]FROM test; #include <iostream> #include <cstdio> #include <cstdlib> #include <string.h> #include <vector> #include <mysql.h> #include <algorithm> #include <sstream> using namespace std; #define SERVER "localhost" #define USER "root" #define PASSWORD "" #define...
Python
UTF-8
1,646
3.46875
3
[]
no_license
''' https://leetcode.com/problems/cut-off-trees-for-golf-event/ ''' class Solution(object): def cutOffTree(self, forest): """ :type forest: List[List[int]] :rtype: int """ G = forest if not G and not G[0]: return -1 m, n = len(G), len(G[0]) trees = [...
Markdown
UTF-8
1,336
2.609375
3
[ "Apache-2.0" ]
permissive
--- title: Using a multi-tenant audio gateway weight: 5 --- You can send audio input to Watson Assistant Solutions. The flow for processing audio input is different from text input. Audio input is sent from an audio device to an audio gateway component of Watson Assistant Solutions. The audio gateway uses speech-to-...
PHP
UTF-8
1,483
2.640625
3
[]
no_license
<?php /** * Created by PhpStorm. * User: Mecxi * Date: 9/24/2017 * Time: 8:41 PM */ /* custom HTTP POST */ function curlHTTPRequest($url, $params){ /* initialise curl resource */ $curl = curl_init(); /* result container, whether we are getting a feedback form url or an error */ $res...
C#
UTF-8
7,396
2.625
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using MyMvvmLib; using System.Windows.Input; using System.Windows.Forms; using System.IO; using System.Collections.ObjectModel; using System.Windows.Media; namespace Word_Wiz { public ...
JavaScript
UTF-8
3,850
3.359375
3
[ "MIT" ]
permissive
const Employee = require("../lib/employee") describe("Employee", () => { //TODO: describe initialization: constructor describe("Initialization", () => { it("should create a class with a name, id and email", () => { // arrange const name = "John Doe"; const id = 5; ...
Java
UTF-8
2,630
2.453125
2
[ "Apache-2.0" ]
permissive
/*Copyright 2014 M3Team 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 by applicable law or agreed to in writing, software distribu...
Python
UTF-8
1,668
2.6875
3
[]
no_license
from pyspark.sql import SparkSession from pyspark.sql.types import StructType,StructField,StringType,IntegerType #D:/PackUp/PySparkBasics/venv/UDM/resources/people.json spark=SparkSession.builder.appName("r").master("local").getOrCreate(); df=spark.read.json("D:/PackUp/PySparkBasics/venv/UDM/resources/people.json") df...
Markdown
UTF-8
544
2.71875
3
[]
no_license
--- goal:Connaître la syntaxe de l’allocation mémoire en C++ notions:new,delete --- Vous devez créer une fonction prenant un tableau de chaîne de caractères ainsi qu’un nombre n valant 1 par défaut. Cette fonction doit renvoyer un tableau de n cases, chacune contenant la taille de la chaîne de caractère correspondante...
C++
UTF-8
1,655
2.90625
3
[]
no_license
#pragma once #include "Order.h" #include<fstream> #include<iostream> Order::Order(int id, ORD_TYPE r_Type, REGION r_region, int dis, int arr,double mon) { ID = (id > 0 && id < 1000) ? id : 0; //1<ID<999 type = r_Type; Region = r_region; Distance = dis; ArrTime = arr; totalMoney = mon; priority = 3 * totalMoney ...
Java
UTF-8
2,026
2.421875
2
[]
no_license
/** * tzdesk系统平台 * TzHibernate * com.meh.manytomany.single * StudentMantToMany.java * 创建人:maerhuan * 时间:2016年11月21日-下午11:15:50 * 2016潭州教育公司-版权所有 */ package com.meh.manytomany.single; import java.io.Serializable; import java.util.HashSet; import java.util.Set; import javax.persistence.CascadeT...
C++
UTF-8
192
3.203125
3
[]
no_license
#include <iostream> #include <vector> int fib(int pos) { if (pos < 2) { return pos; } return fib(pos - 2) + fib(pos - 1); } int main() { std::cout << fib(4); }
PHP
UTF-8
428
2.734375
3
[ "MIT" ]
permissive
<?php if (!function_exists('starts_with') && class_exists('\Illuminate\Support\Str')) { function starts_with($haystack, $needle) { return \Illuminate\Support\Str::startsWith($haystack, $needle); } } if (!function_exists('ends_with') && class_exists('\Illuminate\Support\Str')) { function ends_w...
Python
UTF-8
416
3.40625
3
[]
no_license
def isIsomorphic(self, s: str, t: str) -> bool: cs = Counter(s) ct = Counter(t) if list(cs.values()) != list(ct.values()): return False d = {} n = len(s) for i in range(n): c = s[i] if c in d: if d[c] != t[i]: ...
C#
UTF-8
3,088
2.703125
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Models { public class Karta : Faktura { #region Properties public string Sifra { get; set; } /// <summary> /// Prodavac karte ...
Java
UTF-8
752
2.4375
2
[]
no_license
package fr.eazyender.donjon.commands; import fr.eazyender.donjon.files.PlayerEconomy; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; public class CommandMoney implements CommandExecutor { @Override public...
Java
UTF-8
694
3.0625
3
[]
no_license
package Generics; import java.util.ArrayList; import java.util.HashSet; import java.util.List; public class GenericsExample { public static void main(String[] args) { System.out.println("Number of cores=="+Runtime.getRuntime().availableProcessors()); BaseClass[] baseclassArray= new Derived...
Java
UTF-8
1,485
3.046875
3
[]
no_license
package com.testapps.wildWistEast.turn; import com.playpalgames.library.GameTurn; /** * Created by javi on 06/08/2014. */ public class TurnAction implements GameTurn { public TurnAction() { } public TurnAction(Action action, int player, int target) { this.action = action; this.player =...
Java
UTF-8
264
2.125
2
[]
no_license
package tabuleiro; public abstract class Peca { protected Posicao posicao; private Tabuleiro tabuleiro; public Peca(Tabuleiro tabuleiro) { this.posicao = null; this.tabuleiro = tabuleiro; } protected Posicao getPosicao() { return posicao; } }
Python
UTF-8
563
2.765625
3
[]
no_license
n = int(input()) mylist = [] dptable = [0]*n for _ in range(n): mylist.append(list(map(int, input().split()))) for idx in range(n): #끝나는 날 finish = mylist[idx][0]+idx-1 if idx == 0: mymax = 0 else: #지금 날까지 가장 많이 받을 수 있는 보수 mymax = max(dptable[:idx]) if finish < n: #이미 구해진 해당 날까지의 최대 보수와 ...
C++
UTF-8
313
2.953125
3
[]
no_license
#include <iostream> using namespace std; int main() { cout.setf(ios::fixed); cout.precision(2); double n; string cur; cin >> n >> cur; if (cur == "euros") { cout << n*1.254 << " dolars" << endl; } else { cout << n/1.254 << " euros" << endl; } }
JavaScript
UTF-8
1,142
3.578125
4
[]
no_license
function colorClock() { let date = new Date(); let hours = date.getHours(); let minutes = date.getMinutes(); let seconds = date.getSeconds(); if(seconds < 10) { seconds = '0' + seconds; } if(minutes < 10) { minutes = '0' + minutes; } if(hours < 10) { hours = ...
TypeScript
UTF-8
700
2.578125
3
[ "ISC" ]
permissive
import * as fs from 'fs' import * as path from 'path' import * as chalk from 'chalk' import {popsConfigTemplate} from './templates/popsConfigTemplate' export default (function () { let filePath: string = path.join(process.cwd(), 'pops.config.js') if (fs.existsSync(filePath)) { let msg: string = `${ch...
Python
UTF-8
4,926
3.15625
3
[]
no_license
# 文本分类与TensorFlow Hub from __future__ import absolute_import, division, print_function, unicode_literals import numpy as np import tensorflow as tf # !pip install -q tensorflow-hub # !pip install -q tensorflow-datasets import tensorflow_hub as hub import tensorflow_datasets as tfds print("Version: ", tf.__version__...
C#
UTF-8
895
2.796875
3
[]
no_license
using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data; namespace AltaArchive.Services { public class MultiValueConverter : IMultiValueConverter { public object Convert(object[] values, Type ...
Java
UTF-8
3,730
2.34375
2
[ "Apache-2.0" ]
permissive
package mvvm.steelkiwi.com.moviefinder.services.rest.dto.movies; import android.os.Parcel; import android.os.Parcelable; import java.util.ArrayList; import mvvm.steelkiwi.com.moviefinder.MovieFinderApp; import mvvm.steelkiwi.com.moviefinder.R; /** * Created by bohdan on 30.03.17. */ public class MovieDTO impleme...
Java
UTF-8
7,261
2.40625
2
[]
no_license
package com.vortex.cloud.ums.util.tree; import java.util.ArrayList; import java.util.Hashtable; import java.util.List; import java.util.Map; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.vortex.cloud.vfs.common.lang.StringUtil; public abstract class...
Markdown
UTF-8
334
2.828125
3
[]
no_license
# Hello-World- I'm totally new to this, I'd like to get into video game development. I am a full time student and part time worker so my time is limited. I really like playing video games and I think they are a great way to escape from the world, since I am passionate about them I believe it would be a good project to...
JavaScript
UTF-8
576
3.046875
3
[]
no_license
// to make list icon open and close nav document.getElementById('toggle-nav').addEventListener('click', function() { nav = document.getElementById('nav'); nav_is_open = window.getComputedStyle(nav, null).getPropertyValue('position') == 'relative' classes = document.getElementById('nav').className; if (n...
Java
UTF-8
199
2.640625
3
[]
no_license
package Part2; public class SimplyLinkedListNode { public int data; public SimplyLinkedListNode next; public SimplyLinkedListNode(int iData) { this.data = iData; this.next = null; } }
Python
UTF-8
310
3.15625
3
[]
no_license
import turtle import random screen = turtle.Screen() image1 ="back.gif" image2 ="front.gif" screen.addshape(image1) screen.addshape(image2) t1 = turtle.Turtle() coin=random.randint(0,1) if coin == 0: t1.shape(image1) t1.stamp() else : t1.shape(image2) t1.stamp()