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 | 9,431 | 1.773438 | 2 | [] | no_license | package com.eventmanage.seating.actions;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONTokener;
import com.event.dbhelpers.EventDB;
import com.event.dbhelpers.EventHelperDB;
import com.event... |
Markdown | UTF-8 | 850 | 2.796875 | 3 | [] | no_license | # About
My demo application for Code BootCamp 2021. It is a web search engine for upcoming movies on tv.
This application uses following libraries:
- ORM: SQLAlchemy
- Flask for web application development
- Beautiful Soup for pulling data out of HTML pages
- Pipenv for managing dependencies
Application can be easi... |
Ruby | UTF-8 | 844 | 2.59375 | 3 | [] | no_license | require 'spec_helper'
describe Table do
let(:table) { Table.new("test_table", "id")}
context "#initialize" do
it "initializes a table with name" do
table.name.should == "test_table"
end
it "initializes a table with a primary key" do
table.columns.should include("id")
end
it "sets a... |
Java | UTF-8 | 934 | 2.3125 | 2 | [] | no_license | package io.threestacks.packerapi.budget;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class BudgetService {
@Autowired
private BudgetRepository budgetRepository;
public List<Budg... |
Java | UTF-8 | 4,100 | 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 com.yn.repository.impl;
import com.yn.pojo.Booking;
import com.yn.pojo.Customer;
import com.yn.pojo.Employee;
import com.yn.po... |
Go | UTF-8 | 475 | 3.234375 | 3 | [] | no_license | package main
import (
"fmt"
"time"
)
func printHour() {
t := time.Now()
switch {
case t.Hour() < 23:
fmt.Printf("%v Boa noite\n", t.Hour())
case t.Hour() < 22:
fmt.Printf("%v Boa noite\n", t.Hour())
case t.Hour() < 18:
fmt.Printf("%v Boa noite\n", t.Hour())
case t.Hour() < 12:
fmt.Printf("%v Boa tarde... |
C# | UTF-8 | 3,236 | 2.859375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Algorithm.Graph;
namespace Algorithm.Test
{
/**
* .
*
* @author John V. Sichi
*/
public abstract class ShortestPathTestCase
{
// ~ Static fields/initializ... |
Python | UTF-8 | 1,822 | 3.671875 | 4 | [] | no_license | """The input module, containing the input class."""
from input_output.terminal_output import Output
class Input:
"""The input class, containing functions related to user input."""
valid_commands = [
"create person",
"list people",
"open ticket",
"close ticket",
"assign... |
Python | UTF-8 | 1,387 | 2.90625 | 3 | [] | no_license | import cv2
import numpy as np
img = cv2.imread("../img/shapes.png")
# 그레이 스케일 변환
imgray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# 바이너리 스케일 변환
ret, th = cv2.threshold(imgray, 127, 255, cv2.THRESH_BINARY_INV)
# 컨투어 찾기
contours, hierachy = cv2.findContours(th, cv2.RETR_EXTERNAL, \
... |
C | UTF-8 | 2,913 | 3.59375 | 4 | [] | no_license | /**
\file : client_task2_3.c
\author : Sreeram Sadasivam
\brief : Task 2.3 for Operating Systems:Dependability & Trust Lab -
Design a client program to send client requests.
\copyright : Copyrights reserved @2016
*/
/**Standard Headerfiles*/
#include <stdio.h>
#include <stdlib.h>
/**Headerfiles for Fami... |
TypeScript | UTF-8 | 349 | 2.640625 | 3 | [] | no_license | import { Pipe, PipeTransform } from '@angular/core'
@Pipe({
name: 'reducedDescription'
})
export class ReducedDescription implements PipeTransform {
transform(texto: string): string {
let endOn: number = 15
if(texto.length > endOn) {
return texto.substr(0, endOn) + '...';
}
... |
C++ | UTF-8 | 2,072 | 2.59375 | 3 | [] | no_license | //////////////////////////////////////////////////////////////////////
// Process.h
//
// Abin
// 2016-03-12
//////////////////////////////////////////////////////////////////////
#ifndef __PROCESS_H__
#define __PROCESS_H__
class CProcess
{
public:
CProcess();
virtual ~CProcess();
virtual BOOL Create(LPCTSTR ... |
Java | UTF-8 | 223 | 2.375 | 2 | [] | no_license | package kata.supermarket;
import java.math.BigDecimal;
public interface IItem {
Product getproduct();
BigDecimal getPrice();
int getQuantity();
void addItem(int qty);
void subtractItem(int qty);
}
|
C | UTF-8 | 6,495 | 2.6875 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-public-domain"
] | permissive | /* Generated by re2j */
#line 1 "condition_06.cs.re"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define BSIZE 8192
typedef struct Scanner
{
FILE *fp;
unsigned char *cur, *tok, *lim, *eof;
unsigned char buffer[BSIZE];
} Scanner;
int fill(Scanner *s, int len)
{
if (!len)
{
s->cur = s->tok = s... |
C | UTF-8 | 4,388 | 2.78125 | 3 | [
"BSD-3-Clause"
] | permissive | // This is a personal academic project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
#include <graphics.h>
#include <prints.h>
#include <syscall.h>
#include <chess_piece.h>
#include <chess.h>
#include <shell.h>
#include <timeRTC.h>
#define WHITE 0xFFFFF... |
Go | UTF-8 | 252 | 3.1875 | 3 | [] | no_license | package main
import (
"bytes"
"fmt"
)
func joinString2(strings ...string) string {
var buf bytes.Buffer
for _, str := range strings {
buf.WriteString(str + " ")
}
return buf.String()
}
func main() {
fmt.Println(joinString2("aaa", "bbb"))
}
|
Markdown | UTF-8 | 2,118 | 4.0625 | 4 | [
"MIT"
] | permissive | # Typing
In Rusty.js types are extremely simple
There are only three kinds of data.
- Absolute
- Optional
- Result
## Absolute
An absolute value is any kind of information that would be held in a JavaScript variable
save for `null` and `undefined`, which is used as `None`.
It is any data that is guaranteed not `N... |
C++ | UTF-8 | 1,934 | 2.859375 | 3 | [] | no_license | #include "Funcoes.hpp"
CvPoint gira(CvPoint entrada, CvPoint meio, double angulo) {
double seno, coseno;
CvPoint saida;
seno = sin(angulo * M_PI / 180);
coseno = cos(angulo * M_PI / 180);
saida.x = entrada.x * coseno - entrada.y * seno + meio.x - meio.x * coseno
+ meio.y * seno;
saida.y = entrada... |
Java | UTF-8 | 479 | 2.0625 | 2 | [] | no_license | package com.genesys.challenge.client.util;
import com.genesys.challenge.client.configuration.ServerConfiguration;
public class GameUtils {
public final static int row_size = Integer.parseInt(ServerConfiguration.prop.getProperty("game.rowSize"));
public final static int col_size = Integer.parseInt(ServerConfig... |
Java | UTF-8 | 1,186 | 3.171875 | 3 | [] | no_license | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.StringTokenizer;
public class Main2606 {
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader br = new ... |
Java | UTF-8 | 627 | 2.9375 | 3 | [
"MIT"
] | permissive | package com.baz.app.dps.Factory;
public class ShapeFactory {
public Shape getShape(String shape) {
if("square".equals(shape))
return new Square();
if("rectangle".equals(shape))
return new Rectangle();
if("circle".equals(shape))
return new Circle();
... |
Python | UTF-8 | 2,363 | 3.171875 | 3 | [] | no_license | # problem24.py
#
# Copyright 2015 John Stafford <john@jkms.me>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later versio... |
Java | UTF-8 | 3,122 | 2.796875 | 3 | [] | no_license | package com.example.krys.traindroid;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;
import android.app.Activity;
import android.os.AsyncTas... |
C | UTF-8 | 200 | 2.71875 | 3 | [
"MIT"
] | permissive | //
// strlen.c
//
//
// Created by Nils-erik Engen on 18.09.2017.
//
//
#include "strlen.h"
int strlen(char *s){
int n;
for(n = 0; *s != '\0'; s++){
n++;
}
return n;
}
|
Ruby | UTF-8 | 267 | 3.265625 | 3 | [] | no_license | #DRAW?
#Build a method #draw? that accepts a board and returns true if the board has not
#been won and is full and false if the board is not won and the board is not full,
#and false if the board is won.
# Helper Method
def draw?(board)
!won?(board) && full?(board)
|
Java | UTF-8 | 2,423 | 2.15625 | 2 | [
"Apache-2.0"
] | permissive | /**
* Copyright 2021 Emmanuel Bourg
*
* 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... |
Python | UTF-8 | 1,320 | 3.0625 | 3 | [] | no_license | __author__ = 'lenovo'
# coding=utf-8
class Solution:
# @param {integer[]} nums
# @return {integer[][]}
def threeSum(self, nums):
map={}
result=[]
for i in nums:
map.setdefault(i,0)
map[i]+=1
alist=sorted(map.iteritems(),key=lambda num:num[0])
... |
Python | UTF-8 | 4,481 | 2.90625 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | """
Script to generate new train test splits
"""
import pandas as pd
import numpy as np
import random
import argparse
total_frames = 1950
def get_df_all(data_path):
names = ['path', 'x1', 'y1', 'x2', 'y2', 'class_name']
df_annotations_train = pd.read_csv('{}/annotation_train.csv'.format(data_path), names=n... |
C | UTF-8 | 559 | 2.671875 | 3 | [] | no_license |
#ifndef __EFFECTLIST_H
#define __EFFECTLIST_H
#include "ff.h"
typedef struct _effect_node {
Effect *info;
struct _effect_node *next;
}effect_node;
typedef struct _EffectList {
effect_node *first;
effect_node *last;
int size;
}EffectList;
EffectList EffectList_Create();
void EffectList_Add(EffectList *l, E... |
C# | UTF-8 | 2,785 | 2.515625 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FluentAssertions;
using TechTalk.SpecFlow.Assist;
using TechTalk.SpecFlow.Assist.ValueRetrievers;
using TechTalk.SpecFlow.RuntimeTests.AssistTests.ValueRetrieverTests;
using Xunit;
namespace Tech... |
C# | UTF-8 | 848 | 3.78125 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Calculator
{
public static class Calculator
{
public static int Add(int x,int y)
{
if (x < 0)
{
throw new ArgumentException($"Th... |
Java | UTF-8 | 8,224 | 2.265625 | 2 | [] | no_license | package com.example.medicine_analytics.service;
import com.example.medicine_analytics.model.PatientCard;
import com.example.medicine_analytics.model.MedicalType;
import com.example.medicine_analytics.repository.PatientCardRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.b... |
Markdown | UTF-8 | 1,231 | 2.625 | 3 | [] | no_license | ---
layout: post
title: "February 16, 2016 DropWizard"
---
DropWizard
This talk will cover the basics of DropWizard. The goal is to describe what it is, what it does, and some of it's capabilities. We'll go through a working example of a DropWizard Service. Finally, I'd like to share with you how we are using it and... |
Python | UTF-8 | 139 | 3.625 | 4 | [] | no_license |
list1 = ["Gold", "Silver", "White", "Black", "Pink"]
list1.append("fluorescent orange")
list1.pop(0)
print(len(list1))
print(list1[1])
|
JavaScript | UTF-8 | 2,206 | 3.09375 | 3 | [] | permissive | import * as constants from "./constants.js";
import { GridEntity } from "./grid-entity.js";
import { Fire } from "./fire.js";
import * as world from "./world.js";
import { Character } from "./character.js";
export class Bomb extends GridEntity {
fuseTime = constants.BOMB_FUSE_TIME;
power = 1;
/** @param {number} ... |
Markdown | UTF-8 | 6,591 | 3.25 | 3 | [] | no_license | ## [资治通鉴:难办的事,领导问你啥意见,这种回答方式很油滑!](https://zhuanlan.zhihu.com/p/328787331)
**《资治通鉴》第20卷 汉纪十二**
**汉武帝 元鼎六年(庚午,公元前111年)**
### 【原文】(可直接跳过看解析)
> 初,司马相如病且死,有遗书,颂功德,言符瑞,劝上封泰山。上感其言,会得宝鼎,上乃与公卿诸生议封禅。(中间太长省略了,感兴趣的朋友可以自己看《资治通鉴》)上乃自制仪,颇采儒术以文之。上为封禅祠器,以示群儒,或曰“不与古同”,于是尽罢诸儒不用。上又以古者先振兵释旅,然后封禅。
### 【译文】(可直接跳过看解析)
> 当初,司马相如病重将死,临... |
Java | UTF-8 | 805 | 3.4375 | 3 | [] | no_license | package Model;
import java.awt.*;
import java.util.Random;
public abstract class Vehicle {
int x, y; //can't make it private, needs to access from child classes
private final static Random random = new Random();
int xDir, yDir, ySpeed, xSpeed;//can't make it private, needs to access from child classes
... |
Java | UTF-8 | 670 | 2.53125 | 3 | [] | no_license | package com.epam.protocol.builder;
import java.nio.ByteBuffer;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import com.epam.protocol.domain.message.Message;
public abstract class MessageBuilder<T extends Message> {
public abstract T build... |
C# | UTF-8 | 1,449 | 2.8125 | 3 | [] | no_license | namespace Core
{
using System;
using System.Collections.Generic;
/// <summary>
/// Монеты
/// </summary>
public class Coin
{
public int id { get; set; }
public int price { get; set; }
public bool blocked { get; set; }
public int Available
... |
Markdown | UTF-8 | 1,057 | 2.625 | 3 | [] | no_license | # Dragee
[dragee.github.io](http://dragee.github.io) - drag&drop library for desktop and touch devices
# Dragee.Draggable
```javascript
Draggable(element[, options])
```
##### Example:
```javascript
function boundPoint(point, size){ return point; }
that.draggable = new Dragee.Draggable(that.element, {
bound: bou... |
Markdown | UTF-8 | 4,030 | 3.375 | 3 | [
"MIT"
] | permissive | # deppy [](https://travis-ci.com/pilagod/deppy) [](https://coveralls.io/github/pilagod/deppy?branch=master)
Dependency injection framework for Python
## Inst... |
Python | UTF-8 | 164 | 2.921875 | 3 | [] | no_license | input_list=[1,1,2,2,3,3,4,4,5,5,6,6,7]
def my_function(input_list):
return list(dict.fromkeys(input_list))
mylist = my_function(input_list)
print(mylist)
|
Java | UTF-8 | 1,668 | 2.328125 | 2 | [] | no_license | package testsuite.api;
import beans.Beans;
import executers.BaseExecutor;
import io.qameta.allure.Feature;
import model.api.registration.RegistrationResponse;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
import util.LogListener;
import stat... |
C++ | UTF-8 | 1,523 | 3 | 3 | [
"Apache-2.0"
] | permissive | //
// Created by frabe808 on 15/12/16.
//
#include "SlipperyObstacle.h"
#include "../objects/Object.h"
#include "PlayerComponent.h"
#include "PlayerController.h"
/**
* Initializes SlipperObstacle component.
*/
void SlipperyObstacle::Init()
{
_collisionComponent = _parent->Fetch<Collision>();
if (!_collisionCompon... |
JavaScript | UTF-8 | 1,317 | 2.609375 | 3 | [] | no_license | const toggleButton = document.querySelector('.hamburger');
const navLinks = document.querySelector('.menu_nav');
const menuContainer = document.querySelector('.menu')
const hamSpans = document.querySelectorAll('.ham-span');
toggleButton.addEventListener('click', ()=>{
navLinks.classList.toggle('active')
menuCo... |
Markdown | UTF-8 | 1,885 | 2.859375 | 3 | [] | no_license | ## Homepage: Collection of Color Palettes

## Color Palette Creator

## A single Palette View
![im... |
Java | UTF-8 | 836 | 2.25 | 2 | [] | no_license | package com.timemanager.client.view;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DockLayoutPanel;
import com.google.gwt.user.client.ui.SimpleLayoutPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
public class AppView... |
C# | UTF-8 | 727 | 2.71875 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Text;
using System.Net.Mail;
namespace PI.Utilities.Mail.Interfaces
{
/// <summary>
/// An interface for a a message builder to use
/// </summary>
public interface IMessageBuilder
{
/// <summary>
/// Generates a message f... |
Java | UTF-8 | 1,841 | 3.0625 | 3 | [] | no_license | package org.lgbt_news.analysis.sentiment.aggregation;
import org.lgbt_news.analysis.sentiment.SentimentCategory;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* Specific elements of the list of elements/ predictions are seen as elite.
* They have more strength in the aggregation.
* E.... |
Java | UTF-8 | 522 | 2.3125 | 2 | [] | no_license | package model;
public class MenuMeal {
private int mealId;
private int menuId;
private int userId;
public int getMealId() {
return mealId;
}
public void setMealId(int mealId) {
this.mealId = mealId;
}
public int getMenuId() {
return menuId;
}
public v... |
Markdown | UTF-8 | 760 | 2.640625 | 3 | [] | no_license | # 查询缓存(了解)
## 什么是查询缓存
很多数据库产品都能够缓存查询的执行计划,对于相同类型的SQL就可以跳过SQL解析和执行计划
分成阶段。MySQL在某种场景下也可以实现,但是MySQL还有另一种不同的缓存类型:缓存完成
的SELECT查询结果,也就是查询缓存。
MySQL将缓存存放在一个引用表中,类似于HashMap的数据结构,Key查询SQL语句,Value则是
查询结果。当发起查询时,会使用SQL语句去缓存中查询,如果命中则立即返回缓存的结果集.

*1.* *可以使用 SQL_NO_CACHE 在 SELECT 中禁止缓存查询结果,例如:SELECT SQ... |
C# | UTF-8 | 2,706 | 3.140625 | 3 | [] | no_license | using MySql.Data.MySqlClient;
using Service_ProCp.Models;
using System;
using System.Collections.Generic;
using System.Transactions;
/* This Class is meant for connecting the database, writing on database as well as reading with datbase */
namespace Service_ProCp.BusinessLogic
{
public class DataHelper
{
... |
Java | WINDOWS-1258 | 787 | 3.25 | 3 | [] | no_license | package main;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Jugar j = new Jugar();
Scanner sc = new Scanner(System.in);
System.out.println("Quieres jugar? Si/No");
String play = sc.nextLine();
if(play.equalsIgnoreCase("si")) {
j.jugar();
... |
Python | UTF-8 | 551 | 3.03125 | 3 | [] | no_license | file = open("data3.txt", "r")
m = []
for i, val in enumerate(file.readlines()):
m.append(list())
for x in val:
if x != "\n":
m[i].append(x)
n = len(m)-1
res=1
steps = [(1, 1), (3, 1), (5, 1), (7, 1), (1, 2)]
for h, v in steps:
add = 0
count = 0
row = 0
while row < n:
... |
Python | UTF-8 | 226 | 3.265625 | 3 | [] | no_license | from Car import Car
class Bomb(Car):
def drive(self, distance):
if distance > self.fuel:
distance = self.fuel
self.fuel = 0
else:
self.fuel -= distance
return 0 |
Python | UTF-8 | 572 | 2.859375 | 3 | [] | no_license | import cv2
import imutils
# Load ảnh ở chế độ 1: giữ nguyên ban đầu
img = cv2.imread('image.jpg', 1)
# Resize image
# img = cv2.resize(img, dsize=(400,400)) # Chuyển ảnh về 400x400 pixel
img = cv2.resize(img, (0,0), fx=2., fy=2.) # Phóng to ảnh gấp đôi
# Rotate image (import imutils)
img = imutils.rotate(img,70) # x... |
Java | UTF-8 | 247 | 1.867188 | 2 | [] | no_license | package pageObjects;
import org.openqa.selenium.By;
public class Login_Objects {
public static By txt_UserName = By.id("ap_email");
public static By txt_Password = By.id("ap_password");
public static By btn_Login = By.id("signInSubmit");
}
|
C++ | UTF-8 | 3,724 | 3.5 | 4 | [] | no_license | #include "gtest/gtest.h"
#include "Complex.h"
#include <iostream>
#include <string>
TEST (Test, createEmptyConstructor) {
EXPECT_EQ(Complex(), Complex(0, 0));
}
TEST (Test, createBasicConstructor) {
Complex result;
result.setComplex(1.3333333333, 2.44444444);
EXPECT_EQ(Complex(1.33, 2.44), result);
}
... |
C++ | UTF-8 | 1,621 | 2.5625 | 3 | [
"BSD-2-Clause"
] | permissive | /*~--------------------------------------------------------------------------~*
* Copyright (c) 2015 Los Alamos National Security, LLC
* All rights reserved.
*~--------------------------------------------------------------------------~*/
#ifndef flecsi_topology_serial_entity_storage_policy_h
#define flecsi_topology... |
C++ | UTF-8 | 755 | 3.71875 | 4 | [] | no_license | #include<iostream>
using namespace std;
class node2
{
public:
int data;
node2 *next;
};
class node1
{
public:
node2 *temp;
node2 *start=NULL;
node2 *newnode;
void createnode()
{
cout<<"element:-";
newnode=new node2();
cin>>newnode->data;
newnode->next=NULL;
}
void insertion_in_end()
{
int n;... |
Python | UTF-8 | 2,347 | 2.546875 | 3 | [] | no_license | from __future__ import print_function
import numpy as np
import cPickle as pickle
from imgpreproc import resizing
from mltools import svmclassifier
WANTED_KERNEL = svmclassifier.KERNEL_LINEAR
def test_svm():
# svm_clf_poly = svmclassifier.SVMClassifier(test_size=0.20, test_mode=True)
classifiers = []
to... |
Java | UTF-8 | 769 | 2.34375 | 2 | [] | no_license | package com.inka.netsync.view.dialog;
import android.app.AlertDialog;
import android.content.Context;
import com.inka.netsync.R;
public class SimpleMessageDialog {
private Context mContext = null;
private String mMessage = "";
private String mTitle = "";
public SimpleMessageDialog(Context context, String titl... |
Java | UTF-8 | 3,044 | 1.945313 | 2 | [] | no_license | package com.bionische.swastiktruckage.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class GetVoucherReport {
@Id
@GeneratedValue(strategy = Generatio... |
C++ | UTF-8 | 564 | 2.796875 | 3 | [] | no_license | class Solution {
public:
vector<int> lexicalOrder(int n) {
ios_base::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
vector<int>vec;
int number = 1;
for(int i=0; i<n; i++){
vec.push_back(number);
if(number * 10 <= n){
num... |
C# | UTF-8 | 765 | 4.09375 | 4 | [] | no_license | using System;
using System.Linq;
class Program
{
public static string ReverseText(string text)
{
char[] charArray = text.ToCharArray();
Array.Reverse(charArray);
return new string(charArray);
}
public static bool Palindrom(string i)
{
return i.SequenceEqua... |
Shell | UTF-8 | 433 | 3.671875 | 4 | [
"Apache-2.0"
] | permissive | #!/bin/bash
set -e
if [ -z "$TRAVIS_OS_NAME" ]; then
TRAVIS_OS_NAME=linux
fi
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
if [ ! -f "$TRAVIS_BUILD_DIR/ninja/ninja" ]; then
git clone https://github.com/ninja-build/ninja.git && cd ninja
git checkout release
./configure.py --bootstrap
cd ..
else
echo 'Us... |
Python | UTF-8 | 7,627 | 2.671875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
#
# License: This module is released under the terms of the LICENSE file
# contained within this applications INSTALL directory
"""
Abstracts and simplifies publishing reports (and catalogues) from different databases
with the insights service API
"""
# -- Co... |
PHP | UTF-8 | 706 | 2.984375 | 3 | [] | no_license | <?php
session_start();
if(isset($_SESSION['views']))
$_SESSION['views'] = $_SESSION['views']+ 1;
else
$_SESSION['views'] = 1;
echo "views = ". $_SESSION['views'];
echo "<div style='font-size:22px;'>";
echo "The result table:";
echo "</div>";
$num1 = $_POST['name'];
if ( $num1 > 12 )
$num1 = 12;
if ( $num1 < 2 )
... |
Markdown | UTF-8 | 789 | 2.71875 | 3 | [] | no_license | # metro-tsconfig-paths
Load `tsconfig.json` modules from locally developed packages, and help Metro
resolve imports using their `paths` objects.
## Usage
Add the following to your `metro.config.js` module:
```js
const withTSConfig = require('metro-tsconfig-paths')
module.exports = withTSConfig({
/* Metro configu... |
Markdown | UTF-8 | 2,455 | 3.921875 | 4 | [] | no_license | # [Add Binary][title]
## Description
Given two binary strings, return their sum (also a binary string).
The input strings are both **non-empty** and contains only characters `1` or `0`.
**Example 1:**
```
Input: a = "11", b = "1"
Output: "100"
```
**Example 2:**
```
Input: a = "1010", b = "1011"
Output: "10101"
... |
C# | UTF-8 | 475 | 3.46875 | 3 | [] | no_license | public class A
{
public int MyProperty { get; set; }
}
public static class B
{
static B()
{
MyInstance = new A();
MyInstance.MyProperty = 10;
}
public static A MyInstance { get; set; }
}
public class C
{
// not sur... |
C# | UTF-8 | 666 | 2.921875 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
namespace Trucks.Application.Attributes
{
/// <summary>
/// Attribute to validate if Enum is defined.
/// </summary>
[AttributeUsage(AttributeTargets.Property)]
public sealed class EnumV... |
Java | UTF-8 | 324 | 1.695313 | 2 | [] | no_license | package com.xzx.xzxms.inquiry.bean.extend;
import com.xzx.xzxms.inquiry.bean.InquiryPool;
public class InquiryPoolExtend extends InquiryPool {
private String proName;
public String getProName() {
return proName;
}
public void setProName(String proName) {
this.proName = proName;
... |
Markdown | UTF-8 | 839 | 2.65625 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: New iPhone 5
date: 2012-09-28
---

I'm pretty stoked.
Thankfully, Paddy was there to document this great occasion.
I really like the new iPhone. The taller form factor is actually pretty nice.
The one problem I'm having with the taller screen is applications tha... |
Go | UTF-8 | 531 | 2.96875 | 3 | [] | no_license | package main
import "fmt"
import "bufio"
import "os"
import "strings"
import "strconv"
func main() {
var slicelen int
var targetnum int
fmt.Scanln(&slicelen, &targetnum)
var scanner = bufio.NewScanner(os.Stdin)
scanner.Scan()
var arraytext = scanner.Text()
var inputArr = strings.Split(arraytext, " ")
inputArr ... |
Python | UTF-8 | 1,083 | 3.1875 | 3 | [
"MIT"
] | permissive | import numpy as np
def calc_rmsd(ref_coords, coords, idxs=None):
"""Calculate the RMSD between the reference and query coordinates.
Parameters
----------
ref_coords : arraylike
The refence coordinates that will be aligned to.
coords : arraylike
The coordinates that will be rotate... |
C# | UTF-8 | 6,011 | 2.890625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Timers;
namespace Daemon.Modules {
/// <summary>日志模块</summary>
public class LoggerModule:IDisposable {
/// <summary>计时器</summary>
private readonly T... |
C++ | UTF-8 | 625 | 2.65625 | 3 | [] | no_license | #ifndef SRC_EPI_CHAPTER5_SWAPBITS_HPP_
#define SRC_EPI_CHAPTER5_SWAPBITS_HPP_
#include "../../Solution.h"
#include "../../SmartPtr.h"
#include "../../SolutionCollection.h"
namespace epi {
namespace chapter5 {
class SwapBits : public myutils::Solution {
friend class myutils::SmartPtr;
public:
SwapBits():
... |
SQL | UTF-8 | 1,143 | 3.8125 | 4 | [] | no_license | -- create table Description
create table if not exists ThreeDMap.object_description (
id bigint Primary Key,
name varchar(50) not null
);
create index name_index on ThreeDMap.object_description (name);
comment on table ThreeDMap.object_description is 'This table describes 3D objects.';
-- Change table object_location... |
Python | UTF-8 | 350 | 3.1875 | 3 | [] | no_license | # Uses python3
import sys
input = sys.stdin.readline
def solve(n):
n1 = 0
n2 = 1
a = []
for i in range(n - 1):
a.append(n1 + n2)
n1, n2 = n2, n1 + n2
if len(a) != 0:
return (max(a) % 10)
else:
return 0
n =... |
C | UTF-8 | 2,444 | 2.734375 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line.c :+: :+: :+: ... |
Markdown | UTF-8 | 1,213 | 2.625 | 3 | [] | no_license | # Master X Data Science ,Paris 2019-2020
# Introduction-to-Bayesian-Learning
Place: Télécom ParisTech
Programming Language : R
<b>Syllabus</b>:
<br>
Week 1: Bayesian learning: basics.
Bayesian model, prior-posterior, examples.
Point and interval estimation.
<br>
Prior choice, examples, exponential family
A glimp... |
Java | UTF-8 | 7,367 | 2.34375 | 2 | [
"Apache-2.0"
] | permissive | package com.levigo.jadice.format.jpeg2000.internal.codestream;
import com.levigo.jadice.format.jpeg2000.JPEG2000Exception;
import com.levigo.jadice.format.jpeg2000.internal.io.MarkerReader;
import com.levigo.jadice.format.jpeg2000.internal.marker.Marker;
import com.levigo.jadice.format.jpeg2000.internal.marker.SO... |
C++ | UTF-8 | 4,508 | 2.984375 | 3 | [] | no_license | #include "Window.h"
Window::Window(unsigned int width
, unsigned int height
, const std::string title
, PaintData* paintData)
: m_window(sf::VideoMode(width, height), title)
, m_paintData(paintData)
{
m_title = title;
m_width = width;
m_height = heigh... |
Java | UTF-8 | 908 | 1.6875 | 2 | [] | no_license | package com.test;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.jun... |
Markdown | UTF-8 | 28,840 | 2.734375 | 3 | [] | no_license | # CC71Q-MEPC
CC71Q - Data Mining - Mars Express Power Challenge
My take on https://kelvins.esa.int/mars-express-power-challenge/ for my Data Mining Computer Science Course.
Introducción
============
El *Mars Express Orbiter* (MEX) es un satélite de exploración científica
de la Agencia Espacial Europea, lanzado en ju... |
Java | UTF-8 | 1,668 | 2.5 | 2 | [] | no_license | package dcms.c;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.List;
import java.util.regex.Matcher;
imp... |
SQL | UTF-8 | 45,482 | 2.9375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 11-02-2020 a las 20:52:28
-- Versión del servidor: 10.4.6-MariaDB
-- Versión de PHP: 7.1.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00"... |
Java | UTF-8 | 9,248 | 1.695313 | 2 | [] | no_license | package com.siloyou.jmsg.modules.sms.task.handler.listener;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.marre.... |
Markdown | UTF-8 | 42,861 | 2.8125 | 3 | [] | no_license | Java (이것이 자바다, 신용권 지음)
Effective-Java (이펙티브 자바, 죠슈아 블로크 지음)
## 문법
[variable]()
[mathod]()
[number]()
[boolean]()
[if]()
[Switch Case]()
[charAt(int) indexOf(str) substring(int1, int2) length()]()
[while]()
[Collection](https://github.com/tesschung/Java/blob/master/09_Collection.md)
[Stream]()
[Input&Out... |
Python | UTF-8 | 4,986 | 3.015625 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# In[9]:
import numpy as np # library to handle data in a vectorized manner
import pandas as pd # library for data analsysis
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
import json # library to handle JSON files
get_ipython().system("con... |
C# | UTF-8 | 1,036 | 2.578125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
namespace LvivCinema.Models
{
public class Cinema
{
public int Id { set; get; }
[Required(ErrorMessage = "Ім'я повинно бути обовязково")]
[StringLength(50, ... |
TypeScript | UTF-8 | 1,953 | 2.578125 | 3 | [
"MIT"
] | permissive | import { stringify } from 'querystring';
import { parseQueryFull } from './parseQueryFull';
describe('parseQueryFull', () => {
it('should parse full query', () => {
const query = stringify({
take: 10,
skip: 0,
search: 'Строка поиска',
relations: 'users,accounts',
sort: 'asc(created... |
C# | UTF-8 | 1,330 | 2.578125 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | using System;
using System.IO;
using System.Text;
using LightBlue.Standalone;
namespace LightBlue.Tests.Standalone
{
public enum DirectoryType
{
Account = 0,
Container = 1,
}
public abstract class StandaloneAzureTestsBase
{
public const string MetadataDirectory = ".meta";... |
JavaScript | UTF-8 | 3,159 | 2.734375 | 3 | [] | no_license | const TodoListModel = require('../models/TodoListModel')
const TodoModel = require('../models/TodoModel')
module.exports = {
postTodoListCallback: async (req, res) => {
try {
const body = {
title: req.body.title ? req.body.title : '',
ownerId: req.user._id,
... |
Java | UTF-8 | 993 | 2.421875 | 2 | [] | no_license | package dao;
import java.util.List;
import model.Statistics;
import tools.YeekuHibernateDaoSupport;
public class StatisticsDao extends YeekuHibernateDaoSupport<Statistics>{
public int save(Statistics statistics) {
return (Integer)getHibernateTemplate().save(statistics);
}
public Statistics find(int id) {
ret... |
Java | UTF-8 | 4,224 | 2.3125 | 2 | [
"MIT"
] | permissive | package hudson.plugins.testng.results;
import java.io.Serializable;
import hudson.model.ModelObject;
import hudson.model.Run;
import hudson.plugins.testng.TestNGTestResultBuildAction;
import hudson.tasks.test.AbstractTestResultAction;
import hudson.tasks.test.TabulatedResult;
import hudson.tasks.test.TestResult;
impo... |
Java | UTF-8 | 15,263 | 1.796875 | 2 | [] | no_license | package com.hyd.bikepool.bikepooler.bikemap;
import android.app.TimePickerDialog;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.... |
C++ | UTF-8 | 443 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <math.h>
#include <windows.h>
using namespace std;
int main()
{
{
double
x;
cout<<"Podaj x"<<endl;
cin>>x;
if (x<1)
cout<<(2*x)<<endl;
else
if (x==1)
cout<<-10<<endl;
else
if (x==3)
cout<<//((x-1)*(x-1)*(x-1)*(x-1))
pow((x-1),... |
Go | UTF-8 | 579 | 3.765625 | 4 | [] | no_license | package forloop
import (
"fmt"
"testing"
)
type Frame struct {
frame int
}
func NewFrame() *Frame {
return &Frame{
frame: 0,
}
}
func (f *Frame) Next() (int, bool) {
f.frame++
if f.frame < 10 {
return f.frame, true
}
return f.frame, false
}
func Test_ForLoop(t *testing.T) {
// for frame,more=frames... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.