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
1,231
2.109375
2
[]
no_license
package com.wisea.cultivar.supply.po; import com.wisea.cloud.model.annotation.Check; import io.swagger.annotations.ApiModelProperty; /** * 修改价格 * @author chengq * @date 2020/8/15 18:45 */ public class SerUpdateStatePo { @ApiModelProperty("服务单id") @Check(test = {"required" }, requiredMsg = "服务单id不能为空") ...
C#
UTF-8
15,500
2.640625
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Navigation; using TheManager.Comparators; namespace TheManager { public class RandomDrawingLevel : IRandomDrawing { private readonly GroupsRound _round; priv...
C++
UTF-8
1,974
3.890625
4
[]
no_license
// 251 Flatten 2D Vector // Implement an iterator to flatten a 2d vector. // For example, // Given 2d vector = // [ // [1,2], // [3], // [4,5,6] // ] // By calling next repeatedly until hasNext returns false, the order of elements returned by next should be: [1,2,3,4,5,6]. // Hint: // How many variables do you ne...
C
UTF-8
544
2.78125
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include "../ubootenv.h" static void list_bootenvs(void) { env_attribute *attr = bootenv_get_attr(); while(attr != NULL) { printf("[%s]: [%s]\n", attr->key, attr->value); attr = attr->next; } } int main(int argc, char *argv[]) { bootenv_init(); if (argc...
C++
UTF-8
3,124
3.015625
3
[]
no_license
#include "MyOthelloAI.hpp" #include <ics46/factory/DynamicFactory.hpp> #include<iostream> chenjunz::MyOthelloAI::MyOthelloAI() { } std::pair<int,int> chenjunz::MyOthelloAI::chooseMove(const OthelloGameState& state) { std::vector<std::pair<int,int>> validMoves = validMove(state); int index = 0; int dept...
C#
UTF-8
1,131
2.875
3
[]
no_license
using System; using System.Linq; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace Api.Services { public class GitService : IGitService { public async Task<string[]> GetGitRepos(string userName) { ...
Python
UTF-8
5,922
2.578125
3
[]
no_license
#!/usr/bin/python # -*- coding:utf-8 -*- from bs4 import BeautifulSoup import urllib import bs4 import requests import time import schedule import json #check mode #1: check latest by timer 3600s and if win a prize then send message to ifttt #2: check latest 30 times award number #3: just check latest award number...
JavaScript
UTF-8
1,419
3.265625
3
[]
no_license
/** * Creates a new data section - an element to display data about a professor from a certain source. * Just creating the object will not put it onto the page. To do that, you must add `dataSection.elements.main` * to the page. * * @constructor * @param {string} title The title to use to identify the section. *...
Python
UTF-8
860
2.75
3
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: lzzhang # @Date: 2018-05-14 08:29:08 # @Last Modified by: lzzhang # @Last Modified time: 2018-05-14 08:42:13 class Solution: def minPathSum(self, grid): """ :type grid: List[List[int]] :rtype: int """ if len(grid) ...
C#
UTF-8
12,325
2.640625
3
[]
no_license
/*using System; using System.Collections.Generic; using System.Linq; using System.Text; using Mars_Rover_RCU.Kinematics; using Mars_Rover_Configuration; namespace Mars_Rover_RCU.Kinematics { public class Kinematics { private int FLOffset = 0; private int RLOffset = 20; private int FRO...
Markdown
UTF-8
2,048
3.15625
3
[]
no_license
# Frontend Mentor - Testimonials grid section solution This is a solution to the [Testimonials grid section challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/testimonials-grid-section-Nnw6J7Un7). Frontend Mentor challenges help you improve your coding skills by building realistic projects. ## Ta...
Python
UTF-8
183
3.703125
4
[]
no_license
def rangefunction(startvalue,endvalue,stepvalue): for i in range(startvalue,endvalue,stepvalue): result = i ** 2 print(result, end = " ") rangefunction(2,9,2)
Java
UTF-8
235
1.898438
2
[]
no_license
import org.junit.jupiter.api.Test; /** * Created by trez_ on 9/28/2017. */ public class InitTestRobertBebber { @Test public void test() { System.out.println("This is a test for seeing if the basics works."); } }
Python
UTF-8
225
2.75
3
[]
no_license
from Utilities import utilities def prime(): try: n = int(input("Enter the nth value")) utilities.Prime(n) except ValueError: print("Enter Valid input") if __name__ == "__main__": prime()
C++
UTF-8
508
2.8125
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int main(){ unordered_set<string> strset; strset.insert("code"); strset.insert("in"); strset.insert("c++"); strset.insert("is"); strset.insert("fast"); string key = "slow"; if(strset.find(key)==strset.end()) printf("%s is not in the set....
Go
UTF-8
2,831
2.625
3
[]
no_license
package iris import ( "time" "github.com/kataras/iris/v12" "github.com/sirupsen/logrus" "github.com/tyr-tech-team/hawk/trace" "go.uber.org/zap" ) type detail struct { TraceID string `json:"traceid"` Method string `json:"method"` Path string `json:"path"` Raw string...
C++
UTF-8
2,660
2.703125
3
[]
no_license
#include<iostream> #include<cstdio> #include<vector> #include<cstring> #include<algorithm> #include<sstream> #include<map> using namespace std; class team { public: string name; string nameM; int goaldiff; int matches; int wins; int tie; int loses; int goalscored; ...
C#
UTF-8
1,080
3.0625
3
[ "MIT" ]
permissive
namespace Tests { using System; using System.Linq; using Core; using Shouldly; public class BirthdayOrderTests { private readonly Person[] _people = new[] { new Person { Name = "a", Birthday = new Birthday(4, 5) }, new Person { Na...
C++
UTF-8
927
2.6875
3
[]
no_license
class Solution{ public: vector<int> majorityElement(vector<int>& nums) { vector<int> res; int n=nums.size(); int ele1=-1,ele2=-1,c1=0,c2=0; for(int i=0;i<n;i++) { if(ele1==nums[i]) c1++; else if(ele2==nums[i]) c2++; ...
Markdown
UTF-8
1,888
2.953125
3
[]
no_license
# Homework2 - Math Library Second homework for Game Architecture. Due: Monday 2/4/19, 11:59pm In this homework you will implement parts of vector and matrix math library. See src/engine/math/ga_vec3f.h and src/engine/math/ga_mat4f.cpp. To determine if your implementation is functionally correct, the engine runs som...
C
UTF-8
590
4.1875
4
[]
no_license
/* Name-Saurav Roll-1601CS41 The aim of this program is to recursively find the min and max digits of a number. */ #include<stdio.h> #include<stdlib.h> #include<string.h> long long calcAns(long long a){ if(a/10==0){ if(a%2==0){ return 0; }else{ return 1; } } if((a%10)%2==0){ return calcAns(a/10);...
Java
UTF-8
1,289
2.34375
2
[]
no_license
package de.mdelab.sdm.interpreter.core.notifications; import java.util.Map; import de.mdelab.sdm.interpreter.core.variables.Variable; import de.mdelab.sdm.interpreter.core.variables.VariablesScope; /** * Execution of an activity has finished. * * @author Stephan Hildebrandt * * @param <Activity> * @param <Cl...
Java
UTF-8
1,695
2.6875
3
[]
no_license
package ru.eugene.java.learn.generator.builder; public class Computer { private String motherboard; private int ram; private int rom; private String chipSet; private String oc; private String videoAdapter; public Computer(String motherboard) { this.motherboard = motherboard; ...
Java
UTF-8
2,357
2.453125
2
[]
no_license
package com.tisj.tareax.adapters; import android.app.Activity; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.TextView; import com.tisj.tareax.R; import com.tisj.tareax.modelo.Teoric...
C++
UTF-8
913
2.890625
3
[]
no_license
#pragma once #include<iostream> #include<vector> #include<string> #include<algorithm> #include<unordered_map> #include<unordered_set> #include<queue> using namespace std; vector<vector<int>> levelOrderBottom(TreeNode* root) { vector<vector<int>> result; if (!root) { return result; } queue<TreeNode*>q; stack<vect...
Shell
UTF-8
296
2.96875
3
[]
permissive
# SPDX-License-Identifier: BSD-3-Clause # skip if tcti-cmd not installed pkg-config --exists tss2-tcti-cmd if [ $? -ne 0 ]; then exit 077 fi source helpers.sh start_up random="$(tpm2 getrandom -T"cmd:tpm2 send" --hex 32)" count="$(echo -n "$random" | wc -c)" test "$count" -eq 64 exit 0
C#
UTF-8
3,722
2.578125
3
[]
no_license
using tabuleiro; namespace xadrez { class Dama : Peca { public Dama(Tabuleiro tabuleiro, Cor cor) : base(tabuleiro, cor) { } public override string ToString() { return "D"; } public override bool[,] movimentosPossiveis() { bool[,] mat =...
Java
UTF-8
1,391
2.03125
2
[]
no_license
package cn.cntv.app.ipanda.db.entity; // THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS // KEEP INCLUDES - put your custom includes here // KEEP INCLUDES END /** * Entity mapped to table "livechina_chinnel". */ public class LiveChinaChannelEntity { private String title; private St...
C++
UTF-8
649
2.5625
3
[ "BSD-3-Clause" ]
permissive
#include "MultipleKernels.h" #include "hlslib/xilinx/Stream.h" void FirstKernel(uint64_t const *memory, hlslib::Stream<uint64_t> &stream, int n) { #pragma HLS INTERFACE m_axi port=memory offset=slave bundle=gmem0 #pragma HLS INTERFACE axis port=stream for (int i = 0; i < n; ++i) { #pragma HLS PIPELINE II=1 ...
C
ISO-8859-1
528
3.25
3
[]
no_license
#include <stdio.h> #include <stdlib.h> int main (){ /*E nescessaro uma string para ler a string dentro do arquivo porem se ela no for do mesmo tamanho que a do arquivo ela nao ira exibir tudo*/ char str[20]; FILE *f; f = fopen("arquivo006.txt","r"); if (f == NULL){ printf("Ocorreu um problema com o arquivo, ...
C++
UTF-8
1,268
2.78125
3
[]
no_license
#pragma once #include "LinkNode.h" #include "Item.h" class linkList { private: linkNode* head; //Points to the head node in the list linkNode* tail; //Points to the tail node in the lsit linkNode* current; //points to the current node in the list linkNode* middle; int itemCount; public: //Cons...
Python
UTF-8
14,041
2.828125
3
[]
no_license
import torch import torch.nn as nn import torch.nn.functional as f from torchsummary import summary device = 'cuda' if torch.cuda.is_available() else 'cpu' class Generator(nn.Module): """ Class representing the Generator network to be used. """ VALID_OUT_FRAMES = (8, 16) def __init__(self, in_c...
Java
UTF-8
9,061
1.742188
2
[]
no_license
package view; import java.io.ByteArrayInputStream; import java.io.OutputStream; import javax.faces.context.FacesContext; import oracle.adf.model.BindingContext; import oracle.adf.model.binding.DCIteratorBinding; import oracle.adf.view.rich.component.rich.data.RichTable; import oracle.adf.view.rich.context.AdfFacesC...
C++
UTF-8
756
2.78125
3
[]
no_license
#include "catch.hpp" #include "../FileIterator/FileIterator.hpp" const std::string fileName("/Users/mac/Desktop/Iterators/Iterators/Tests/task.in"); TEST_CASE("FileIterator check", "[FileIterator]") { FileIterator* it = new FileIterator(fileName); SECTION("Constructor test") { REQUIRE(it->get() =...
Java
UTF-8
8,338
1.710938
2
[]
no_license
package com.ss.android.ttve.monitor; import android.text.TextUtils; import com.meituan.robust.PatchProxy; import com.ss.android.medialib.log.d; import com.ss.android.vesdk.y; import java.lang.ref.WeakReference; import java.util.HashMap; import java.util.Map; import org.json.JSONException; import org.json.JSONObject; ...
Java
UTF-8
6,896
2.203125
2
[]
no_license
package com.contactlab.services.impl; import de.hybris.platform.acceleratorservices.email.impl.DefaultEmailService; import de.hybris.platform.acceleratorservices.model.email.EmailAddressModel; import de.hybris.platform.acceleratorservices.model.email.EmailAttachmentModel; import de.hybris.platform.acceleratorservices....
C++
UTF-8
1,227
3.015625
3
[]
no_license
#include <vector> #include <iostream> using namespace std; struct sptEntry { int value; bool valid; }; int log2(int val) { int ret = -1; while (val != 0) { val >>= 1; ret++; } return ret; } int twoPow(int val) { return 1 << val; } int main() { // Read stuff int width, height; vector<vector<int> > m...
Markdown
UTF-8
391
2.78125
3
[]
no_license
--- title: "ABC #139 D" problem: https://atcoder.jp/contests/abc139/tasks/abc139_d --- $$ M_i $$ の取りうる最大値は $$ P_i-1 $$ である. $$ \{ P_1, P_2, \ldots, P_{N-1}, P_N \} = \{ 2, 3, \dots, N, 1 \} $$ とすればすべての $$ M_i $$ は取りうる最大値になるので, 合計も最大値となる. よって, $$ \sum_{k=1}^{N-1} k = N(N-1)/2 $$ が答えである.
C++
UTF-8
1,518
3.40625
3
[]
no_license
#ifndef Polygon_HPP #define Polygon_HPP #define pi 3.1415926535897 std::vector<std::string> nameByType = {"", "Point", "Line", "Triangle", "Square", "Pentagon", "Hexagon", "Heptagon", "Octagon", "Nonagon"}; template <class T> struct Polygon { int n; Point<T> center; T side; T radius; std::ve...
C#
UTF-8
2,516
3.015625
3
[]
no_license
using csharp_dotnet_core_web_api_hotel_listing.Data; using csharp_dotnet_core_web_api_hotel_listing.IRepository; using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Threading.Tasks; namespace csharp_dotnet_core_web_api_hot...
Java
UTF-8
1,169
2.640625
3
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package CITstrangerthings.model; /** * * @author Raye Ang */ public class FleeResults { private String message; ...
Python
UTF-8
537
2.8125
3
[]
no_license
from bs4 import BeautifulSoup import requests from datetime import datetime url = "http://www.daum.net/" response = requests.get(url) soup = BeautifulSoup(response.text, 'html.parser') rank = 1 results = soup.findAll('a','link_favorsch') search_rank_file = open("rankresult.txt","a") print(datetime.today().strftime(...
Python
UTF-8
5,026
2.890625
3
[ "MIT" ]
permissive
""" Home Work 5 Ankit Khandelwal Exercise 12 15863 """ from math import sqrt import matplotlib.pyplot as plt import numpy as np G = 1 m1 = 150 m2 = 200 m3 = 250 delta = 10 ** -3 def f(solution): r1x = solution[0] r2x = solution[1] r3x = solution[2] rv1x = solution[3] rv2x = solution[4] rv3x...
Java
UTF-8
1,056
2.453125
2
[]
no_license
package com.grsu.committee.service.impl; import com.grsu.committee.dataaccess.impl.AdministratorDao; import com.grsu.committee.dataaccess.impl.SheetDao; import com.grsu.committee.entities.Administrator; import com.grsu.committee.entities.Enrollee; import com.grsu.committee.entities.Sheet; import com.grsu.committee.ser...
Java
UTF-8
9,331
2.828125
3
[]
no_license
import cs3500.pyramidsolitaire.controller.PyramidSolitaireTextualController; import cs3500.pyramidsolitaire.model.hw02.PyramidSolitaireModel; import java.util.Collections; import java.util.List; import org.junit.Test; import cs3500.pyramidsolitaire.model.hw02.BasicPyramidSolitaire; import cs3500.pyramidsolitaire.model...
Python
UTF-8
4,580
3.109375
3
[]
no_license
import textmagic.client client = textmagic.client.TextMagicClient('****', '****') import time import random #result = client.send("Hello, World!", "17162923620") #message_id = result['message_id'].keys()[0] import Adafruit_BBIO.ADC as ADC ADC.setup() pin1="P9_33" #2132633578 # content of last message def finding_las...
TypeScript
UTF-8
2,056
2.59375
3
[]
no_license
import { Component, OnInit, Testability } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Subscription } from 'rxjs'; import Cocktail, { ingredientMeasure } from '../../models/Cocktail'; import { CocktailService } from '../services/cocktail.service'; @Component({ selector: 'app-cock...
C#
UTF-8
1,655
2.78125
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Input; using WPF.ViewModels; namespace WPF.Commands { public class SearchFoodCommand : ICommand { public event EventHandler CanExecuteChanged; public EnterMe...
PHP
UTF-8
396
2.640625
3
[]
no_license
<?php class Logger { public static function send($message) { $config = Config::me()->get('logs'); if (!$config['enabled']) { return; } } protected static function extendMessage($jsonMessage) { $jsonMessage['microdatetime'] = Time::getMicroDateTime(); ...
Java
UTF-8
1,243
3.0625
3
[]
permissive
package com.xiong.nowcoder; public class NC55 { public class Solution { /** * @param strs string字符串一维数组 * @return string字符串 */ public String longestCommonPrefix(String[] strs) { // write code here int i = 0; if (strs == null) { ...
PHP
UTF-8
2,964
2.84375
3
[ "MIT" ]
permissive
<?php namespace Code_Alchemy\Models\Factories; use Code_Alchemy\Core\Alchemist; use Code_Alchemy\Models\Dynamic_Model; use Code_Alchemy\Models\Model; /** * Class Model_Cloner * @package Code_Alchemy\Models\Factories * * Clones a Model */ class Model_Cloner extends Alchemist{ /** * @var \Code_Alchemy...
Java
UTF-8
329
2.296875
2
[]
no_license
package com.stu1; import com.stu.Student; public class Student1 { public static void main(String[] args) { // TODO Auto-generated method stub Student s = new Student(); s.setName("Sai"); s.setAddress("7-145/8"); s.toString(); s.addCourseGrade(); s.printGrades(); s.getAverageGrade(); ...
Python
UTF-8
3,034
2.53125
3
[ "MIT" ]
permissive
__author__ = 'Simon' import json import re import time import urllib.request def fetch(url): print("Try to get: " + url) try: return urllib.request.urlopen(url) except: print("Failed to get: " + url) time.sleep(5) return fetch(url) params = {'format': 'json', 'action': 'query', ...
JavaScript
UTF-8
1,004
2.9375
3
[]
no_license
function agregar(){ var pro = document.getElementById("producto").value; var cant = document.getElementById('cantidad').value; var http = new XMLHttpRequest(); http.onreadystatechange = function(){ if(this.readyState == 4 && this.status== 200){ mostrar(); console.log('dat...
PHP
UTF-8
923
2.765625
3
[]
no_license
<!doctype html> <html> <head> <meta charset="utf-8"/> <title>traitement</title> </head> <body> <?php echo "merci d'avoir remplis le formulaire ! je vous contacterais dès que possible !<br/>"; echo '<a href="index.html">cliquez ici pour revenir sur le portfol...
C++
UTF-8
1,628
3.015625
3
[]
no_license
#include <algorithm> #include <cctype> #include <fstream> #include <iostream> #include <sstream> uint64_t pow(int base, int exp) { uint64_t p = 1; for (int i = 0; i < exp; ++i) { p *= base; } return p; } int main(int argc, char** argv) { if (argc < 3) { std::cout ...
C#
UTF-8
1,794
2.546875
3
[]
no_license
using UnityEngine; using UnityEngine.UI; namespace Menu.Selectors { public class CharacterSelector : MonoBehaviour { public CharacterSetuper characterSetuper; private Image _button1; private Image _button2; private Image _button3; private void Start() { var button1T = gameObject.transf...
Markdown
UTF-8
448
3.125
3
[]
no_license
# combination_sum_IV ## 题目截图 ![](combination_sum_IV.jpg) ## 思路一 动态规划 class Solution: def combinationSum4(self, nums: List[int], target: int) -> int: # 采用 动态规划,有顺序的背包问题 dp = [0] * (target + 1) dp[0] = 1 for i in range(target + 1): for num in nums: ...
Java
UTF-8
1,448
2.046875
2
[]
no_license
package com.locensate.letnetwork.entity; import com.locensate.letnetwork.main.ui.fragments.machine.GridItem; import java.util.List; /** * ------------------------------------- * <p> * 项目名称: MotorTesting * <p> * 版权:locensate.com 版权所有 2016 * <p> * 公司主页:http://www.locensate.com/ * <p> * 描述: * <p> * 作者: xiaob...
Markdown
UTF-8
1,010
2.546875
3
[]
no_license
<p class="type">EXPLORATION</p> # Welco Logo Guideline <p class="meta">Design / Monday, February 2, 2015 7:41:06am</p> This is the guideline brand of the welco logo. Welco is a company engaged in the processing, packaging and selling of chocolate products. This brand guideline was made because my team was truste...
Markdown
UTF-8
2,582
3.09375
3
[]
no_license
# Coindesk-API Pods are included, you can simply download the project, open the `*.xcworkspace` file and run it. ### Design pattern I chose the MVVM design pattern as I find it clear, good separation of concers without being too complicated and easy to maintain. ### External libraries #### Alamofire I use Alamofire ...
Java
UTF-8
1,520
2.46875
2
[]
no_license
package com.appnomic.appsone.config; import com.appnomic.appsone.config.entity.ClusterGridEntity; import com.appnomic.appsone.config.entity.ConfigEntity; import com.google.gson.Gson; public class ClusterGridConfigManager implements ConfigManager { private static final ClusterGridConfigManager agcm = new ClusterGridC...
Java
UTF-8
1,486
2.625
3
[ "MIT" ]
permissive
package net.avicus.magma.database.table.impl; import java.util.List; import java.util.Optional; import net.avicus.magma.database.model.impl.TeamMember; import net.avicus.quest.database.Database; import net.avicus.quest.model.Table; import net.avicus.quest.query.Filter; public class TeamMemberTable extends Table<TeamM...
Java
UTF-8
333
1.546875
2
[]
no_license
package cn.luoxx.shiro.dao.impl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.jdbc.core.JdbcTemplate; import javax.annotation.Resource; public class BaseDao { protected Logger logger = LoggerFactory.getLogger(this.getClass()); @Resource protected JdbcTemplate jdbc...
C
UTF-8
1,027
2.90625
3
[]
no_license
#include <stdio.h> #include <stdbool.h> #include <stdlib.h> #include <malloc.h> #include "node.h" int main() { long int N; scanf("%ld", N); node Root; input_node(&Root); for (long int i = 1; i < N; i++) { node temp; //Allocate memory temp.children = malloc(); ...
Python
UTF-8
2,281
3.203125
3
[]
no_license
# encoding=utf-8 import re, urllib2 class neihanba(): def inter(self, startPage, endPage): url = "http://www.neihanpa.com/article/list_5_" for page in range(startPage, endPage + 1): urlFull = url + str(page) + ".html" html = self.loadPage(urlFull, page) self.dea...
Java
UTF-8
3,990
2.421875
2
[]
no_license
package org.controlador; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.modelo.CrudEntrenador; import org.modelo.Entr...
JavaScript
UTF-8
1,880
2.671875
3
[]
no_license
const { expect } = require('chai'); const utils = require('./src/utils'); describe('JSON API 用例', function() { describe('根据键名筛选内容', function() { it('filterKeys', function() { expect( utils.filterKeys( { foo: 1, ...
Python
UTF-8
599
4.25
4
[]
no_license
""" Created on Tue Feb 9 00:55:48 2021 @author: marin """ """problema 2 Escribir un programa en el cual se ingresen cuatro números, calcular e informar la suma de los dos primeros y el producto del tercero y el cuarto.""" num1=int(input("ingrese el primer numero: ")) num2=int(input("ingrese el segundo numer...
Java
UTF-8
1,060
2.34375
2
[]
no_license
package com.wladek.pension.web; import com.wladek.pension.domain.User; import com.wladek.pension.domain.enumeration.UserRole; import com.wladek.pension.service.UserDetailsImpl; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Controller; import org.springfra...
Java
UTF-8
6,682
2.28125
2
[]
no_license
package alexhao.codeheu.Util; import android.util.Log; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.ProtocolException; import java.net...
Markdown
UTF-8
2,524
2.859375
3
[]
no_license
# 上海融觉 标签(空格分隔): 面试总结 --- 总的感受:还是多数问的关于项目的问题,看来还是着重在项目上吧。还有就是项目好久没去看了,很多都忘了,我觉得接下来懂得工作还是js基础和项目吧 一、.vue通信 1.基本思想:prop向下传递,事件向上 2.父子组件通信: 1.子调用父:触发$emit 2.父调用子:通过子组件的引用ref 3.兄弟组件:通信:使用一个空的vue实例作为中央控制总线,通过$emit触发a组件,在b组件通过$on监听事件 二、.vuex模块 vuex 允许将 store(仓库)分成若干个模块,每个模块拥有自己的state,mutation,action,...
Python
UTF-8
786
3.09375
3
[]
no_license
import tensorflow as tf, numpy as np; np.set_printoptions(linewidth=400); print(np.get_printoptions()); mnist = tf.keras.datasets.mnist; (x_train, y_train), (x_test, y_test) = mnist.load_data(); #normalization of dataset x_train=x_train/255; x_test=x_test/255; print("Dataset dimensions:"); print(len(x_train), len(...
Java
UTF-8
852
3.15625
3
[]
no_license
package ch.epfl.cs108; import java.util.ArrayList; import java.util.List; public class Transposed implements ASCIImage { private ASCIImage baseImage; public Transposed(ASCIImage img) { baseImage = img; } @Override public int width() { return baseImage.height(); } @...
Markdown
UTF-8
2,971
2.75
3
[]
no_license
# 課程作業 * 線上評測系統:http://neoj.sprout.tw/ ## 每週勾選作業 | 週次 | 小專案 | 上課練習 | 勾選作業 | | :----: | :------- | :--------- | :--------- | | 0226 | | [100-修羅道的開始](http://...
C++
UTF-8
5,145
4.375
4
[]
no_license
#ifndef LINKEDLIST_H_INCLUDED #define LINKEDLIST_H_INCLUDED #include <string> #include "Node.h" class LinkedList{ private: Node * head; //This points to the first element of the linked list. It is used to point to the first element of the list. This should never be manipulated out of add. Node * traversalNod...
C++
UTF-8
685
2.859375
3
[ "MIT" ]
permissive
///by r@ul! #include <string> #include <iostream> using namespace std; const int CJ = 10; int VJ[CJ]; void cambiarv(int & a, int & b){ int c = a; a = b; b = c; } int main() { int cn, a = 1; cin >> cn; while(cn > 0){ for(int i = 1 ; i <= CJ ; i++) ci...
Java
UTF-8
534
2.3125
2
[]
no_license
package com.vinod.test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import reactor.bus.Event; import reactor.bus.EventBus; @Service public class CustomerPublisher { @Autowired EventBus eventBus; public void publishCustomerDetails() throws Interrup...
Java
UTF-8
1,115
2.125
2
[]
no_license
package gson; import com.google.gson.*; import request.receive.*; import java.time.LocalDate; public abstract class RequestDeserializer { public static Gson getDeserializer() { RuntimeTypeAdapterFactory<GenericResponse> typeAdapterFactory = RuntimeTypeAdapterFactory .of(GenericResponse.class, "type") .re...
PHP
UTF-8
747
2.953125
3
[ "BSD-3-Clause" ]
permissive
<?php /** * State calculator for multiple objects that returns the average state */ class AverageStateCalculator extends WorstStateCalculator { public function add_event($row = false) { foreach ($this->sub_reports as $idx => $rpt) { $rpt->add_event($row); } } public function calculate_object_state() { /*...
Python
UTF-8
5,708
2.765625
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Mon Mar 1 20:22:59 2021 @author: gabriel """ import numpy as np import pandas as pd import tensorflow as tf import keras as kr from keras.models import Sequential from keras.layers import Dense from keras.utils import np_utils from sklearn.preprocessing import LabelEn...
Ruby
UTF-8
377
3.6875
4
[]
no_license
#exercise 1 #check for the sequence of characters "lab" def has_lab?(string) if /lab/.match(string) puts ":) #{string} contains the sequence of characters 'lab'!" else puts ":( #{string} does not contain sequence of characters 'lab'." end end has_lab?("laboratory") has_lab?("experiment") has_lab?("Pans ...
JavaScript
UTF-8
4,485
2.609375
3
[]
no_license
import React, { Component } from 'react'; import axios from 'axios'; class NewProduct extends Component { constructor(props) { super(props); this.state = { name: "", brand: "", form: "", category: "", price: 0, description: "", ...
Python
UTF-8
2,868
2.75
3
[ "Apache-2.0" ]
permissive
""" Created on Sun Aug 12 15:43:10 2018 @author: TANVEER MUSTAFA """ import cv2 import numpy as np import os from test_frames1 import analyse_frame from termcolor import colored from PIL import Image import matplotlib.pyplot as plt from os.path import isfile, join image_array=[] def conve...
C++
UTF-8
270
3.28125
3
[]
no_license
#include <iostream> using namespace std; void printNumber(int x) { cout << "an integer " << x << endl; } void printNumber(float y) { cout << "a float " << y << endl; } int main() { int a = 54; float b = 32.4896; printNumber(a); printNumber(b); }
Markdown
UTF-8
8,810
3.25
3
[]
no_license
--- layout: post id: 1138 alias: the-jsonbuilder-of-groovy-is-not-groovy-enough tags: 其它语言 date: 2012-12-21 16:36:31 title: Groovy的JsonBuilder还是不够groovy --- 之前特别想把groovy的支持集成到play中,最主要的原因是看中了它的JsonBuilder。看下面这段代码: <pre class="csharpcode"> <span class="kwrd">public</span> <span class="kwrd">static</span> <span clas...
Python
UTF-8
1,003
3.28125
3
[ "MIT" ]
permissive
from math import sqrt, ceil from array import * T = int(input()) for _ in range(T): # readin plain_text = input() text_len = len(plain_text) k = ceil(sqrt(text_len)) # k x k matrix m = k * k asteriks = m - text_len text_matrix = [[None for _ in range(k)] for _ in range(k)...
Python
UTF-8
1,924
2.625
3
[]
no_license
import config, csv, json from binance.client import Client from tafunc import ta_analyze from collections import OrderedDict #@todo: add overload for user selection of data intervals #this function gets the kline data provided in the binance api def get_klines(selected_interval): client = Client(config.API_K...
Markdown
UTF-8
3,964
2.984375
3
[]
no_license
# TDR_Alert_Runspaces ## .SYNOPSIS Small utility to detect specific event ID in all active virtual machines in Citrix XenDesktop environment. Utility leverages multithreaded runspaces to minimize execution time. ## .DESCRIPTION Citrix XenDesktop is able to leverage NVIDIA GRID technology to boost graphics and improve ...
Markdown
UTF-8
906
2.671875
3
[]
no_license
--- title: '2018-03-29' date: 2018-03-29 15:33:23 tags: --- 昨夜花儿们可能悄悄拉了勾,「都开了吧,不等了」; 于是粉白的、鹅黄的、玫红的,一树树,一丛丛,怯怯地互相观望着,开在了雾霾下。 雾霾没能兜住这三月底的阳光,大地在睡眼惺忪中接受着恩惠,眼前像隔着刚盛过牛奶的玻璃杯。 柳芽儿在不知不觉中织成了一张张网,青烟似的荡在空中。 还有一些树,大约不愿从冬日长长的梦里醒过来,依旧伸展着光秃秃的枝干,高高地,在灰色的天空下。 这天地,热闹又安静。 -- 下午三点左右,想到了早晨来时路上的花,便下楼去看。 院子中央的树林里,七八个年轻人,跟着前排一个盘盘扣的中年人...
Rust
UTF-8
2,205
3.125
3
[]
no_license
use intcode::Interpreter; type Phases = (i64, i64, i64, i64, i64); fn amplify(interpreter: &Interpreter, (a, b, c, d, e): Phases) -> i64 { let mut interpreters = [ interpreter.clone(), interpreter.clone(), interpreter.clone(), interpreter.clone(), interpreter.clone(), ]...
Java
UTF-8
968
1.914063
2
[ "Apache-2.0" ]
permissive
package ru.alexproject.blogserver.services; import ru.alexproject.blogserver.model.domain.Comment; import ru.alexproject.blogserver.model.domain.Like; import ru.alexproject.blogserver.model.domain.Post; import ru.alexproject.blogserver.model.domain.User; import ru.alexproject.blogserver.model.dto.CommentDto; import ru...
PHP
UTF-8
2,205
2.78125
3
[]
no_license
<?php define('DB_USER', "a8532754_root"); // db user define('DB_PASSWORD', "mess123"); // db password (mention your db password here) define('DB_SERVER', "mysql9.000webhost.com"); // db serve $conn = new mysqli(DB_SERVER, DB_USER, DB_PASSWORD); if ($conn->connect_error) { die("Connection failed: " . $conn->c...
JavaScript
UTF-8
2,389
2.546875
3
[]
no_license
// grab the root view of the player. function getCurrentTrack() { let view = document.getElementsByClassName('NowPlayingView')[0]; let key = Object.keys(view).filter(e => e.includes('__reactInternalInstance')); // get the state props, for the track data. return view[key].return.stateNode.props.track; }...
Markdown
UTF-8
1,732
3.21875
3
[]
no_license
# Astro-Analytics This machine learning hackathon wqas conducted as part of Techsoc 2020, Shaastra. The competition link is given here [Astro-Analytics Hackathon](https://www.kaggle.com/c/astro-analytics-techsoc-iitm/overview).The competition details are given below. ><h3>Astro Analytics Challenge</h3> >Objective - Bui...
Python
UTF-8
609
3.515625
4
[]
no_license
from datetime import datetime, date, timedelta tday = datetime.now() print ("Сегодня: ", datetime.now()) delta_for_day = timedelta(1) delta_for_month = timedelta(30) yday = tday - delta_for_day month_ago = tday - delta_for_month print("Сейчас: ",tday) print("Вчера: ",yday) print("Отмотаем на месяц: ",month_ago) date_s...
Python
UTF-8
8,481
2.640625
3
[]
no_license
"""Incremental demo for wx support of tasks. Multiple tasks Note that naively subclassing SecondTask from ExampleTask, it initially used the same menu_bar and tool_bars traits from ExampleTask. This caused the incorrect tying of the controls to SecondTask because the class attributes were shared between both classes...
Shell
UTF-8
7,179
3.328125
3
[ "Apache-2.0" ]
permissive
#!/bin/bash # Common Vars SCRIPT_NAME=$(basename $0) SCRIPT_DIR=$(cd `dirname $0` && pwd) # Lab password LAB_PW='Welcome2lab!' # Sanity Checks if [ $(id -un) != "root" ]; then echo "ERROR: Must be run as root. Run sudo su - before running this script" exit 1 fi # # # check_rc () { if [ $1 -ne 0 ]; then ec...
C#
UTF-8
1,046
2.75
3
[]
no_license
using System.Numerics; using Rosalind.Core.Math; using Xunit; namespace Rosalind.Solutions.Math { public class FactorialTests { [Fact] public void Simple() { Assert.Equal(1, Factorial.For(1)); Assert.Equal(2, Factorial.For(2)); Assert.Equal(120, Factorial.For(5)...
Shell
UTF-8
1,276
3.1875
3
[]
no_license
### .bashrc is run when interactive bash starts. # prompt setting [[ -f $HOME/.bob-the-bash.sh ]] && source $HOME/.bob-the-bash.sh # right prompt setting function __command_rprompt() { local rprompt=$(LANG=C date +"%a %b %d %H:%M:%S %Y") # 右プロンプトに表示させる内容。今回はタイムスタンプ。 local num=$(($COLUMNS - ${#rprompt})) # 右プロンプ...