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 | 7,329 | 2.984375 | 3 | [] | no_license | package connectfour.gui;
import connectfour.ConnectFourException;
import connectfour.client.ConnectFourBoard;
import connectfour.client.ConnectFourNetworkClient;
import connectfour.client.Observer;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.event.ActionEvent;
import javafx... |
Python | UTF-8 | 489 | 2.984375 | 3 | [] | no_license | N = int(input())
inputs = [int(input()) for _ in range(N)]
def process():
global right, ans
right += 1
if right == N - 1:
ans = max(ans, right - left + 1)
print(ans)
exit()
left = 0
right = 0
ans = 1
while right < N - 1:
while inputs[right] < inputs[right + 1]:
... |
Java | UTF-8 | 1,245 | 3.671875 | 4 | [] | no_license | import java.io.*;
import java.util.*;
class Node{
int freq;
char c;
Node left, right;
Node(char c, int freq, Node left, Node right){
this.freq = freq;
this.c = c;
this.left = left;
this.right = right;
}
int getFreq(){
return freq;
}
char getChar(){
return c;
}
}
public class H... |
Java | UTF-8 | 1,909 | 2.296875 | 2 | [] | no_license | package com.example.ahmed.mal_gp;
import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import java.util.ArrayList;
/**
* Created by A... |
Java | UTF-8 | 2,043 | 3.078125 | 3 | [] | no_license | import java.io.*;
class MAXOR {
BufferedReader bf;
PrintWriter writer;
StringBuilder sb;
static boolean local_system = false;
long solve(int[] d) {
long c = 0;
for (int i = 0, h = d.length; i < h; i++) {
for (int j = i + 1; j < h; j++) {
if ((d[i] & d[j]) == d[i]) c++; else if (
(d[i] & d[j]) ==... |
SQL | UTF-8 | 1,312 | 4.125 | 4 | [
"Apache-2.0"
] | permissive | #standardSQL
# pages markup metrics grouped by device and button type
# returns button struct
CREATE TEMPORARY FUNCTION get_markup_buttons_info(markup_string STRING)
RETURNS ARRAY<STRUCT<
name STRING,
freq INT64
>> LANGUAGE js AS '''
var result = [];
try {
var markup = JSON.parse(markup_string);
if (Arr... |
Java | UTF-8 | 693 | 1.601563 | 2 | [] | no_license | package jp.co.internous.ecsite.model.form;
import java.io.Serializable;
import java.util.List;
//↓
//import antlr.collections.List;
//↓
//import com.sun.xml.bind.v2.schemagen.xmlschema.List;
//↓
//import java.awt.List;
//↓
//import org.hibernate.mapping.List;
public class CartForm implements Serializable ... |
Markdown | UTF-8 | 1,648 | 2.78125 | 3 | [] | no_license | # Summary
The concept of information sharing has been growing rapidly along with multiple common search engines such as Google and Yahoo; however, these generic web search platforms may not provide best results for the users who prefer to search within a narrow scope or without going to a third-party website. Our goal... |
Java | UTF-8 | 3,474 | 2.09375 | 2 | [] | no_license | package cin.ufpe.br.energyprofiler.modes.abstracts;
import android.content.Context;
import android.os.Vibrator;
import android.view.View;
import android.widget.TextView;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.Stri... |
C++ | UTF-8 | 15,038 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | /**
* Copyright 2014-2017 Steven T Sell (ssell@vertexfragment.com)
*
* 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 requir... |
Java | UTF-8 | 104 | 1.710938 | 2 | [
"BSD-3-Clause"
] | permissive | package org.firstinspires.ftc.teamcode.byrt;
public enum SpinnerPosition {
IN,
HALF,
OUT
}
|
C++ | UTF-8 | 1,127 | 3.125 | 3 | [] | no_license | #include <string>
#include <random>
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
string strGenerator() {
char arrayOfChar[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', ' '};
random_devi... |
Python | UTF-8 | 36 | 2.65625 | 3 | [] | no_license | a = int(input())
print(a*123456789)
|
TypeScript | UTF-8 | 652 | 2.75 | 3 | [
"MIT"
] | permissive | // CTR - Counter AES encryption
import * as aes from 'aes-js';
const key = [
3,
1,
1,
8,
1,
7,
6,
3,
3,
4,
9,
6,
8,
6,
7,
3,
7,
7,
6,
7,
0,
2,
2,
5,
6,
7,
0,
5,
8,
5,
0,
1
];
function aesCtr() {
return new aes.ModeOfOperation.ctr(key, new aes.Counter(7... |
JavaScript | UTF-8 | 6,441 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | var GitHubApi = require("github");
var gutil = require("gulp-util");
var through2 = require("through2");
/**
* Create a function that collects all elements from a multi-page response
*/
function collector(github, collect, done) {
var r = function(err, res) {
if (err) {
done(err);
return;
}
... |
Go | UTF-8 | 394 | 3.515625 | 4 | [] | no_license | package main
import "fmt"
func printRepeating4(data []int, intrange int) {
size := len(data)
count := make([]int, intrange)
for i := 0; i < size; i++ {
if count[data[i]] == 1 {
fmt.Println(" ", data[i])
} else {
count[data[i]]++
}
}
fmt.Println()
}
func main() {
data := []int{1, 2... |
Markdown | UTF-8 | 6,260 | 3.03125 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: How to use upstream sources in your Azure Artifacts feed
description: Use upstream sources in Azure Artifacts to consume packages from public registries
ms.technology: devops-artifacts
ms.reviewer: amullans
ms.date: 08/24/2021
monikerRange: '>= tfs-2017'
"recommendations": "true"
---
# Tutorial: How to use ... |
C# | UTF-8 | 406 | 2.671875 | 3 | [] | no_license | // ...
private IQueryable<BaseSearchResultItem> ApplyManufacturerQuery(IQueryable<BaseSearchResultItem> query, PhoneSearchParam searchParam)
{
/*
query.AsEnumerable()
.Select(phone => { (string)phone["manufacture"].ToLower() == searchParam.Manufacture.ToLower() });
*/
query = query.Where( (phon... |
Java | UTF-8 | 3,773 | 2.015625 | 2 | [] | no_license | package com.zfw.core.sys.service;
import com.zfw.core.service.ICommonService;
import com.zfw.core.sys.entity.Progress;
import com.zfw.core.sys.entity.User;
import com.zfw.dto.excel.PhotoExcel;
import com.zfw.utils.StringUtilsEx;
import org.apache.commons.lang3.StringUtils;
import javax.servlet.http.HttpServletRequest... |
Java | UTF-8 | 1,617 | 2.1875 | 2 | [
"Apache-2.0"
] | permissive | package org.yoqu.cms.plugin.serve.core.config;
import org.apache.mina.core.session.IoSession;
/**
* @author yoqu
* @date 2016/6/21 0021
* @description
*/
public class ClientSession {
private Long id;
private IoSession session;
private String address;
private String username;
private String pas... |
Java | UTF-8 | 373 | 1.617188 | 2 | [
"MIT"
] | permissive | package uk.gov.companieshouse.api.accounts.repository;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;
import uk.gov.companieshouse.api.accounts.model.entity.CicReportApprovalEntity;
@Repository
public interface CicReportApprovalRepository extends ... |
Markdown | UTF-8 | 4,913 | 3.171875 | 3 | [] | no_license | 第四回 恼人的猪八戒(8)
牛大爷哈哈大笑,笑得连杯里剩下的一点酒都泼了出来,欧阳美一面笑,一面用眼角瞟着田思思。
田思思却莫名其妙,这些话她根本都不懂,她决定以后要问问那大头鬼,“婊子”究竟是干什么的。
牛大爷又笑道:“她既然是个白虎星,想必也不是什么好货色,凭什么架子要比别人大?”
季公子道:“这只因男人都是贱骨头,她架子越大,男人就越想跟她上床。”
牛大爷点着头笑道:“她这倒是摸透男人的心了,连我的心都好像已有点打动,等等说不定也得去试试看。”
欧阳美忽然拊掌道:“我想起来了。”
牛大爷道:“美公想起了什么?”
欧阳美道:“季公子说的,莫非是张好儿?”
... |
Python | UTF-8 | 607 | 2.65625 | 3 | [] | no_license | import sys
from pymongo import Connection
from pymongo.errors import ConnectionFailure
import pymongo
""" Connect to MongoDB """
try:
c = Connection(host="localhost", port=27017, safe=True)
print "Connected successfully"
except ConnectionFailure, e:
sys.stderr.write("Could not connect to MongoDB: %s" % e)... |
C# | UTF-8 | 777 | 2.640625 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Rotate : MonoBehaviour {
public float speed = 30f;
public bool rl = false;
public bool rr = false;
public void Update()
{
if(rl){
RotateLeft();
}
if (rr)
{
... |
Python | UTF-8 | 3,703 | 2.625 | 3 | [
"MIT"
] | permissive |
from resistance.game import Game
from resistance.mct.mct_agent import MCTAgent
from resistance.mct.li_agent import MAgent
from resistance.random_agent import RandomAgent
def test(n_game, players):
scoreboard = {agent.name: {'spy': [0, 0], 'resistance': [
0, 0], 'total': [0, 0]} for agent in players}
... |
Python | UTF-8 | 128 | 3.40625 | 3 | [] | no_license | lin = input()
l = lin.split(" ")
a = int(l[0])
b = int(l[1])
c = int(l[2])
if a < b < c:
print('Yes')
else:
print('No') |
Java | UTF-8 | 570 | 2.375 | 2 | [
"MIT"
] | permissive | package permutu.Models;
public class StreamMessageModel {
private String playerLogin;
private String[] selectedBlocks;
public StreamMessageModel(String playerLogin, String[] selectedBlocks) {
this.selectedBlocks = selectedBlocks;
this.playerLogin = playerLogin;
}
public String ... |
PHP | UTF-8 | 5,005 | 2.96875 | 3 | [] | no_license | <?php
/**
* The contents of this source file is the sole property of Cream Union Ltd.
* Unauthorized duplication or access is prohibited.
*
*
* @package Cream
* @author Cream Dev Team
* @copyright Copyright (C) 2004-2012 Cream Union Ltd.
* @license http://www.crea-m.com/user_guide/license.html
* @link http... |
Java | UTF-8 | 422 | 2.046875 | 2 | [
"Apache-2.0"
] | permissive | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.pikater.core.ontology.subtrees.metadata.attributes;
/**
*
* @author Kuba
*/
public class IntegerAttributeMetadata extends NumericalAttributeMetadata {
private static final long serialVersio... |
Java | UTF-8 | 2,322 | 2.453125 | 2 | [] | no_license | package androidx.work;
import androidx.work.WorkInfo;
import java.util.ArrayList;
import java.util.List;
public final class WorkQuery {
private final List<WorkInfo.State> mStates;
private final List<String> mTags;
private final List<String> mUniqueWorkNames;
WorkQuery(Builder builder) {
... |
Java | UTF-8 | 146 | 2.09375 | 2 | [] | no_license | package Object;
public class SmallHouse extends MapObject {
public SmallHouse(int x, int y) {
super(x, y);
createRect(x, y, 92, 43);
}
}
|
Python | UTF-8 | 347 | 4.03125 | 4 | [] | no_license | #input 1=" programming is fun"
#input 2= "m"
#output = [6,7]
sentence = "I decided to learn how to program"
letter= "m"
output= []
#enumerate will allow you to track the current location or idx
for current_location, current_letter in enumerate(sentence):
if current_letter == letter:
output.append(current... |
C# | UTF-8 | 2,288 | 2.625 | 3 | [] | no_license | /*
* (c) 2008 MOSA - The Managed Operating System Alliance
*
* Licensed under the terms of the New BSD License.
*
* Authors:
* Kai P. Reisert <kpreisert@googlemail.com>
*/
using System;
using Mosa.Runtime.CompilerFramework;
using NDesk.Options;
namespace Mosa.Tools.Compiler
{
/// <summary>
/// Selector prox... |
Python | UTF-8 | 1,198 | 3.0625 | 3 | [
"LicenseRef-scancode-generic-cla",
"MIT"
] | permissive | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from .entities import CimDataCollection
class VesselPastStopsWrapper:
"""Wrapper to get vessel past stops, it will be padding with None if stops number less than configured one.
Examples:
.. code-block:: python
# ... |
Python | UTF-8 | 3,249 | 3.171875 | 3 | [] | no_license | import numpy as np
import math
import plotly.graph_objects as go
def sphericalRelative(t1_rad, t2_rad, targetP, r):
if t1_rad > 1.5707: #for semisphere
t1_rad = t1_rad/2
# for reference https://mathinsight.org/spherical_coordinates
x = targetP[0] + (r * math.sin(t1_rad) * math.cos(t2_rad... |
Shell | UTF-8 | 5,834 | 3.203125 | 3 | [] | no_license | # ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Users/crobinson13/AppData/Local/Programs/"Microsoft VS Code"/bin:/... |
C# | UTF-8 | 477 | 2.546875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OOPTutorial.Vehicles
{
public class Truck : Vehicle,IVehicle
{
public string BedLength { get; set; }
public string DescribeVehicle()
{
... |
C++ | UTF-8 | 37,539 | 2.546875 | 3 | [] | no_license |
#include <stdio.h>
#include <iostream>
#include "STP.h"
#include <cassert>
//#include <random>
#include <cstdlib>
#include <ctime>
#include <time.h>
#include <string.h>
#include "Timer.h"
#include <deque>
#include <queue>
#include <functional>
#include <fstream>
#include "IDAStar.h"
#include "DFID.h"
#include <iostrea... |
Java | UTF-8 | 1,313 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | package Model;
import java.util.List;
import java.util.Objects;
public class TweetSentiment {
private double mFinalPositiveness = 0;
public void setTweetPositiveness() {
final List<Tweet> tweetList = TweetList.getInstance().getTweetList();
for (final Tweet aTweetList : tweetList) {
... |
C# | UTF-8 | 639 | 2.84375 | 3 | [] | no_license | Regex spaceRegex = new Regex("\\s{2,}");
//Only replace subsequent spaces, not all spaces. For example,
//" " (three spaces) becomes " " (1 space, 2 non-breaking spaces).
MatchEvaluator matchEvaluator = delegate(Match match)
{
StringBuilder spaceStringB... |
Markdown | UTF-8 | 2,881 | 2.953125 | 3 | [] | no_license | # API Reference
### coolsms.c
먼저 User\_opt struct 을 생성합니다. 생성한 구조체를 initialize 하는 user\_opt\_init\(\) 함수를 불러줍니다.
```text
#include "coolsms.h"
int main()
{
char * api_key = "키 입력";
char * api_secret = "비밀키 입력";
user_opt user_info = user_opt_init(api_key, api_secret);
```
### \_send
```text
response_struc... |
Swift | UTF-8 | 808 | 2.53125 | 3 | [] | no_license | //
// FilterMediaStatusPicker.swift
// Movie DB
//
// Created by Jonas Frey on 14.03.23.
// Copyright © 2023 Jonas Frey. All rights reserved.
//
import SwiftUI
struct FilterMediaStatusPicker: View {
@EnvironmentObject private var filterSetting: FilterSetting
var body: some View {
FilterMultiP... |
Java | UTF-8 | 242 | 1.929688 | 2 | [] | no_license | package net.tinybrick.security.authentication;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public interface IAuthenticationToken<T> {
@XmlElement
public T getUsername();
}
|
SQL | UTF-8 | 1,618 | 3.53125 | 4 | [] | no_license | SELECT
R.ORDER_FISCAL_YR
, R.ORDER_ID
, R.ORDER_LINE_NBR
, R.SCHED_LINE_NBR
, R.PRIOR_DY_RESCHD_DT
, R.RESCHD_DT
, R.RESCHD_TM
, R.ORDER_TYPE_ID
, R.AVAIL_CHK_GRP_CD
, R.DOC_TYP_CD
, R.TRANS_UPD_CD
, R.SRC_UPD_USR_ID
, R.SHIP_TO_CUST_ID
, C.CUST_NAME
, C.O... |
Markdown | UTF-8 | 1,509 | 2.625 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | # Contributing
## Developing in the Open
Developing in the open creates a healthier working environment, a more collaborative process,
and just better software.
We welcome contributions.
The aws-cft-tools team handles development of this project in the open. As such, we use Github
to keep track of project developme... |
Rust | UTF-8 | 316 | 2.59375 | 3 | [] | no_license | use serde::Serializer;
pub(crate) fn serialize_as_csv<S, T>(
iter: impl IntoIterator<Item = T>,
serializer: S,
) -> Result<S::Ok, S::Error>
where
T: Into<&'static str>,
S: Serializer,
{
let out: Vec<_> = iter.into_iter().map(Into::into).collect();
serializer.serialize_str(&out.join(","))
}
|
Java | UTF-8 | 60,442 | 2.203125 | 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 Ventanas;
import Clases.Arbol;
import Clases.Graph;
import Clases.ColorGUI;
import Clases.Controlador;
import Clases.Dijkstra... |
C++ | UTF-8 | 274 | 3.375 | 3 | [] | no_license | class Solution {
public:
string toLowerCase(string str) {
string ans = "";
for (char c : str) {
if (65 <= c && c <= 90)
ans += (char)(c + 32);
else
ans += c;
}
return ans;
}
}; |
C# | UTF-8 | 5,260 | 2.703125 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CSquared
{
public abstract class Primary<T, J> :
IPrimary,
IInitializable,
ICastable<CSquaredString>,
ICastable<CSquaredBoolean>
where J : Prima... |
Python | UTF-8 | 902 | 3.796875 | 4 | [] | no_license | import unittest
from src.card import Card
from src.card_game import CardGame
class CardGameTest(unittest.TestCase):
def setUp(self):
self.card = Card("Spades", 1)
self.card_2 = Card("Hearts", 2)
self.cards = [self.card, self.card_2]
self.game = CardGame()
def test_check_... |
C# | UTF-8 | 425 | 3.453125 | 3 | [] | no_license | using System;
using System.Threading;
namespace Tester
{
public class Loop50Times : ITester
{
public void Run()
{
for (int i = 0; i < 50; i++)
{
Console.WriteLine("Loop " + i);
Thread.Sleep(1000);
}
}
... |
Go | UTF-8 | 487 | 3.34375 | 3 | [] | no_license | package v1
type quickUnion struct {
nodes []int
}
func NewQuickUnion(n int) *quickUnion {
qu := quickUnion{nodes: make([]int, n)}
for i := range qu.nodes {
qu.nodes[i] = i
}
return &qu
}
func (qu *quickUnion) Connected(p,q int) bool {
return qu.root(p) == qu.root(q)
}
func (qu *quickUnion) Union(p,q int) {
... |
C | UTF-8 | 579 | 3.21875 | 3 | [] | no_license | #include <stdio.h>
#include <time.h>
int main(void) {
struct tm t;
time_t t_of_day;
t_of_day = time(NULL);
printf("Time retunred from functions is %ld\n",t_of_day);
if (t_of_day >= 1572546600 && t_of_day <=1580581799)
{
printf("PASSED! You reset the time successfully!\n") ... |
Java | UTF-8 | 465 | 2.328125 | 2 | [] | no_license | package tomato.editor;
import java.awt.BorderLayout;
import javax.swing.JColorChooser;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class Window {
private JFrame frame;
private JPanel blocks;
public Window() {
frame = new JFrame();
blocks = new JPanel();
frame.getContentP... |
Markdown | UTF-8 | 3,442 | 2.78125 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: 'CA1051: Do not declare visible instance fields'
ms.date: 03/11/2019
ms.topic: reference
f1_keywords:
- CA1051
- DoNotDeclareVisibleInstanceFields
helpviewer_keywords:
- CA1051
- DoNotDeclareVisibleInstanceFields
ms.assetid: 2805376c-824c-462c-81d1-c51aaf7cabe7
author: mikejo5000
ms.author: mikejo
manager: j... |
JavaScript | UTF-8 | 11,671 | 3.15625 | 3 | [
"MIT"
] | permissive | var resultTextEl = document.querySelector('#result-text');
var resultContentEl = document.querySelector('#result-content');
var searchFormEl = document.querySelector('#search-form');
var searchHistoryEl = document.querySelector('.history');
var cityList = [{
name: "",
lat: "",
lon: ""
}];
function getLocalStorag... |
Python | UTF-8 | 2,436 | 3.203125 | 3 | [
"GPL-3.0-only",
"LGPL-3.0-only"
] | permissive | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from datetime import datetime, timezone
from typing import TypeVar, Dict, List, Any, Type, Union
# Type variable used in the parse methods below, which should be a subclass of BaseModel.
T = TypeVar("T", bound="BaseModel")... |
JavaScript | UTF-8 | 3,015 | 2.6875 | 3 | [] | no_license | import Wave from './wave';
import options from '../options';
import { optionGetter } from '../utils';
export default class Waves {
constructor(params = {}) {
const optionOr = optionGetter(params);
this.cols = optionOr('cols', 10);
this.rows = optionOr('rows', 10);
this.speed = optionOr('speed', 10);
this... |
C# | UTF-8 | 776 | 2.625 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HealthSystem : MonoBehaviour
{
public int maxHealth = 5;
public static int currentHealth;
public Healthbar healthBar;
private void Start()
{
currentHealth = maxHealth;
healthBar.SetMaxHeal... |
Java | UTF-8 | 410 | 2.90625 | 3 | [] | no_license | package com.yan.design.mode.interpreter.demo2;
/**
* @author : 楠GG
* @date : 2017/12/23 9:19
* @description : 抽象的算术运算解释器,为所有解释器共性的提取
*/
public abstract class ArithmeticExpression {
/**
* 抽象的解析方法
* 具体的解析逻辑由具体的子类实现
* @return 解析得到具体的值
*/
public abstract int interpret();
}
|
Python | UTF-8 | 892 | 3.578125 | 4 | [] | no_license | voting_data = [{"county":"Arapahoe", "registered_voters": 422829},
{"county":"Denver", "registered_voters": 463353},
{"county":"Jefferson", "registered_voters": 432438}]
counties_dict = {"Arapahoe": 369237, "Denver":413229, "Jefferson": 390222}
for county, voters in counties_dict.items(... |
Python | UTF-8 | 1,943 | 2.546875 | 3 | [] | no_license | from flask import Flask
from flask import Response
from flask import request
from flask import render_template
import logging as log
from cloud import generate_text_wordcloud
app = Flask(__name__)
def standard_page(html_file,title):
content = ''
content = content + render_template('header.html', title=titl... |
Python | UTF-8 | 3,326 | 2.8125 | 3 | [] | no_license | #encoding:utf8
import tensorflow as tf
import pandas as pd
import numpy as np
import re
import os
from sklearn import metrics
DATA_PATH = "D:\\AllCode\\Datas\\NLP\\Sentiment\\twitter\\"
EMBEDDING_PATH = DATA_PATH + "data\\GoogleNews-vectors-negative300.bin"
def clean_str(string):
"""
Tokenization/string cleani... |
PHP | UTF-8 | 1,348 | 2.578125 | 3 | [] | no_license | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class M_videos extends CI_Model
{
public function __construct()
{
parent::__construct();
}
public function create($data)
{
if (!$data) return false;
$this->db->insert('videos', $data);
$vide... |
C++ | UTF-8 | 963 | 2.703125 | 3 | [] | no_license | #include "explosion.hpp"
explosion::explosion(
const float radius,
const float force
)
: radius(radius)
, force(force)
{}
void explosion::explode(
const b2Vec2 pos,
b2World* world
) {
ExplodeAABBCallback callback;
b2AABB aabb;
aabb.lowerBound = b2Vec2(pos.x - radius, pos.y - radius);
a... |
JavaScript | UTF-8 | 4,093 | 2.53125 | 3 | [] | no_license | import React, {Component} from "react";
import { Link} from "react-router-dom";
import BlogPost from './BlogPost';
import nopostimg from './img/noposts.png';
import ErrorPage from "./ErrorPage";
class PostLoader extends Component {
constructor(props) {
super(props);
var fetchUrl = '';
if (... |
Java | UTF-8 | 1,711 | 2.140625 | 2 | [] | no_license | package br.com.jortec.mide;
import android.*;
import android.content.pm.PackageInfo;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
public class SobreActivity e... |
Java | UTF-8 | 16,149 | 2.25 | 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 quiz;
import javax.swing.JOptionPane;
/**
*
* @author Sabrina Correia
*/
public class ventana3 extends javax.swing.JFrame ... |
C++ | UTF-8 | 1,917 | 2.984375 | 3 | [] | no_license | #pragma once
#include "stdafx.h"
#include <unistd.h>
#include <map>
using namespace std;
class CMImageDataPool
{
public:
//current Key,when create a new memory,it will add 1
static unsigned long long s_nIndex;
//memory map,access the memory by appropriate key
typedef map<unsigned long long, cv::Mat> Map... |
Markdown | UTF-8 | 9,298 | 3.234375 | 3 | [] | no_license | # 作业自动化
## 实验介绍
### 实验内容
在使用数据库的过程中,通常会有一些重复的事情,比如备份操作,检查错误,启动数据库等等。如果每次都手动操作,不仅有可能忘记而且很麻烦,如果创建一个作业,让系统自动处理会很方便。本节实验主要介绍两个用来实现作业自动化的程序:
- `Oracle Scheduler` :这个是 Oracle 提供的。
- `cron` :这个是 Linux 系统本身就有的。
### 实验知识点
+ 使用 Oracle Scheduler 实现作业自动化
+ 使用 crontab 实现作业自动化
## Oracle Scheduler
这里以定期备份表空间 system 为例。
### ... |
C++ | UTF-8 | 1,887 | 2.96875 | 3 | [] | no_license | #ifndef DVMARCHINGCUBE_H
#define DVMARCHINGCUBE_H
///< System header files
#include "dvCommon.h"
#include "dvMarchingTable.h"
#include "dvVolumeData.h"
/*!
\brief
a class for Edge
*/
class Edge {
public:
pair<int, int> m_edge[2];
inline Edge &operator =(const Edge &rhs)
{
m_edge[0] = rhs.m... |
Java | UTF-8 | 601 | 3.515625 | 4 | [] | no_license | package Classes;
/**
* This is for INFSCI 2140 in 2018
*/
public class WordNormalizer {
public char[] lowercase(char[] chars) {
// Transform the word uppercase characters into lowercase.
for (int i = 0; i < chars.length; i++) {
if (chars[i] <= 'Z' && chars[i] >= 'A') chars[i] += 32;
}
return ... |
PHP | UTF-8 | 1,558 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
/**
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace loophp\collection\Operation;
use Closure;
use Generator;
use Iterator;
use loophp\collection\Iterator\IterableIterator;
/**
* @immutable
... |
Java | UTF-8 | 502 | 1.953125 | 2 | [] | no_license | // isComment
package com.sismics.reader.ui.form.validator;
import android.content.Context;
import com.sismics.reader.R;
/**
* isComment
*/
public class isClassOrIsInterface implements ValidatorType {
@Override
public boolean isMethod(String isParameter) {
return isNameExpr.isMethod().isMethod() != ... |
JavaScript | UTF-8 | 2,486 | 3.609375 | 4 | [] | no_license | /*350. Intersection of Two Arrays II
Given two arrays, write a function to compute their intersection.
Example:
Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2].
Note:
● Each element in the result should appear as many times as it shows in both arrays.
● The result can be in any order.
Follow up:
● What ... |
PHP | UTF-8 | 1,092 | 2.609375 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace common\models;
use Yii;
/**
* This is the model class for table "contract_service".
*
* @property integer $cs_id
* @property string $contract_no
* @property integer $service_id
* @property string $start_time
* @property string $end_time
* @property integer $status
*/
class ContractService ex... |
Java | GB18030 | 375 | 2.671875 | 3 | [] | no_license | package Singleton;
/**
* ʽ
* ԼʱѾԼʵ ҪǶ̷߳ʵİȫ
* */
public class Singleton1 {
private static final Singleton1 instance=new Singleton1();
private Singleton1() {
// TODO Auto-generated constructor stub
}
public static Singleton1 GetIntance() {
return instance;
}
}
|
C# | UTF-8 | 1,203 | 2.640625 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace FocusFrame
{
public class Singleton<T> : MonoBehaviour where T : Singleton<T>
{
protected static T instance;
protected static bool isExit = false;
public static T GetInstance
{
... |
Java | UTF-8 | 697 | 2.421875 | 2 | [] | no_license | package com.example.am_projekt.variables;
public class CurrentLoggedUserData {
private static String currentLoggedUsername = "NOT_LOGGED";
private static String currentServerIP = "192.168.0.101";
public static String getCurrentLoggedUsername() {
return currentLoggedUsername;
}
public stat... |
Python | UTF-8 | 1,491 | 2.6875 | 3 | [] | no_license | import posixpath
from abc import abstractmethod
from .cli_context import CliContext
from .themes import NoColorTheme
class CliCommandBase(object):
"""base class for a single CCDB CLI command"""
#context = ConsoleContext()
uses_db = False
changes_db = False
help_util = False
is_alias = False
... |
C++ | UTF-8 | 6,446 | 2.59375 | 3 | [
"BSD-2-Clause"
] | permissive | #include "gvio/msckf/blackbox.hpp"
namespace gvio {
BlackBox::BlackBox() {}
BlackBox::~BlackBox() {
// Estimation file
if (this->est_file.good()) {
this->est_file.close();
}
// Measurement file
if (this->mea_file.good()) {
this->est_file.close();
}
// Ground truth file
if (this->gnd_file.go... |
Markdown | UTF-8 | 1,253 | 3.359375 | 3 | [] | no_license | # oc-genblog
overcodes tool to generate a static blog.
# Example
Write your blog post:
politics-are-overrated.md
```
<!-- @template "blog-post.html" -->
# Politics are overrated
Politics are overrated, but discussion is a necesary evil to ensure we fight the creep of authoritative government.
```
Generate the pos... |
Markdown | UTF-8 | 1,102 | 3.578125 | 4 | [] | no_license | ### 解题思路
直接看代码就能理解
```java
/**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode(int x) { val = x; }
* }
*/
class Solution {
public ListNode addTwoNumbers(ListNode l1, ListNode l2) {
//默认第一节点不为空
//计算2个线性表第一个节点值的和
int a = ... |
Java | UTF-8 | 987 | 2.78125 | 3 | [] | no_license | package org.softlang.megal.util;
import static com.google.common.collect.Lists.newArrayList;
import static com.google.common.collect.Lists.newLinkedList;
import java.util.Deque;
import java.util.List;
import java.util.ListIterator;
import com.google.common.collect.AbstractIterator;
public abstract class PostOrderDe... |
Python | UTF-8 | 1,419 | 2.703125 | 3 | [] | no_license | from django.db import models
class Author(models.Model):
name = models.CharField(max_length=100)
age = models.IntegerField()
def __str__(self):
return self.name, self.age
class Publisher(models.Model):
name = models.CharField(max_length=300)
def __str__(self):
return self.name
... |
Python | UTF-8 | 1,196 | 2.921875 | 3 | [] | no_license | # -*- coding:utf-8 -*-
class Container(object):
__shield_list = [] # 顺序遍历
__separate_list = [] # 顺序遍历
__output_list = [] # 顺序遍历
__process_list = [] # 非并发,顺序遍历, 多择其一
def set_shield(self, shield_cls):
self.__shield_list.append(shield_cls)
def set_separate(self, separate_cls):
... |
Java | UTF-8 | 1,928 | 2.75 | 3 | [
"MIT"
] | permissive | package seedu.address.testutil;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import seedu.address.model.reminders.ReadOnlyReminder;
import seedu.address.model.reminders.UniqueReminderList;
import seedu.address.storage.XmlSerializableReminders;
//@@author justinpoh
/**
* A utility clas... |
JavaScript | UTF-8 | 2,037 | 2.796875 | 3 | [
"MIT"
] | permissive | import auditors from './auditors';
import * as Err from './err';
import prop from './prop';
/**
* @public
* @param {*} value Checked value
* @param {function|string} naming Name on error (string or function that returns a string)
* @param {function(*):boolean} auditor Checking function. The name of this function... |
PHP | UTF-8 | 2,607 | 2.625 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace app\modules\api\controllers;
use app\models\Tweet;
use Yii;
use yii\rest\Controller;
use app\models\User;
/**
* Default controller for the `api` module
*/
class DefaultController extends Controller
{
/**
* Renders the index view for the module
* @return string
*/
public funct... |
C++ | UTF-8 | 3,075 | 2.6875 | 3 | [
"BSD-3-Clause",
"LGPL-2.0-or-later",
"Apache-2.0",
"CC0-1.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Definitions for the Interchange File Format (IFF)
// Alexander Gessler, 2006
// Adapted to Assimp August 2008
#ifndef AI_IFF_H_INCLUDED
#define AI_IFF_H_INCLUDED
#include <assimp/ByteSwapper.h>
namespace Assimp {
namespace IFF {
///////////////////////////////////////////////////////////////////////////... |
Markdown | UTF-8 | 5,080 | 2.828125 | 3 | [] | no_license | # express-winston
Appsynth's Winston logger Express middleware.
## Features
- Redacts sensitive information automatically (token, password, credit card...)
- Optionally allows you to log request and response body for specific routes
- A unique request ID is assigned to each request that has multiple logs
- The gener... |
Python | UTF-8 | 2,804 | 2.953125 | 3 | [] | no_license | import re
def get_descriptor(filepath,regex,name):
"""
Helper function to build requests
:param filepath: path to logfile
:param regex: Regular expression (as a raw string) used to locate the descriptor
:param name: String containing name of parameters in case not found
:return: float zero po... |
Rust | UTF-8 | 394 | 2.671875 | 3 | [
"CC0-1.0"
] | permissive | use crate::types;
pub fn parse(input: &str) -> types::Data {
let mut result = types::Data::default();
for line in input.lines() {
let block: Vec<u8> = line.chars().map(|x| x as u8 - b'0').collect();
if result.height == 0 {
result.width = block.len();
}
resul... |
Java | UTF-8 | 512 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | package se.thinkcode.ctd;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class TodoList {
Map<String, List<String>> tasks = new HashMap<>();
public void addTask(String owner, String task) {
List<String> currentTasks = tasks.getOrDefault(owne... |
Ruby | UTF-8 | 424 | 3.609375 | 4 | [] | no_license | class Person
# class << self
# def count
# @count ||= 0
# end
# end
# atalho para criacao de metodo na classe Singleton do objeto Person
def self.count
@count ||= 0
end
def self.count=(increment)
@count = increment
end
def initialize(name)
@name = name
self.class.count +=... |
C++ | UTF-8 | 425 | 2.859375 | 3 | [] | no_license | const int N = 1e5 + 5;
int dsu[N]; // negative and equals to -size if root, parent if non-root
int trace(int u) {
return dsu[u] < 0 ? u : dsu[u] = trace(dsu[u]);
}
bool connect(int u, int v) {
if ((u = trace(u)) == (v = trace(v))) {
return false;
}
if (dsu[u] > dsu[v]) {
swap(u, v);
... |
Python | UTF-8 | 1,130 | 2.921875 | 3 | [
"MIT"
] | permissive | import pytz
import unittest
from datetime import datetime, timezone
from identidoc.services import get_current_time_as_POSIX_timestamp, datetime_to_POSIX_timestamp
class TestMiscFunctions(unittest.TestCase):
# This test is going to be very hard to "test"
def test_get_current_time_as_POSIX_timestamp(self):
... |
Python | UTF-8 | 1,965 | 4.1875 | 4 | [] | no_license | #Simple implementation of a binary tree and the 3 different traversals
import unittest
class Node:
def __init__(self, value):
self.value = value
self.left = None
self.right = None
#Prints the left child, parent and then right child.
#In a binary tree, this prints in ascending order
def inOrderTraversal(node, l... |
Java | UTF-8 | 1,580 | 2.078125 | 2 | [] | no_license | package com.abhishekmaurya.abhivyakti2k15;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
/**
* Created by ABHISHEK MAURYA on 24-01-2015.
*/
public class ComperingCell extends Activity {
Button compab, compmem, compc... |
JavaScript | UTF-8 | 5,549 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | // FIXME Line numbers are not aligned to correspondent text line
// https://trello.com/c/hdZGr9EA/684
describe.skip("ep_script_page_view - height of line numbers", function() {
// Letter
// var PAPER_SZE = 'Letter';
// var GENERALS_PER_PAGE = 54;
// A4
var PAPER_SZE = 'A4';
var GENERALS_PER_PAGE = 58;
va... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.