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 |
|---|---|---|---|---|---|---|---|
SQL | UTF-8 | 408 | 3.015625 | 3 | [] | no_license | DROP TABLE IF EXISTS `address_book`;
CREATE TABLE `address_book` (
`id` int(11) AUTO_INCREMENT,
`name` varchar(32) NOT NULL,
`birthday` DATE NOT NULL,
`sex` tinyint NOT NULL,
`tel` varchar(32) NOT NULL,
`zip` varchar(8) NOT NULL,
`address` varchar(255) NOT NULL,
`is_used` tinyint NOT NULL DEFAULT 1,
P... |
Python | UTF-8 | 733 | 3.875 | 4 | [] | no_license |
# %%
# Conjunto não garante a ordem da inserção, não é indexado e não aceita repetição
a = {1, 2, 3}
print(type(a))
# a[0]
a = set('coddddd3r')
print(type(a))
print(a)
print('3' in a, 4 not in a)
{1, 2, 3} == {3, 2, 1, 3}
# operacoes
c1 = {1, 2}
c2 = {2, 3}
print(c1.union(c2)) # union() -> união de dois conjuntos g... |
Java | UTF-8 | 493 | 2.09375 | 2 | [
"Apache-2.0"
] | permissive | package nc.bs.lxt.pub;
import java.util.HashMap;
import nc.bs.pub.formulaparse.FormulaParse;
import nc.vo.pub.formulaset.FormulaParseFather;
public class NCBSTool {
static public Object[][] getValueByFormula(String[] formula, HashMap<String, Object> vars) {
FormulaParseFather f = new FormulaParse();
for... |
Python | UTF-8 | 2,753 | 3.34375 | 3 | [] | no_license | from Account import saved_username
from Account import saved_password
account_existence = input("Hello,do you have an account? ")
if account_existence.lower() not in "yesno":
print("Please type Yes if you agree or No if you do not agree next time!")
if account_existence.lower() == "no":
account_m_process = inpu... |
Swift | UTF-8 | 1,768 | 2.609375 | 3 | [] | no_license | //
// TabBarViewController.swift
// TheCodeChallange
//
// Created by Saurav Dutta on 11/08/20.
// Copyright © 2020 Saurav Dutta. All rights reserved.
//
import UIKit
class TabBarViewController: UITabBarController {
override func viewDidLoad() {
super.viewDidLoad()
self.viewControllers = self... |
TypeScript | UTF-8 | 12,753 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | import {isNotNil} from "@w11k/rx-ninja";
import {filter} from "rxjs/operators";
import {createAsyncPromise, createTestFacade, createTestMount} from "../testing";
import {collect} from "../testing/test-utils-internal";
import {Commands, CommandsInvoker} from "./commands";
import {enableTyduxDevelopmentMode} from "./deve... |
Python | UTF-8 | 325 | 3.703125 | 4 | [] | no_license | cost = float (input ("Bonjour, S'il vous plait,mettez le prix de votre déjeuner"))
tip = cost*0.18
tax = 0.25*cost
print ("Vos allez payer por le tip le combien de " "%.2f" % tip, "$" )
print ("Vos allez payer por le tax le combien de " "%.2f" % tax, "$" )
print ("Le prix total est : " "%.2f" % (tip + cost + tax), "... |
Java | UTF-8 | 593 | 1.773438 | 2 | [] | no_license | package com.serious.business.common;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "com.serious.business.common.messages";
static {
reloadMessages();
}
public static void reloadMessages() {
NLS.initializeMessages(BUNDLE_NAME, Messages.class... |
Java | UTF-8 | 9,549 | 2.21875 | 2 | [] | no_license | package school.view;
import java.net.URL;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.ResourceBundle;
import entite.Groupes;
import entite.Salles;
import entite.Sessions;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStrin... |
C++ | UTF-8 | 2,759 | 3.203125 | 3 | [] | no_license | #include "network.h"
#include "random.h"
#include <algorithm>
#include <stdexcept>
struct greater
{
template<class T>
bool operator()(T const &a, T const &b) const
{
return a > b;
}
};
void Network::resize(const size_t& size)
{
values.resize(size);
RandomNumbers rn;
rn.normal(values);
}
bool Netwo... |
Markdown | UTF-8 | 3,316 | 3.71875 | 4 | [] | no_license | # sequencia-maxima
### Objetivo do algoritmo: Identificar sequência crescente de maior soma.
Escreva um programa que leia um inteiro n >= 2 e uma sequência de n números inteiros e imprima um segmento crescente de dois elementos desta sequência, cuja a soma seja a máxima.
O algoritmo deverá receber um ou mais números ... |
TypeScript | UTF-8 | 2,278 | 2.875 | 3 | [
"MIT"
] | permissive | import { Message } from "./dtos";
import { resolve } from "dns";
export type Res = (resData: unknown) => void;
type ListenHandler = (data: unknown | undefined, res: Res) => void;
interface Listener {
eventType: string;
handler: ListenHandler;
}
export interface PendingMessage {
type: string;
resolver: (value... |
Java | UTF-8 | 1,156 | 2.625 | 3 | [] | no_license | package ASM;
import ASM.inst.Inst;
import java.io.PrintStream;
import java.util.ArrayList;
public class ASMBlock {
public ArrayList<Inst> inst = new ArrayList<>();
public String id;
public int cnt = 1; // number of registers
public ASMBlock(String _id) {
id = _id;
}
public void prin... |
PHP | UTF-8 | 3,312 | 2.578125 | 3 | [] | no_license | <?php
class Cimej extends Kawal
{
#***************************************************************************************
public function __construct()
{
parent::__construct();
Kebenaran::kawalKeluar();
}
public function index()
{
$this->papar->baca('cimej/index');
}
function cari()
{ //echo '<br>A... |
C# | UTF-8 | 741 | 2.8125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Challenge_Wed_1
{
class Essay
{
public string Title { get; set; }
public string Thesis { get; set; }
public string AuthorName { get; set; }
public int N... |
Java | UTF-8 | 2,012 | 2.140625 | 2 | [] | no_license | package ph.txtdis.service;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import ph.txtdis.domain.EdmsInvoice;
import ph.txtdis.domain.EdmsTruck;
import ph.txtdis.dto.Keyed;
import ph.txtdis.dto.Truck;
import ph.txtdis.repository.EdmsTruckRepository;
import s... |
Markdown | UTF-8 | 12,429 | 2.765625 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | # VPC Service Controls
This module offers a unified interface to manage VPC Service Controls [Access Policy](https://cloud.google.com/access-context-manager/docs/create-access-policy), [Access Levels](https://cloud.google.com/access-context-manager/docs/manage-access-levels), and [Service Perimeters](https://cloud.goo... |
Python | UTF-8 | 1,194 | 3.84375 | 4 | [] | no_license | """
Given an m x n binary matrix mat, return the distance of the nearest 0 for each cell.
The distance between two adjacent cells is 1.
Example:
Input: mat = [[0,0,0],[0,1,0],[0,0,0]]
Output: [[0,0,0],[0,1,0],[0,0,0]]
"""
class Solution:
"""
思路: BFS
首先将所有 = 0 的 cell 入队,然后通过 BFS 的方法动态的更新当前已经入队的 cell ... |
Python | UTF-8 | 6,940 | 2.5625 | 3 | [] | no_license | #! /usr/bin/env python3
# encoding: utf-8
""" Internationalization for Russian
This module considers dictionary of
pairs of variants of books of Bible abbreviations
with its number in MyBible format, function for preprocessing references from text materials to the common format,
and some text for internationaliz... |
Java | UTF-8 | 11,550 | 1.703125 | 2 | [
"OGL-UK-3.0"
] | permissive | package uk.gov.caz.whitelist.controller;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;
import static org.springframework.test.web.... |
C++ | UTF-8 | 291 | 2.625 | 3 | [] | no_license | #include"condition.h"
inline void Condition::Wait(Mutex* mutex) {
pthread_cond_wait(&condition_, &mutex_->pthread_mutex_);
}
inline void Condition::Signal(){
pthread_cond_signal(&condition_);
}
inline void Condition::BroadCast() {
pthread_cond_broadcast(&condition_);
}
|
Java | UTF-8 | 2,744 | 1.734375 | 2 | [] | no_license | package iih.ci.ord.ems.d;
import xap.mw.core.data.*;
import xap.mw.coreitf.d.*;
import java.math.BigDecimal;
/**
* 医疗单环境信息DTO DTO数据
*
*/
public class UIEmsEnvDTO extends BaseDTO {
private static final long serialVersionUID = 1L;
/**
* 所属集团
* @return String
*/
public String getId_grp() {
return ((Str... |
Shell | UTF-8 | 9,724 | 3.078125 | 3 | [] | no_license | #!/bin/bash
#mysql主从设置,master设置,centos6
#mysql 5.7.23
#环境设置:u 不存在的变量报错;e 发生错误退出;pipefail 管道有错退出
set -euo pipefail
START_TIME=`date +%s`
#########要更改变的变量#######
IP=`ifconfig|sed -n '/inet addr/s/^[^:]*:\([0-9.]\{7,15\}\) .*/\1/p'|head -1`
###MYSQL版本
MYSQL_VERSION="5.7.23"
MAJOR=`echo "${MYSQL_VERSION}"|awk '{print ... |
Python | UTF-8 | 1,560 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | """
File options.
"""
import imp
import os
import shutil
import sys
from fabric.api import runs_once
@runs_once
def _clear_dir(dir_name):
"""
Remove an entire directory tree.
"""
if os.path.isdir(dir_name):
shutil.rmtree(dir_name)
def _clear_file(file_name):
"""
Remove an entire dir... |
Markdown | UTF-8 | 1,355 | 2.71875 | 3 | [] | no_license | <style>
r { color: Red }
o { color: Orange }
g { color: Green }
</style>
# Target
1. Command resolution
- ~~which Command was passed, default Command~~ - <g>Done</g>
- ~~Command parameters verification~~ - <g>Done</g>
1. User connect
- ~~before executing any commands the user should set username~~ - <g>D... |
Python | UTF-8 | 720 | 2.75 | 3 | [] | no_license | """Wrapper around sensor input for the robot"""
import ev3dev.ev3 as ev3
import Colors
# The reflectivity sensor
_LEFT = ev3.ColorSensor('in2')
# The color sensor
_RIGHT = ev3.ColorSensor('in4')
_ULTRA_SONIC = ev3.UltrasonicSensor('in1')
if not _LEFT.connected:
raise AssertionError('Left sensor not connected')
if... |
Markdown | UTF-8 | 6,487 | 3.5625 | 4 | [] | no_license | # 399. Evaluate Division(M)
[399. 除法求值](https://leetcode-cn.com/problems/evaluate-division/)
## 题目描述(中等)
给出方程式 `A / B = k`, 其中 A 和 B 均为代表字符串的变量, k 是一个浮点型数字。根据已知方程式求解问题,并返回计算结果。如果结果不存在,则返回 -1.0。
示例 :
```
给定 a / b = 2.0, b / c = 3.0
问题: a / c = ?, b / a = ?, a / e = ?, a / a = ?, x / x = ?
返回 [6.0, 0.5, -1.0, 1.0, -... |
Ruby | UTF-8 | 444 | 3.5625 | 4 | [] | no_license | class House
def initialize(color, number_of_bedrooms)
self.color = color
self.number_of_bedrooms = number_of_bedrooms
end
def fire_alarm
puts 'STOP DROP AND ROLL'
end
attr_accessor:color
attr_accessor:number_of_bedrooms
end
class Bathroom < House
def flush_toliet
puts 'FLUSHHHH!'
end
attr_acces... |
Java | UTF-8 | 587 | 2.125 | 2 | [] | no_license | package controllers;
import models.Device;
import models.LogItem;
import play.mvc.Controller;
import play.mvc.Result;
import views.html.logItemsViews.indexView;
import java.util.List;
/**
* Created by Luuk on 26/01/15.
*/
public class LogItems extends Controller {
public static Result index() {
List<L... |
Markdown | UTF-8 | 5,748 | 2.578125 | 3 | [
"BSD-3-Clause"
] | permissive |

---
## The Lumpy Ci40 application
The Lumpy Ci40 is part of bigger project called "Weather Station". Using code from this repository you will be able to handle various sensor clicks inserted into your Ci40 board. Values measured by those clicks will be sent to Creator Device Server.
## Environment f... |
C# | UTF-8 | 4,817 | 2.609375 | 3 | [] | no_license | using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using NearLosslessPredictiveCoder.Contracts.Predictors;
using NearLosslessPredictiveCoder.Entities;
using NearLosslessPredictiveCoder.PredictionAlgorithms;
namespace NearLosslessPredictiveCoder.UnitTests
{
[TestClass]
public class BasePredictionAl... |
Java | UTF-8 | 350 | 2.875 | 3 | [] | no_license | import java.util.Calendar;
public class TimeInMilli {
public static void main(String[] args) {
long timeInMill=Calendar.getInstance().getTimeInMillis();
System.out.println("TimeInMilli.main() timeinmili="+timeInMill);
String strLong=String.valueOf(timeInMill);
System.out.println(strLong +" length="+str... |
Markdown | UTF-8 | 179,716 | 3.65625 | 4 | [] | no_license |
# 함수(function)
<center>
<img src="./images/03/func.png", alt="func.png">
</center>
## 들어가기전에
> 직사각형의 둘레와 면적을 구하는 코드를 작성해주세요.
```python
height = 30
width = 20
```
---
```
예시 출력)
직사각형 둘레: 100, 면적: 600입니다.
```
```python
height = 30
width = 20
# 아래에 코드를 작성하세요.
perimeter = (height+width)*2
area = height*width
pr... |
Java | UTF-8 | 2,685 | 1.78125 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2018 Martynas Sateika
*
* 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 agree... |
Markdown | UTF-8 | 11,574 | 2.734375 | 3 | [] | no_license | Background
----------
Using devices such as *Jawbone Up*, *Nike FuelBand*, and *Fitbit* it is
now possible to collect a large amount of data about personal activity
relatively inexpensively. These type of devices are part of the
quantified self movement - a group of enthusiasts who take measurements
about themselves r... |
Java | UTF-8 | 1,945 | 3.625 | 4 | [] | no_license | package com.cyanflxy.leetcode._1;
import com.cyanflxy.leetcode.help.TreeNode;
import java.util.ArrayList;
import java.util.List;
/**
* https://leetcode.com/problems/path-sum-ii/description/
* <p>
* Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
* <p>
* Not... |
Markdown | UTF-8 | 763 | 2.578125 | 3 | [] | no_license | ---
actions: 1
layout: block
level: 4
prerequisites: "source de mise \xE0 mal, alignement mauvais"
rarity: C
source: ??
summary: '-'
title: "Injection n\xE9crotique"
titleEN: Necrotic Infusion
traits:
- general
---
<p>Vous injectez de l’énergie négative dans votre mort‑vivant pour augmenter la puissance de ses attaqu... |
C++ | UTF-8 | 717 | 3.328125 | 3 | [] | no_license | #include "Coord2.h"
#include "CoordException.h"
Coord2::Coord2()
: x(0)
, y(0)
{
//
}
Coord2::Coord2(int x, int y)
: x(x)
, y(y)
{
if(x < 0 || y < 0) {
throw CoordException(x, y, "Values must be greater or equal to zero");
}
}
std::ostream& operator<<(std::ostream& stream, Coord2... |
Markdown | UTF-8 | 1,239 | 2.9375 | 3 | [] | no_license | * 模板定义中,模板的参数列表不能为空!
* 每个类型参数必须以`typename/class`开头,应优先使用`typename`关键字
* 模板接受非类型参数,要求必须是const expression,以便在编译时(模板实例化)执行替换
* 模板代码的生成发生在使用模板时!
* 类模板不能进行类型参数推断!
* 类模板外定义的成员函数必须以类模板开头!且类作用域操作符前要加模板参数(不是模板,而是模板的实例)
* 类模板中的成员函数只有在被使用时才进行实例化!
* 模板类作用域内部可以省略模板参数
* 通过`typename`显式说明一个标识符是类型名而不是变量名
* 新标准下,函数模板和类模板都可以有默认参数,有默认值的形参... |
Java | UTF-8 | 1,018 | 2.40625 | 2 | [
"Apache-2.0"
] | permissive | package projeto.Service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import projeto.Domain.Funcionario;
import projeto.Repository.FuncionarioRepository;
@Service
public class FuncionarioService {
@Autowired
FuncionarioReposi... |
C++ | UTF-8 | 519 | 3 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main () {
int days;
cin >> days;
int logs;
int current;
int total = 0;
for (int x = 0; x < days; x++) {
total = 0;
cin >> logs;
for (int i = 0; i < logs; i++) {
cin >> current;
to... |
Java | UTF-8 | 1,403 | 2.875 | 3 | [] | no_license | package cuoi_ky;
public class Diem {
public double x, y, z;
public Diem() {
}
public Diem(double x, double y, double z) {
this.x = x;
this.y = y;
this.z = z;
}
public double khoangCach(Diem g) {
return Math.pow((x - g.x), 2) + Math.pow(y - g.y, 2) + Math.pow(z... |
Ruby | UTF-8 | 1,460 | 2.65625 | 3 | [
"BSD-2-Clause"
] | permissive | # frozen_string_literal: true
require_relative '../support/test_case'
module DEBUGGER__
class ListTest < TestCase
def program
<<~RUBY
1| p 1
2| p 2
3| p 3
4| p 4
5| p 5
6| p 6
7| p 7
8| p 8
9| p 9
10| p 10
11| p 11
12| p 12
13| ... |
Shell | UTF-8 | 1,207 | 3.46875 | 3 | [] | no_license | #!/bin/bash
##Author : Ravi Tomar ###
### Description :used to show list of flow on jenkins ####
#### dated 01/07/2020 #####
getNifiParameter(){
echo 'fetching nifi parameters from aws'
echo 'Fetching registry_url'
registry_url=`aws ssm get-parameter --name "/a2i/stage/nifi/nifiregistryurl" --with-decrypti... |
Java | UTF-8 | 8,110 | 3.109375 | 3 | [] | no_license | package hcimodify.test1;
import android.util.Log;
public class window {
public int[] window(int [][] RGB, int x0, int y0){ //input is RGB image in 3D array format and the point on the image that the user touches (x0,y0)
int windowcols = RGB.length;
int windowrows = RGB[0].length;
int x1 = x0 - (windowcols ... |
SQL | UTF-8 | 976 | 3.609375 | 4 | [
"Apache-2.0"
] | permissive | CREATE OR REPLACE VIEW "public"."view_users_stats" AS
SELECT users.id,
users.type,
users.created_at,
CASE
WHEN (users.type = 'ti') THEN tis.departement_code
WHEN (users.type = 'individuel') THEN mandataires.departement_code
WHEN (users.type = 'prepose') THEN mandata... |
PHP | UTF-8 | 11,123 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
class Mesa_model extends CI_Model {
public function insertar($idUsuario,$idVotacion)
{
$sinProblemas = true;
$datos = array(
'Id_Usuario' => $idUsuario,
'Id_Votacion' => $idVotacion
);
$this->db->insert('mesa_electoral',$datos);
}
//Devuelve el listado de votaciones d... |
Swift | UTF-8 | 3,045 | 2.578125 | 3 | [] | no_license | //
// SearchUserController.swift
// HundredDays
//
// Created by Vinicius Nadin on 17/04/17.
// Copyright © 2017 Vinicius Nadin. All rights reserved.
//
import UIKit
class SearchUserController: UIViewController, UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate {
// MARK : - Properties
var u... |
Python | UTF-8 | 869 | 2.796875 | 3 | [] | no_license | from sklearn.neighbors import KNeighborsClassifier
from .TrainingData import TrainingData
import logging
logger = logging.getLogger("KNN")
class KNN():
def __init__(self, ug_chords):
training_inputs, training_outputs = TrainingData.getTrainingData(ug_chords)
self.training_inputs = training_inputs
... |
Java | UTF-8 | 1,599 | 2.34375 | 2 | [] | no_license | package org.granchi.mythicgm.client.sucesos;
import org.granchi.mythicgm.client.ComponenteEscenaView;
import org.granchi.mythicgm.client.recursos.Cadenas;
import org.granchi.mythicgm.modelo.EventoAleatorio;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.HTML;
/**
* Panel que muestra un ... |
Java | UTF-8 | 758 | 3.40625 | 3 | [] | no_license | package com.soumyadeep.string;
public class StringAndStringBufferPerformance {
public static void concatWithString() {
String s1="soumyadeep";
for(int i=0; i<10000; i++) {
s1=s1+"soumyadeep";
}
}
public static void concatWithStringBuilder() {
StringBuffer sb= new StringBuffer();
sb.append("soumyade... |
JavaScript | UTF-8 | 1,220 | 2.9375 | 3 | [] | no_license | /**
* Invia una richiesta GET verso la risora checkUsername.do che fa capo alla servlet CheckUsername
* E' atteso un messaggio di risposta dal server con questa forma
*
* <notification>
* <errorOccurred>false</errorOccurred>
* <message>Some text</message>
* <details>Some details</details>
* </notificatio... |
Ruby | UTF-8 | 1,576 | 3.546875 | 4 | [] | no_license | class Award
attr_accessor :name, :expires_in, :quality
def initialize(name, expires_in, quality)
@name = name
@expires_in = expires_in
@quality = quality
end
def max (a,b)
a>b ? a : b
end
def min (a,b)
a>b ? b : a
end
def update_expiration
... |
Python | UTF-8 | 468 | 3.171875 | 3 | [] | no_license | import psycopg2
from config import config
# read connection parameters
params = config()
# connect to the PostgreSQL server
print("Connecting to the PostgreSQL database...")
con = psycopg2.connect(**params)
print("Database opened successfully")
# create a cursor
cur = con.cursor()
# run commands using execute
cur.... |
SQL | UTF-8 | 379 | 3.859375 | 4 | [] | no_license | drop view if exists q9h;
create view q9h
as
select l.country as country, count(distinct b.style) as num
from beers b join brewers bs on b.brewer = bs.id
join locations l on bs.location = l.id
join beerstyles bty on b.style = bty.id
group by l.country
;
drop view if exists q9;
create view q9
as
select country, num as... |
C++ | UTF-8 | 847 | 3.328125 | 3 | [] | no_license | class Solution {
public:
void wiggleSort(vector<int> & arr) {
int n = arr.size();
if (n < 2) return;
// Here we taek care of i - 1 and i + 1 when we are at ith Index.
// -- we need to form : /\ at distance of 2 indexs
for (int i = 1; i < n; i = i + 2) {
... |
SQL | UTF-8 | 1,441 | 2.78125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: May 16, 2019 at 05:59 PM
-- Server version: 5.7.24
-- PHP Version: 7.3.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
JavaScript | UTF-8 | 2,464 | 2.5625 | 3 | [
"MIT"
] | permissive |
function buscaAgendamentos(){
$.ajax({
//Tipo de envio POST ou GET
type: "POST",
dataType: "text",
data: {
action: "buscar"
},
url: "../controller/AvaliacaoController.php",
//Se der tudo ok no envio...
success: function (dados) {
... |
PHP | UTF-8 | 3,142 | 2.609375 | 3 | [] | no_license | <?php
namespace app\addons\card\plat\controllers;
use app\addons\card\plat\controllers\PlatController;
use Yii;
use app\vendor\org\FileUpload;
/**
* Default controller for the `plat` module
*/
class DefaultController extends PlatController
{
/**
* Renders the index view for the module
* @return string
... |
Python | UTF-8 | 449 | 2.59375 | 3 | [] | no_license | import numpy as np
x0=np.ones(10)
x1=np.array([64.3,99.6,145.45,63.75,135.46,92.85,86.97,144.76,59.3,116.03])
x2=np.array([2,3,4,2,3,4,2,4,1,3])
y=np.array([62.55,82.42,132.62,73.31,131.05,86.57,85.49,127.44,55.25,104.84])
X=np.concatenate((x0,x1,x2),axis=0)
X=X.reshape(3,10)
X1=np.mat(X)
X1=X1.T
X=np.array(X1)
Y=y.res... |
Markdown | UTF-8 | 2,055 | 3.53125 | 4 | [] | no_license | title: 内存栅栏(Memory Barrier)和volatile
date: 2015-11-06 23:32:06
tags: [java,并发]
---
内存栅栏是指本地或者工作内存到主存间的拷贝动作。在程序运行过程中。所有变更会先在线程的寄存器或本地cache中完成,然后才会拷贝到主存以跨越内存栅栏。理解内存栅栏先看下面代码:
{% codeblock lang:java %}
public class RaceCondition{
private static boolean done;
public static void main(final String[] args) throws Inte... |
C | UTF-8 | 378 | 4.21875 | 4 | [] | no_license | // Fazer um programa em C leia um número inteiro positivo N e informe se o número é divisível por 3 e 6.
#include <stdio.h>
int main()
{
int n;
scanf("%i", &n);
if (n<0)
{
printf("O NUMERO DEVE SER MAIOR OU IGUAL A ZERO");
} else if ( n%3 == 0 && n%6 == 0) {
printf("SIM");
... |
Rust | UTF-8 | 13,478 | 2.84375 | 3 | [] | no_license | // https://atcoder.jp/contests/code-festival-2018-final-open/tasks/code_festival_2018_final_f
//
#![allow(unused_imports)]
use std::io::*;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;
macro_rules! input {
(source = $s:expr, $($r:tt)*) => {
let mut iter = $s.split_whitespace()... |
SQL | UTF-8 | 4,253 | 3.609375 | 4 | [] | no_license | -- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTI... |
Java | UTF-8 | 2,201 | 1.96875 | 2 | [] | no_license | package com.example.cuma.tinder.Activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import com.example.cuma.tinder.R;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.Mob... |
Java | WINDOWS-1252 | 642 | 1.929688 | 2 | [] | no_license | package com.my;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
@ContextConfiguration(locations = { "/... |
Python | UTF-8 | 1,695 | 2.765625 | 3 | [] | no_license | # pip install sqlalchemy
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import relationship, backref
Base = declarative_base()
class Department(Base):
__tablename__ = 'departments'
idDepartment = Column(Integer, primar... |
JavaScript | UTF-8 | 931 | 2.546875 | 3 | [
"MIT"
] | permissive | import React, { useState, useEffect } from "react";
import Card from "../components/Card/Card";
import API from '../utils/API'
import styled from 'styled-components';
const Container = styled.div`
margin: 1rem auto;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
`;
cons... |
PHP | UTF-8 | 727 | 3.109375 | 3 | [] | no_license | <?php
// $my_db_handle = new PDO(
// 'mysql:host=localhost;dbname=world', // connection string
// 'dev', //username
// '' //password
// );
// $pdo_connection = new PDO(
// 'mysql:dbname=test;host=localhost;charset=utf8', // connection information
// 'root', // username
// 'rootroot' // password
// ... |
JavaScript | UTF-8 | 1,038 | 4.125 | 4 | [] | no_license | 'use strict'
//funciones
// las funciones son un grupo de ordenes agrupado con un numbre concreto,
// en una funcion vamos a tener un conjunto de reglas/funciones/variables, es decir, cosas
// que se van a ejecutar. Podemos usar una funcion tantas veces como querramos
// esta funcion se va a ejecutar cuando se... |
Java | UTF-8 | 1,030 | 1.648438 | 2 | [
"Apache-2.0"
] | permissive | package com.xiaomi.mone.tpc.controller;
import com.xiaomi.mone.tpc.aop.ArgCheck;
import com.xiaomi.mone.tpc.common.param.NodeOrgQryParam;
import com.xiaomi.mone.tpc.common.vo.OrgInfoVo;
import com.xiaomi.mone.tpc.common.vo.PageDataVo;
import com.xiaomi.mone.tpc.common.vo.ResultVo;
import com.xiaomi.mone.tpc.node.NodeO... |
Java | UTF-8 | 1,043 | 2.703125 | 3 | [] | no_license | package generic;
import java.io.FileInputStream;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
public class Excel {
public static String getData(String xl_path, String sheet, int row, int column)
{
String v="";
Workbook wb;
try {
wb=WorkbookFactory.create... |
C# | UTF-8 | 634 | 2.890625 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace mko
{
public class ExceptionHelper
{
public static string FlattenExceptionMessages(Exception ex)
{
if (ex != null)
{
string msg = ex.Message;
... |
Python | UTF-8 | 10,960 | 2.53125 | 3 | [
"BSD-3-Clause"
] | permissive | # Copyright (c) 2015, Scott J Maddox. All rights reserved.
# Use of this source code is governed by the BSD-3-Clause
# license that can be found in the LICENSE file.
import sys
import StringIO
# System and cell definitions/configurations
from .system_config import systems
# Calculte measure_wait
def generate_sto(tar... |
JavaScript | UTF-8 | 6,462 | 3.296875 | 3 | [] | no_license |
/**
* The table dimentions.
* @constant
* @type int
*/
const TABLE_H_OFFSET = 0;
const TABLE_V_OFFSET = 0;
const TABLE_WIDTH = 5;
const TABLE_HEIGHT= 5;
const DEBUG = true;
/* ==================== ROBOT ==================== */
/**
* @class
*
*
* <p>The ROBOT class represents toy robot moving on a squ... |
Python | UTF-8 | 142 | 3.15625 | 3 | [] | no_license | favorieten = ["Foster The People"]
favorieten.append("Tristam")
favorieten[1] = "Braken"
print(favorieten)
"['Foster The People', 'Braken']"
|
C++ | UTF-8 | 2,480 | 2.53125 | 3 | [
"MIT"
] | permissive | //
// 2019-12-12, jjuiddong
// udp/ip server sample
// udp server is only receive module
//
#include "pch.h"
#include "../Protocol/Src/basic_Protocol.h"
#include "../Protocol/Src/basic_ProtocolData.h"
#include "../Protocol/Src/basic_ProtocolHandler.h"
using namespace std;
bool g_isLoop = true;
bool g_print = false;
c... |
Python | UTF-8 | 2,638 | 3.046875 | 3 | [
"MIT"
] | permissive | """Defines MotleyLogConfig to allow config changes should MotleyLogger conflict with other logging extensions."""
class MotleyLogConfig:
"""Configuration settings which can be changed to resolve potential conflicts with other logging extensions.
Used by the motleylog.motleylogger.MotleyLogger class when extend... |
Java | GB18030 | 62,633 | 1.726563 | 2 | [] | no_license | package com.pvi.ap.reader.activity;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.SocketTimeoutException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Link... |
Java | UTF-8 | 766 | 2.15625 | 2 | [] | no_license | package ash.org;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class BaseClass {
public static WebDriver driver;
public static WebDriver getdriver() {
System.setProperty("webdriver.chrome.driver", "C:\\Users\\devap\... |
Java | ISO-8859-1 | 8,030 | 2.9375 | 3 | [] | no_license | class EditorDeImagem {
public static ColorImage img;
private Color c;
private int r;
private int g;
private int b;
private final int MIN = 0;
private final int MAX = 255;
private double[][] sepiaValues = {{0.40,0.77,0.20},{0.35,0.69,0.17},{0.27,0.53,0.13}};
public static final int NOISE = 0;
publ... |
SQL | UTF-8 | 20,506 | 3.625 | 4 | [] | no_license | SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
DROP SCHEMA IF EXISTS `indiosis_main` ;
CREATE SCHEMA IF NOT EXISTS `indiosis_main` DEFAULT CHARACTER SET utf8 COLLA... |
Java | UTF-8 | 596 | 1.921875 | 2 | [] | no_license | /**
* @Title IAccountBO.java
* @Package com.ibis.account.bo
* @Description
* @author miyb
* @date 2015-3-15 下午3:15:49
* @version V1.0
*/
package com.std.forum.bo;
public interface IAccountBO {
/**
* 用户间划账
* @param fromUserId
* @param toUserId
* @param direction
* @param am... |
Java | UTF-8 | 1,024 | 2.546875 | 3 | [] | no_license | package record.dao;
import static fw.JdbcTemplate.*;
import static fw.Query.*;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import record.dto.RecordDTO;
public class RecordDAOImpl implements RecordDAO{
... |
Markdown | UTF-8 | 569 | 3.984375 | 4 | [] | no_license | # Super Primes
A prime number is Super Prime if it is a sum of two primes. Find all the Super Primes upto N
**Example 1:**
```
Input:
N = 5
Output: 1
Explanation: 5 = 2 + 3, 5 is the
only super prime
```
**Example 2:**
```
Input:
N = 10
Output: 2
Explanation: 5 and 7 are super primes
```
**Your Task:**<br>
You d... |
Java | UTF-8 | 517 | 1.882813 | 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 cleansweep;
import cleansweep.CleanSweep;
import cleansweep.CleanSweepImpl;
import utility.Coords;
/**
*
* @author MatthewS... |
Python | UTF-8 | 2,638 | 3.375 | 3 | [
"Unlicense"
] | permissive |
import math
import numpy as np
import matplotlib.pyplot as plt
# Constantes del problema
g = 9.81
m = 1.0
k = 18.0
h = 1.0
l = 2.0
pi = math.pi
# Resuelve la ecuación diferencial por el método de Euler
def euler_solve(A, omega, tMax, div):
# Tamaño del paso en el tiempo
deltaT = tMax / div
# Crea l... |
Java | UTF-8 | 2,107 | 2.90625 | 3 | [] | no_license | package com.walden.javadesignmode.mode.factorymode;
import android.util.Log;
import com.walden.javadesignmode.utils.S;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Random;
/**
* Created by Administrator on 2017/6/20 0020.
*/
public class HeroFactory {
static ArrayList<Class> classLi... |
Python | UTF-8 | 3,704 | 3.59375 | 4 | [] | no_license | """
A solution to a ROSALIND bioinformatics problem.
Problem Title: Compute the Edit Distance Between Two Strings
Rosalind ID: BA5G
URL: http://rosalind.info/problems/ba5g/
"""
def alignRecontructionMoves(backtrack):
n = len(backtrack) - 1
m = len(backtrack[0]) - 1
moves = []
while n > 0 or m ... |
JavaScript | UTF-8 | 4,981 | 2.703125 | 3 | [] | no_license | export function physics(p) {
// current acceleration is throttle (rTrigger) plus negative brake (lTrigger), then scaled down to be more intuitive
p.acceleration = p.input.rTrigger[0] + p.input.lTrigger[0] * -1;
// use acceleration as a multiplier for a limit in slow or fast speed for the current frame
let lim... |
JavaScript | UTF-8 | 116 | 3.140625 | 3 | [] | no_license | var isPowerOfFour = function(num) {
if (num <= 0) return false;
return Math.log2(num)%2===0? true : false;
}; |
C++ | UTF-8 | 317 | 2.734375 | 3 | [] | no_license | class Solution {
public:
int maxJump(vector<int>& stones)
{
int n = stones.size();
if (n==2)
return stones[1];
int ret = 0;
for (int i=0; i+2<n; i++)
ret = max(ret, stones[i+2]-stones[i]);
return ret;
}
};
|
Python | UTF-8 | 758 | 3.6875 | 4 | [] | no_license | str = 'cold'
# enumerate()
list_enumerate = list(enumerate(str))
print('list(enumerate(str) = ', list_enumerate)
#character count
print('len(str) = ', len(str))
d={'name':'nari','phone':83744,'place':'tpt'}
enumerate=list(enumerate(d))
print(enumerate)
st="narendra" #1 reverse of string
print(st[::-1])
name='nar... |
Markdown | UTF-8 | 822 | 3.34375 | 3 | [] | no_license | # lock-free stack
Задание №3: Необходимо реализовать lock-free стэк фиксированного размера (без приоритетов).
Реализовать программу, демонстрирующую корректность работы стэка.
Интерфейс должен быть следующим:
```cpp
template <class T>
class LockFreeStack {
public:
// конструктор стэка с заданной емкостью
Loc... |
C++ | UTF-8 | 212 | 2.734375 | 3 | [] | no_license | # include <iostream>
class HashTable{
int key;
int value;
public:
HashTable():key(0), value(0){
}
HashTable(int k, int val):key(k), value(val){
}
int setValue(){
value++;
}
};
int main(){
} |
Markdown | UTF-8 | 1,171 | 3.53125 | 4 | [] | no_license | **SplitwiseApp**
*Minimize Cash Flow Algorithm*
This project aims to ease several transactions into minimal transactions to make transactions more accessible and efficient. The underlying data structure used for the implementation of the project is heaps that can be visualized through a directed graph.
:
global prefix_url
global suffix_url
global suffix_url1
entity_type = " AND (entitytype:person)"
res = requests.get(prefix_url + txt.strip().lower() + suffix_url +suffix_u... |
TypeScript | UTF-8 | 283 | 2.65625 | 3 | [] | no_license | export interface ICsProcedure {
id?: number;
code?: string;
description?: string;
validityId?: number;
}
export class CsProcedure implements ICsProcedure {
constructor(public id?: number, public code?: string, public description?: string, public validityId?: number) {}
}
|
Markdown | UTF-8 | 1,119 | 2.734375 | 3 | [
"MIT"
] | permissive | ---
title: Myztree
date: '2021-05-09T12:00:00.00Z'
description: 'Timed Rougelike Procedural Dungeon Crawler'
---
<iframe width="560" height="315"
src="https://www.youtube.com/embed/YvqnRPq5gks"
frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen></iframe>
... |
Python | UTF-8 | 170 | 2.9375 | 3 | [] | no_license | def dna_starts_with(in_seq, expected):
return in_seq[:(len(expected))] == expected
assert dna_starts_with('actggt', 'act')
assert not dna_starts_with('actggt', 'agt')
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.