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 |
|---|---|---|---|---|---|---|---|
C++ | UTF-8 | 4,881 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <iomanip>
#include "School.h"
#include "Student.h"
#include "AttendanceRecord.h"
#include "Course.h"
#include "Date.h"
using namespace std;
void School::addStudents(string filename) {
ifstream ifs(filename);
if (!i... |
Markdown | UTF-8 | 1,462 | 2.84375 | 3 | [] | no_license |
# liri-real
Description: LIRI is like iPhone's SIRI. However, while SIRI is a Speech Interpretation and Recognition Interface, LIRI is a Language Interpretation and Recognition Interface. LIRI will be a command line node app that takes in parameters and gives you back data.
### Instructions
##### When user types ... |
C++ | UTF-8 | 1,204 | 2.703125 | 3 | [] | no_license | /*
reality, be rent!
synapse, break!
Van!shment Th!s World !!
*/
#include <bits/stdc++.h>
using namespace std;
int a[24], n;
vector<int> v;
bool vst[1 << 12][24];
bool dfs(int mask, int rem, int i) {
if (i == n) {
if (mask == 1 << (n - 1)) return rem == 0;
return false;
}
if (vst[mask][rem]) return false;
v... |
Java | UTF-8 | 2,581 | 1.945313 | 2 | [] | no_license | package com.buddha.icbi.pojo.member;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import c... |
JavaScript | UTF-8 | 253 | 2.5625 | 3 | [
"MIT"
] | permissive |
//eslint-disable-next-line no-console
export async function profileAsync( message, callback, logger = console.log ) {
const
time = performance.now(),
result = await callback()
logger( message, performance.now() - time )
return result
}
|
Python | UTF-8 | 4,745 | 2.59375 | 3 | [
"MIT"
] | permissive | from direct.showbase.ShowBase import ShowBase
from panda3d.core import loadPrcFileData, BitMask32, Vec3
from panda3d.core import CollisionTraverser, CollisionNode
from panda3d.core import CollisionHandlerQueue, CollisionRay
# from panda3d.core import OrthographicLens
config_vars = """
win-size 1280 720
show-frame-rate... |
C# | UTF-8 | 910 | 3.15625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
namespace FactoryPattern.Factory
{
class PointSampleString : ISampleString
{
private static PointSampleString PointSample; // multi-thread durumlarda volatile da eklenebilir
// private static object CntrolObj = new object();
... |
C++ | UTF-8 | 429 | 2.90625 | 3 | [
"Unlicense"
] | permissive | #include <iostream>
void answer(unsigned v)
{
std::cout << v << '\n';
}
void solve(unsigned x)
{
const unsigned d = x % 10;
unsigned k = d * 10;
k -= 4 * (x < 1111);
k -= 3 * (x < 111);
k -= 2 * (x < 11);
answer(k);
}
void test_case()
{
unsigned x;
std::cin >> x;
solve(x);
... |
Java | UTF-8 | 251 | 2.484375 | 2 | [] | no_license | package multi_thread.Chapter2.manySynMethodsInClass;
public class ThreadB extends Thread
{
private Service s;
public ThreadB(Service s)
{
this.s = s;
}
@Override
public void run()
{
s.service1();
}
}
|
Python | UTF-8 | 632 | 3.140625 | 3 | [] | no_license | import re
def solution(new_id):
# 1단계
new_id = new_id.lower()
# 2단계
new_id = re.sub('[^a-z\d\-\_\.]','',new_id)
# 3단계
while '..' in new_id:
new_id = new_id.replace('..','.')
# 4단계
if new_id:
if new_id[0] == '.':
new_id = new_id[1:]
if new_id:
... |
JavaScript | UTF-8 | 533 | 3.40625 | 3 | [] | no_license | /**
* Maja Miarecki codility solution
* https://app.codility.com/programmers/lessons/1-iterations/
*/
function solution(N) {
const arr = N.toString(2).split('');
const max = arr.length;
let result = 0;
let temp = 0;
for (let i = 0; i < max; i++) {
const current = arr[i];
const previous = arr[i - 1... |
Java | UTF-8 | 5,848 | 2.25 | 2 | [] | no_license | package com.springboot.service.impl;
import com.springboot.exception.GlobalException;
import com.springboot.mapper.UserMapper;
import com.springboot.model.User;
import com.springboot.model.UserAttention;
import com.springboot.result.CodeMsg;
import com.springboot.service.UserService;
import com.springboot.utils.SHA1;
... |
C++ | UTF-8 | 727 | 3.25 | 3 | [] | no_license | #include <vector>
#include <queue>
#include <limits>
class Solution {
public:
vector<int> largestValues(TreeNode* root) {
std::vector<int> res;
std::queue<TreeNode*> q;
if (root) q.push(root);
while (!q.empty()) {
int size = q.size();
int max = ... |
SQL | UTF-8 | 1,949 | 2.90625 | 3 | [] | no_license | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Versión del servidor: 10.4.8-MariaDB - mariadb.org binary distribution
-- SO del servidor: Win64
-- HeidiSQL Versión: 10.2.0.5599
-- -------------------------------------------... |
C++ | UTF-8 | 552 | 2.671875 | 3 | [] | no_license | // NamaFile BUffaloMilk.h
#ifndef BUFFALOMILK_H
#define BUFFALOMILK_H
#include "FarmProduct.h"
// Kelas BuffaloMilk adalah kelas dari susu kerbau yang bisa didapat pemain saat program dijalankan
class BuffaloMilk : public FarmProduct{
private:
static string className;
static int n; //Mengembalikan jumlah ... |
C# | UTF-8 | 1,796 | 2.71875 | 3 | [] | no_license |
using System.Data.SqlClient;
using System;
using System.Configuration;
namespace DAOS.LayerDao
{
public abstract class Dao
{
protected SqlConnection cn; //mantém a conexão com o bd
protected SqlCommand cmd; // executa instruções de procedures
protected SqlDataReader reader; // consul... |
Python | UTF-8 | 548 | 3.546875 | 4 | [] | no_license | '''
for i in range(2,10):
for j in range(1,10):
print(i, '*', j, '=', i*j, end= ' ')
print('')
'''
'''
for i in range(1,10):
for j in range(2,10):
print('%d * %d =' %(j,i),(j*i), end= ' ')
print('')
'''
'''
a = ['one', 'two', 'hi', '^^']
result = []
for num in a:
result.append(num... |
C++ | UTF-8 | 9,706 | 2.75 | 3 | [] | no_license | /**
C++ client example using sockets
*/
#include<iostream> //cout
#include<stdio.h> //printf
#include<string.h> //strlen
#include<string> //string
#include<sys/socket.h> //socket
#include<arpa/inet.h> //inet_addr
#include<netdb.h> //hostent
#include <boost/foreach.hpp>
#include <boost/tokenizer.hpp>
#incl... |
JavaScript | UTF-8 | 1,051 | 3.234375 | 3 | [] | no_license | var backtick = "Angular"; //backtick symbol example
console.log(backtick);
var dubqu = "mean"; //double quotes string example
console.log(dubqu);
var squots = 'mern'; //single quote string ex
console.log(squots);
var dec = 101; //decimal no
console.log(dec);
var doub = 1020.20; //double no
console.log(doub);
var hexa =... |
Markdown | UTF-8 | 2,053 | 2.546875 | 3 | [] | no_license | <img src="http://i.imgur.com/4Sh8rBx.png" width="900">
<br><a href="http://www.youtube.com/watch?v=IFpPBQsTcFo&feature=youtu.be" rel="nofollow" target="_blank">Youtube.</a>
**So what does it do?**
I find it handy for keeping track of my decks and tweaking them, experimenting with deck ideas, keeping track of my coll... |
TypeScript | UTF-8 | 1,862 | 2.75 | 3 | [
"MIT"
] | permissive | import { Component, OnInit } from '@angular/core';
import { Quote} from '../quote';
@Component({
selector: 'app-quote',
templateUrl: './quote.component.html',
styleUrls: ['./quote.component.css']
})
export class QuoteComponent implements OnInit {
deleteQuote(isComplete, index){
if (isComplete) {
let t... |
C# | UTF-8 | 2,838 | 3.109375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
namespace RPGPlatformerEngine
{
/// <summary>
/// This class represents an item icon in the inventory.
/// </summary>
public class InventoryItem ... |
Markdown | UTF-8 | 9,890 | 3.125 | 3 | [
"Apache-2.0"
] | permissive | ictlyh Translating
Writing a Linux Debugger Part 6: Source-level stepping
============================================================
A couple of posts ago we learned about DWARF information and how it lets us relate the machine code to the high-level source. This time we’ll be putting this knowledge into practice b... |
Java | UTF-8 | 4,085 | 2.375 | 2 | [] | no_license | package pro.grain.admin.service;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.search.sort.FieldSortBuilder;
import org.elasticsearch.search.sort.ScoreSortBuilder;
import org.elasticsearch.search.sort.SortOrder;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBui... |
PHP | UTF-8 | 4,726 | 2.71875 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2016/9/30
* Time: 11:35
*/
namespace app\models;
use yii\db\ActiveRecord;
use yii\helpers\ArrayHelper;
/**
* Class Article
* @package app\modules\models
* 分类模型
*/
class Category extends ActiveRecord
{
/**
* @return string
* 设置数据表
... |
C++ | UTF-8 | 820 | 2.640625 | 3 | [
"MIT"
] | permissive | #ifndef GRAPHITE_VCFHEADER_H
#define GRAPHITE_VCFHEADER_H
#include "IHeader.h"
#include <memory>
#include <vector>
#include <string>
namespace graphite
{
class IAlignmentReader;
class VCFHeader : public IHeader
{
public:
typedef std::shared_ptr< VCFHeader > SharedPtr;
VCFHeader();
~VCFHeader();
void add... |
Markdown | UTF-8 | 992 | 3.25 | 3 | [] | no_license | # earth_venus_orbit
Simulate the orbit of Earth and Venus, plot the relative position of them.
The purpose of the project is to show the position of the Earth and the Venus, and what can it draw if we connect Earth and Venus consecutively.
# Usage
A C script, earthVSvenus.c, is used to generate the date needed for plo... |
TypeScript | UTF-8 | 313 | 2.6875 | 3 | [] | no_license | import { _curry1 } from './internal/_curry'
function camelCase(str: string): string {
str = ('' + str).trim()
if (!str.length) return str
return str
.replace(/[-_]+([\S])/g, (_, char) => char.toUpperCase())
.replace(/^([A-Z])/, (_, char) => char.toLowerCase())
}
export default _curry1(camelCase)
|
PHP | UTF-8 | 1,346 | 2.71875 | 3 | [] | no_license | <?php
class Enums {
public function __construct(){}
static function string($e) {
$GLOBALS['%s']->push("Enums::string");
$__hx__spos = $GLOBALS['%s']->length;
$cons = Type::enumConstructor($e);
$params = (new _hx_array(array()));
{
$_g = 0;
$_g1 = Type::enumParameters($e);
while($_g < $_g1->length)... |
JavaScript | UTF-8 | 6,894 | 2.6875 | 3 | [] | no_license | var oracleUrl = "historicdata/";
function toggleColor(element, classAttribute) {
$(element).toggleClass(classAttribute);
}
function trimAndStripString(str) {
var result = str.trim();
result = result.replaceAll("%20", " ");
result = trimChar(result, ')');
result = trimChar(result, '(');
if (re... |
Java | UTF-8 | 800 | 1.84375 | 2 | [] | no_license | /*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.yourcompany.struts.form;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
... |
Markdown | UTF-8 | 1,009 | 2.71875 | 3 | [] | no_license | # Ansible-Kubernetes-Role
Just Clone the Respositroy to Set up Kubernetes Cluster in Ubuntu OS
## Installation
```bash
git clone https://github.com/Raghavendra17N/Ansible-Kubernates-Role.git
ansible-playbook k8s.yml
```
## Setting Up Inventory and k8s.yml
##### Set the Inventory with host and user
```bash
[k8s_master]... |
C# | UTF-8 | 914 | 3.015625 | 3 | [] | no_license | using Classes.Enums;
using Classes.Vehicles;
using Entities.Enums;
using Entities.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
namespace Entities.Vehicles
{
public class Bike : BaseVehicle, IBike
{
public Bike(string model, int manufacturedYear, string color)
... |
Python | UTF-8 | 3,715 | 2.59375 | 3 | [] | no_license | # -*- coding:utf-8 -*-
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import mnist
import time
import os
log_dir = 'D:/learning/Python_learning/Python/\
TensorFlow/my_codes/mnist_complete/log/'
data_dir = 'D:/learning/Python_learning/Python/\
TensorFlow/my_codes/mnist_complete/MNI... |
JavaScript | UTF-8 | 940 | 2.515625 | 3 | [] | no_license |
/*
The application supports for downloading a specific
network source code and then archive it into
compressed-file.
*/
const async = require('async')
const exec = require('child_process').exec
const path = require('path')
const _ = require('lodash')
const fs = require('fs')
const dataPath = path.join(__... |
C++ | UTF-8 | 664 | 2.671875 | 3 | [] | no_license | //
// EPITECH PROJECT, 2018
// gomoku
// File description:
// board
//
#pragma once
#define N 0
#define NE 1
#define E 2
#define SE 3
#define S 4
#define SO 5
#define O 6
#define NO 7
class Cell;
class Board
{
public:
Board();
~Board();
public:
bool setSize(int boardSize);
bool setCell(int x, int y, int value);... |
Python | UTF-8 | 645 | 4.21875 | 4 | [] | no_license | def divisible_by_three(num):
return is_divisible_by(num, 3)
def divisible_by_five(num):
return is_divisible_by(num, 5)
def is_divisible_by(number, divisor):
return number % divisor == 0
def generate_fizzbuzz_string_or_number(number):
output_message = ''
if (divisible_by_three(number)):
ou... |
Java | UTF-8 | 12,578 | 1.976563 | 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 br.edu.ifms.loja.usuario.view;
import br.edu.ifms.loja.app.components.ComboBoxUFCidade;
import java.awt.BorderLayout;
import j... |
C++ | UTF-8 | 11,927 | 2.84375 | 3 | [] | no_license | #ifndef BUTTON_H_INCLUDED
#define BUTTON_H_INCLUDED
#include <stdio.h>
#include <string>
#include "SDLincludes.h"
#include "easyShapes.h"
class button
{
private:
SDL_Texture *buttonTexture;
SDL_Texture *textTexture;
SDL_Renderer *rendererCopy;
TTF_Font *font;
shape buttonBox;
public:
button();
... |
Java | UTF-8 | 2,071 | 1.828125 | 2 | [] | no_license | package com.mmall.service;
import com.aliyuncs.exceptions.ClientException;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mmall.dto.SysMenuDto;
import com.mmall.dto.SysUserInfoDto;
import com.mmall.model.Response.Result;
import ... |
C# | UTF-8 | 5,602 | 3.171875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace 도서_관리_닷넷프레임 {
public partial class Form2 : Form {
Form1 form1;
public For... |
Java | UTF-8 | 929 | 3.21875 | 3 | [] | no_license |
package zadanie.pkg1.pkg2;
import java.util.Scanner;
import static java.lang.Math.*;
public class Zadanie12 {
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);
System.out.println("Wpisz tutaj rozmiar swojej tablicy");
... |
Java | UTF-8 | 6,502 | 4.03125 | 4 | [] | no_license |
package proj5mazesolver;
import java.util.InputMismatchException;
import java.util.Scanner;
/**
* MazeSolver Class:
* A MazeSolver object prompts for a width and height of a character maze and
* then for all characters in said maze, separated by whitespace.
* Prints out every solution to the maze, with... |
Python | UTF-8 | 679 | 3.09375 | 3 | [] | no_license | import os
import re
def main():
file = open("input", "r")
array = [[0 for y in range(1000)] for x in range(1000)]
elfs = [True for x in range(1412)]
for line in file:
elf_id, fromx, fromy, tox, toy = [
int(x) for x in re.findall("[0-9]+", line)]
for x in range(fromx, fro... |
Python | UTF-8 | 1,108 | 2.953125 | 3 | [] | no_license | #!/usr/bin/env python
# from http://www.lucainvernizzi.net/blog/2015/02/12/extracting-urls-from-network-traffic-in-just-9-python-lines-with-scapy-http/
# requires https://github.com/invernizzi/scapy-http
from scapy.all import IP, sniff
from scapy.layers import http
from pprint import pprint
def process_intercept(orig... |
Java | UTF-8 | 8,081 | 2.078125 | 2 | [] | no_license | package com.alarmnotification.mobimon;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.AlertDialog;
import android.app.PendingIntent;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import ... |
Java | UTF-8 | 626 | 2.171875 | 2 | [
"Apache-2.0"
] | permissive | package com.danny.blog.dao;
import com.danny.blog.entity.User;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface UserMapper {
int deleteByPrimaryKey(String userId);
int insert(User record);
int insertSelective(User record);
User selectByPrimaryKey(String userId);
/**
*... |
Markdown | UTF-8 | 7,204 | 2.6875 | 3 | [] | no_license |
********
**Council Bill Number: 112419**
********
AN ORDINANCE relating to the organization of the legislative branch of City government; creating within the legislative branch a new department titled the Office of the City Auditor and removing the Office of the City Auditor from the Legislative Department; creati... |
Shell | UTF-8 | 1,026 | 3.15625 | 3 | [
"MIT"
] | permissive | #!/bin/bash
# Update all packages
sudo apt-get update && \
sudo apt-get upgrade -y && \
sudo apt-get dist-upgrade -y && \
sudo apt autoremove -y && \
# Install applications to install Docker & Add snap support
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common snapd && \
# Add t... |
Java | UTF-8 | 336 | 1.859375 | 2 | [] | no_license | package com.controlcenter.homerestipa.provider;
import org.glassfish.hk2.api.Factory;
/**
* Created by david on 17/12/16.
*/
public class RestServiceProvicer implements Factory<RestServices> {
public RestServices provide() {
return RestServiceFactory.getInstance();
}
public void dispose(RestServic... |
Python | UTF-8 | 779 | 2.671875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
class CrackBuilder(object):
'''
Base class to crack builders. Crack builder types(as dynamic or fixed) has
to subclass this class and implement at least all methods.
'''
def __init__(self, type_alias):
self.type_alias = type_alias
def make_crack(self, start_po... |
C++ | UTF-8 | 1,433 | 3.78125 | 4 | [] | no_license | #include "FrogJmp.h"
/*
A small frog wants to get to the other side of the road. The frog is currently located at position X and wants to get to a position greater than or equal to Y. The small frog always jumps a fixed distance, D.
Count the minimal number of jumps that the small frog must perform to reach its targ... |
Java | UTF-8 | 189 | 1.890625 | 2 | [
"MIT"
] | permissive | package org.kpax.foom.domain;
/**
* @author Eugen Covaci {@literal eugen.covaci.q@gmail.com}
* Created on 9/3/2019
*/
public interface Step {
void execute();
StepContext context();
Step next();
}
|
Java | UTF-8 | 2,129 | 2.375 | 2 | [] | no_license | package com.controller;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.H... |
Python | UTF-8 | 114 | 2.703125 | 3 | [] | no_license | def calcula_aumento(s):
n= 0
if s > 1.250:
n = s * 1.1
else:
n = s * 1.15
return n |
Java | UTF-8 | 2,328 | 2.25 | 2 | [] | no_license | package com.kafka.producer.api;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.kafka.producer.domain.LibraryEvent;
import com.kafka.producer.domain.LibraryEventType;
import com.kafka.producer.producer.LibraryEventProducer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpSta... |
Markdown | UTF-8 | 1,512 | 2.546875 | 3 | [] | no_license | # IP Security Camera System
Many IP security cameras offer RTSP video feeds for remote viewing. In order to run analytic software and other tools the user must obtain data from the camera in this manner. Additionally, it would be beneficial to view the video feed within a browser instead of using a proprietary piece ... |
Java | UTF-8 | 2,658 | 2.25 | 2 | [] | no_license | package springtest.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import springtest.exceptions.IncorrectHashException;
import springtest.model.Company;
import springtest.model.Coupon;
import springtest.model.Customer;
import springtest.repository.... |
PHP | UTF-8 | 493 | 2.75 | 3 | [] | no_license | <html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>PT3-4 output</title>
</head>
<body>
<?php
$userA = 'allan';
$userB = 'bill';
$passA = '1234';
$passB = '5678';
if ($_POST['user'] == $userA && $passA == $_POST['pass'])
{
echo '登入成功!Hi, Allan';
}
elseif ($use... |
SQL | UTF-8 | 150 | 2.5625 | 3 | [] | no_license | alter table `article_read_log` change `articleId` `articleSlug` bigint(20) default null;
create INDEX idx_artSlug on `article_read_log` (articleSlug); |
JavaScript | UTF-8 | 1,798 | 2.875 | 3 | [] | no_license | // reduxsauce: serve para facilitar a criação de ducks
import { createReducer, createActions } from 'reduxsauce';
import Immutable from 'seamless-immutable';
// reduxsauce podemos criar os Types e os Creatprs na mesma função
const { Types, Creators } = createActions({
// passa o nome das actions
setPodcastRequest:... |
Java | UTF-8 | 1,561 | 2.609375 | 3 | [] | no_license | package org.jiwan.hibernatetutorial.dto;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import java... |
Markdown | UTF-8 | 450 | 3.421875 | 3 | [] | no_license | # highest--and--lowest--number
highest and lowest number in array using c
#include<studio.h>
int main()
{
int i,max,min,size;
printf("enter size of array");
scanf("%d",&size);
printf("enter elements in array:");
for(i=0;i<size;i++)
{
scant("%d",&arr[i]);
}
max=arr[0];
min=arr[0];
for(i=1;i<size;i++)
{
if(arr[i]>max)
{m... |
SQL | UTF-8 | 291 | 3.609375 | 4 | [] | no_license | --What is the cost after discount for each order? Discounts should be applied as a percentage off.
SELECT o.OrderID, o.OrderDate, sum(od.Quantity * od.UnitPrice * (1 - Discount)) as OrderPrice
FROM Orders o
join [Order Details] od
on od.OrderID = o.OrderID
GROUP BY o.OrderID, o.OrderDate |
PHP | UTF-8 | 495 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
/**
* This install script download scripts needed for examples
*
* php -f install.php
*/
$install = array(
'jquery.js' => 'http://code.jquery.com/jquery-1.8.3.js',
);
foreach ($install as $script => $url) {
$data = @file_get_contents($url);
if (!$data) {
echo 'Error: could not download file ' . $url . ... |
JavaScript | UTF-8 | 3,394 | 2.578125 | 3 | [
"MIT"
] | permissive | function Node(label, amount, color)
{
this.label = label;
this.amount = amount;
this.color = color;
this.children = new Array();
}
//Ca sert a rien a part faire joli
function addEx(node, nb)
{
for (var i = 0; i < nb - 1; i++)
node.children.push(new Node('Exercice ' + (i + 1), 100/n... |
PHP | UTF-8 | 998 | 2.65625 | 3 | [] | no_license | <?php
namespace Nuxia\Bundle\NuxiaBundle\Twig;
use Symfony\Component\DependencyInjection\Container;
/**
* This extension allows you to camelize (ExampleString) and to underscore (example_string) strings from twig templates.
*
* @author Yannick Snobbert <yannick.snobbert@gmail.com>
*/
class CaseExtension extends ... |
C# | UTF-8 | 2,028 | 3.171875 | 3 | [] | no_license | namespace BridgeBeloteLogic.CardDealing
{
using System.Collections.Generic;
using System.Linq;
public static class Rules
{
private static readonly List<BeloteCards> CardsThatCount;
private static readonly List<BeloteCards> AllBelotCards;
static Rules()
{
Ca... |
Python | UTF-8 | 5,782 | 2.78125 | 3 | [] | no_license | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
User interface for demonstration of max-tree and area open filter.
Implementation
C. Meyer
"""
import sys
import numpy as np
import qimage2ndarray
# Qt5 includes
from PyQt5.QtWidgets import QApplication, QMainWindow, QAction, QFileDialog
from PyQt5.QtWidgets import QWid... |
Markdown | UTF-8 | 6,587 | 3.390625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | ---
title: "How to survive as a programmer"
date: 2018-10-30
permalink: /posts/2018/10/how-to-survive-as-programmer/
tags:
excerpt: Programming is fun and here are some tips gathered over 18 years of programming experience on how to survive (and excel) as a programmer
---
 {
super();
this.state = {... |
Markdown | UTF-8 | 741 | 2.546875 | 3 | [] | no_license | # Comments service
This application was generated using http://start.vertx.io
## Requirements
Running the application locally you need Java 1.8.
You also might need to give execution permissions to the mvn wrapper ./mvnw
## Running (with docker)
1. Build (fat) jar with `./mvnw clean package`
2. Create data volume ... |
C# | UTF-8 | 2,032 | 3.171875 | 3 | [
"MIT"
] | permissive | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.ComponentModel;
namespace System.Drawing.Printing;
/// <summary>
/// Retrieves the resolution supported by a printer.
/// </summary>
public partial class PrinterResolu... |
JavaScript | UTF-8 | 3,599 | 3.328125 | 3 | [] | no_license | //INPUT
const gameBoard = document.getElementById('game-board');
document.getElementById('formInput').addEventListener('submit',submitForm);
function submitForm(e){
e.preventDefault();
//clear reset
gameBoard.innerHTML = '';
let axeX = getInputVal('axeX');
let axeY = getInputVal('axeY');
let xAspi = getI... |
Ruby | UTF-8 | 1,144 | 2.828125 | 3 | [] | no_license | class Message
attr_accessor :subject,:priority,:body,:from,:to
def initialize(log)
@log = log
end
def subject=(value)
@subject = value
end
def subject
"#{self.priority} - #{@subject}"
end
def deliver
Pony.mail(:to => @to, :from => @from, :subject... |
Python | UTF-8 | 2,734 | 2.671875 | 3 | [] | no_license | from tweepy import OAuthHandler
from tweepy import Stream
from tweepy import TweepError
import sys
import logging
# Import twitter keys and tokens
from .config import *
# Import listener
from .tools.tweet_listener import TweetStreamListener
from .tools.tweet_api import TweetApiSearch
class TweetSearch():
def __i... |
Java | UTF-8 | 1,327 | 2.5625 | 3 | [] | no_license | package viewstar.doubleauth.demo.entity;
import lombok.Data;
public class ResultUtil {
public static ResponseMessage success(Object object) {
ResponseMessage responseMessage = new ResponseMessage();
responseMessage.setErrorCode(ResultEnum.SUCCESS.getCode());
responseMessage.setErrorMsg(Re... |
C++ | UTF-8 | 967 | 2.8125 | 3 | [] | no_license | class Solution {
public:
int minimumTotal(vector<vector<int> > &triangle) {
if (triangle.empty()) return 0;
int dp[triangle.back().size()];
dp[0] = triangle[0][0];
for (int i = 0; i < triangle.size(); i++) {
int last = 0;
for (int j = 0; j < triangle[i].size()... |
Python | UTF-8 | 9,528 | 2.546875 | 3 | [
"MIT"
] | permissive | import hashlib
import pickle
import re
import socket
import ssl
from .compat import get_charset
from .compat import HTTPError
from .compat import OrderedDict
from .compat import Request
from .compat import urlencode
from .compat import URLError
from .compat import urlopen
try:
import simplejson as json
try:
... |
Java | UTF-8 | 2,455 | 3.671875 | 4 | [] | no_license | /**
* Created by Artem_Mikhalevitch on 5/15/15.
*/
public class SeamCarver {
/**
* Given image.
*/
private Picture picture;
/**
* Constructor. Create a seam carver object based on the given picture.
*
* @param source picture
*/
public SeamCarver(Picture source) {
... |
Java | UTF-8 | 265 | 2.53125 | 3 | [] | no_license | import java.io.FileWriter;
public class Sys {
Sys(Object x) {
System.out.println(x);
}
public static void print(Object x) {
System.out.print(x);
}
public static void println(Object x) {
System.out.println(x);
}
}
|
Java | UTF-8 | 1,676 | 3.28125 | 3 | [] | no_license | package hust.cs.javacourse.search.index.impl;
import hust.cs.javacourse.search.index.AbstractTerm;
import hust.cs.javacourse.search.index.AbstractTermTuple;
import java.util.Objects;
/**
* <pre>
* TermTuple是所有AbstractTermTuple抽象类的派生实现子类.
* 一个TermTuple对象为三元组(单词,出现频率,出现的当前位置).
* 当解析一个文档时,每解析到一个单词,应该产生一个三... |
Java | UTF-8 | 905 | 2.859375 | 3 | [] | no_license | package jp.co.careritz.service;
import jp.co.careritz.entity.currency.ICurrency;
import jp.co.careritz.entity.currency.impl.FiftyYen;
import jp.co.careritz.entity.currency.impl.FiveHundredYen;
import jp.co.careritz.entity.currency.impl.OneHundredYen;
import jp.co.careritz.entity.currency.impl.TenYen;
import jp.co.care... |
PHP | UTF-8 | 372 | 3.046875 | 3 | [] | no_license | <?php
/*
include ou iclude_once:
- O arquivo vai funcionar mesmo que existe algum erro.
*/
//include "inc/exemplo-01.php";
/*
require ou require_once:
- O arquivo deve obrigatóriamente existir e estar funcionando
corretamente.
*/
require_once "inc/exemplo-01.php";
require_once "inc/exemplo-01.php";... |
C++ | UTF-8 | 3,161 | 2.578125 | 3 | [
"MIT"
] | permissive | #include "papelaria.h"
#include "ui_papelaria.h"
Papelaria::Papelaria(QWidget *parent) :
QWidget(parent),
ui(new Ui::Papelaria)
{
ui->setupUi(this);
/*
* Cria conexão com banco de dados sqlite.
*----
* OBS..: enqunto rodando o app pela IDE,
* ele será iniciado um... |
Java | UTF-8 | 657 | 2.59375 | 3 | [] | no_license | package com.mattkula.guesswhom.data.models;
import com.google.gson.annotations.Expose;
import java.io.Serializable;
/**
* Created by matt on 2/9/14.
*/
public class Answer implements Serializable, Comparable<Answer>{
public Answer(String name, String fb_id) {
this.name = name;
this.fb_id = fb_... |
Python | UTF-8 | 940 | 3.828125 | 4 | [] | no_license | """
scoring.py
----------
This module implements methods that help in the similarity scoring.
"""
def score(data, tag_a, tag_b):
""" This method returns the similarity score between two tags
based on 'Jaccard Index' method.
param: data(dict): 'tag' based bookmarks data
param: tag_a(string): a tag to... |
Java | UTF-8 | 305 | 2.015625 | 2 | [] | no_license | package monsterstack.io.partner.domain;
import lombok.Data;
@Data
public class GroupEntryOpportunity {
private Group group;
private Integer slotNumber;
public GroupEntryOpportunity(Group group, Integer slotNumber) {
this.group = group;
this.slotNumber = slotNumber;
}
}
|
Markdown | UTF-8 | 5,989 | 3.25 | 3 | [] | no_license | autoscale: true
# Form Submission & POST Requests
---
## What We Know So Far
* We can pass data to Express by using the URL as arguments
* The POST and PUT http method types are meant for creating and altering entities, respectively
* Using these arguments, we could put them in to SQL queries or other functions
* S... |
JavaScript | UTF-8 | 546 | 3.3125 | 3 | [
"MIT"
] | permissive | const produto = new Object
produto.nome = 'cadeira'
produto['marca do produto'] = 'Generica'
produto.preco = 220
console.log(produto)
delete produto.preco
delete produto['marca do produto']
console.log(produto)
const carro = {
modelo: 'A4',
valor: 89000,
proprietario: {
nome: 'Mateus',
ida... |
Shell | UTF-8 | 1,564 | 3.65625 | 4 | [] | no_license | #!/bin/bash
#结果储存文件夹
res="Result"
#过滤出值的个数
NUM=$1
#mdp文件,步骤数
STEEP = $2
#修改mdp文件
python modif.py md.mdp
#是否已存在Rsult文件夹
if [ -e ${res} ]
then
echo "开始运行"
else
echo "创建目录"${res}
mkdir ${res}
echo "创建完成,开始运行"
fi
for file in `ls mol2`; do
file_new="mol2/"${file}
python ./acpype.py -i ${file_new}
prefix=${file%.... |
Markdown | UTF-8 | 455 | 3.203125 | 3 | [] | no_license | ## Example 1
## Ok
```haskell
oddSquareSum :: Integer
oddSquareSum = sum (takeWhile (<10000) (filter odd (map (^2) [1..])))
```
## Ok
```haskell
oddSquareSum :: Integer
oddSquareSum = sum . takeWhile (<10000) . filter odd . map (^2) $ [1..]
```
## Better
```haskell
oddSquareSum :: Integer
oddSquareSum =
let o... |
Java | UTF-8 | 695 | 1.773438 | 2 | [] | no_license | package com.inhe.mdm.service;
import org.springframework.web.multipart.MultipartFile;
import com.alibaba.fastjson.JSONObject;
import com.inhe.build.result.PageBean;
import com.inhe.mdm.model.MdmAmLine;
import com.inhe.mdm.model.VtMdmAmLine;
public interface IMdmAmLineService {
public PageBean<VtMdmAmLine> queryList... |
Python | UTF-8 | 3,660 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | import requests
from checks import AgentCheck
from dateutil import parser
class ObservatoryCheck(AgentCheck):
@staticmethod
def compose_tags(api_response, hostname):
tags = []
interesting_keys = [
'scan_id',
'grade',
'likelihood_indicator'
]
... |
Java | UTF-8 | 2,815 | 2.125 | 2 | [] | no_license | package com.example.jimi.mystroke.tasks;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.AsyncTask;
import android.util.Base64;
import android.util.Log;
import com.example.jimi.mystroke.AppDatabase;
import com.example.jimi.mystroke.Globals;
impo... |
Python | UTF-8 | 1,994 | 2.515625 | 3 | [] | no_license | """First attempt at GHZ states with Viktor
"""
##------------------PREAMBLE-------------------##
from stdlib import data_loader
#data handling
from stdlib import FitTemplate, fit_lorentzian
#fitting
from stdlib import PlotTemplate
#plotting
import numpy as np
import matplotlib.pyplot as plt
#packages
##----------... |
C# | UTF-8 | 1,881 | 2.953125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace FilesServer.Package
{
/// <summary>
/// Klasa metod komunikacji
/// </summary>
public class ComunicateFunctions
{
/// <summary>
/// Funkcja wy... |
Markdown | UTF-8 | 3,010 | 3.3125 | 3 | [] | no_license | ### (上)
1.在终端` username@hostname$ `或` root@hostname # `,\$表示普通用户,#表示管理员用户 root。
2.shell 脚本通常以 shebang[[1\]](https://gitbook.cn/gitchat/geekbook/5b1f6242fb19f86e62cae899/topic/5b1fabc852823b7111033699#note1) 起始:` #!/bin/bash `
shebang 是一个文本行,其中`#!`位于解释器路径之前。/bin/bash 是 Bash 的解释器命令路径。bash 将以`#`符号开头的行视为注释。脚本中只有第一行可以使用 ... |
Markdown | UTF-8 | 808 | 2.625 | 3 | [
"MIT"
] | permissive | # mflooc
Predicting The Most Dangerous Areas For Flood Disasters Using NASA EarthData Many areas around the world are affected by flood and other water related disasters due to rise in earths temperature, climate change and many other factors. Most of these risky areas are in a zone called the 10m Low Elevation Zone.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.