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 |
|---|---|---|---|---|---|---|---|
Python | UTF-8 | 401 | 2.828125 | 3 | [] | no_license |
def special_reverse_string(txt):
rev=[]
temp=[]
result=""
for char in txt:
temp.append(char)
for i in temp:
if i!=" ":
rev.insert(0,i.lower())
for j in range(len(temp)):
if temp[j].isupper():
rev[j]=rev[j].upper()
if temp[j]==" ":
... |
Java | UTF-8 | 18,551 | 1.554688 | 2 | [] | no_license | package com.creativeshare.agriculturalstockexchange.activities_fragments.home_activity.fragments.fragments_more;
import android.Manifest;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Dialog;
import android.content.Intent;
import android.content.pm.PackageManager;
import andro... |
C# | GB18030 | 4,479 | 2.890625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Collections;
namespace ϵͳ
{
/// <summary>
/// SQL װ
/// </summary>
public class ClsSQLFactory
{
ϵͳ.ClsDataBase clsSQL = ϵͳ.ClsDataBaseFactory.Instance();
private static volatile ClsSQL... |
PHP | UTF-8 | 1,981 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Tests;
use Kwai\Core\Infrastructure\Database\Connection;
use Kwai\Core\Infrastructure\Dependencies\DatabaseDependency;
use Kwai\Modules\Users\Domain\User;
use Kwai\Modules\Users\Domain\UserEntity;
use Kwai\Modules\Users\Infrastructure\Repositories\UserDatabaseRepository;
use P... |
Python | UTF-8 | 3,246 | 2.84375 | 3 | [] | no_license | ## Can be used for Front End
from flask import Flask, request
import pandas as pd
import numpy as np
import pickle
import flasgger
from flasgger import Swagger
app = Flask(__name__)
Swagger(app)
pickle_in = open('model.pkl','rb')
classifier = pickle.load(pickle_in)
@app.route('/')
def Welcome():
return "Welcome... |
Java | UTF-8 | 1,392 | 2.28125 | 2 | [] | no_license | package f4.web.entity;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@Table(name = "score")
public class Score implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column
private Integer studentId;
@Column
... |
C++ | UTF-8 | 2,709 | 2.71875 | 3 | [] | no_license | #pragma once
#include "RendererManager.h"
#include "CameraPositionComponent.h"
#include "InputComponent.h"
#include "WindowHandle.h"
#define CELL_SIZE_FLOAT 16.f
#define CELL_SIZE int(16)
enum CellStance
{
EMPTY = 0,
MINE = 1
};
enum CellStance2
{
NONE = 0,
FLAG = 1,
QUESTION_MARK = 2,
EXPLODE = 3,
RE... |
Markdown | UTF-8 | 2,742 | 3.015625 | 3 | [] | no_license | # How Crypto Is Taxed in the US: A Taxpayer’s Dilemma ...
###### 2019-04-01 19:04
## A taxpayer’s dilemma
Let's imagine a potential 2019 taxpayer sitting in front of his tax advisor and feeling embarrassed to tell him that he had lost 90 percent of a 100K investment in cryptocurrencies when the cryptocurrency market... |
Python | UTF-8 | 16,163 | 2.828125 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | """
Functions for ground state generation for star geometries via imaginary time evolution
"""
import mpnum as mp
from tmps.star.itime.factory import from_hi as propagator_from_hi, from_hamiltonian as propagator_from_hamiltonian
from tmps.utils.random import get_random_mpa
def _propagation(propagator, nof_steps,... |
C++ | UTF-8 | 404 | 2.6875 | 3 | [] | no_license | #include<iostream>
using namespace std;
main(){
static int C[3] = {1000, 500, 100}, ans[3];
int a, b;
while(1){
cin >> a >> b;
if ( a== 0 && b == 0 ) break;
b -= a;
for ( int i = 0; i < 3; i++ ){
ans[3-i-1] = b/C[i];
b = b%C[i];
}
for ( int i = 0; i < 3; i++ ){
... |
C | UTF-8 | 294 | 3.546875 | 4 | [] | no_license | /*
* chapter_2_04.c
*
* Created on: Mar 29, 2019
* Author: Shane
*/
#include <stdio.h>
#include <string.h>
void chapter_2_04(char *a, char *c) {
int i, j;
for (i = j = 0; a[i] != '\0'; i++) {
if (a[i] != c[i]) {
a[j++] = a[i];
}
}
a[j++] = '\0';
printf("%s\n", a);
}
|
JavaScript | UTF-8 | 842 | 2.578125 | 3 | [] | no_license | const express = require('express')
const path = require('path')
const app = express()
const members = require('./data/members')
app.use(express.static(path.join(__dirname, 'public')))
app.use(express.static(path.join(__dirname, 'data')))
var artist = members.artist
console.log(artist[1].name)
app.get('/api/artist',... |
C++ | UTF-8 | 1,952 | 2.9375 | 3 | [] | no_license | #include<iostream>
using namespace std;
#include<vector>
int n, m, d, s;
int basket[50][100];
int dx[] = {0,-1,-1,-1,0,1,1,1};
int dy[] = {-1,-1,0,1,1,1,0,-1}; // ←, ↖, ↑, ↗, →, ↘, ↓, ↙
vector<pair<int, int> > cloud;
bool visit[50][100];
void cloudMove() {
//d 방향으로 s칸이동
d = d - 1; //0부터쓸꺼니까 하나 줄여주고 시작
int x, y;
... |
C++ | UTF-8 | 2,526 | 3.65625 | 4 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
// O(n) space
class Solution {
public:
void replaceVal(TreeNode* root, int a, int b) {
if (!root) return;
... |
Java | UTF-8 | 7,282 | 2.421875 | 2 | [] | no_license | package com.example.iti.sidemenumodule.helperclasses;
import android.app.Activity;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import com.example.iti.sidemenumodule.R;
import c... |
Python | UTF-8 | 223 | 2.8125 | 3 | [] | no_license | """
entity network session
"""
import uuid
class Session(object):
""" Network session
"""
def __init__(self, player, sid=None):
self.player = player
self.sid = sid if sid else str(uuid.uuid4())
|
Java | UTF-8 | 6,175 | 2.203125 | 2 | [] | no_license | package com.android.baselib.image;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.View;
import android.wi... |
Java | UTF-8 | 1,376 | 3.234375 | 3 | [] | no_license | package com.xyz.design_pattern.chapter9;
/**
* Created with IntelliJ IDEA.
* User: vuclip123
* Date: 6/4/14
* Time: 10:39 AM
* To change this template use File | Settings | File Templates.
*/
public class Resume {
private String name;
private String sex;
private String age;
private String timeAr... |
Python | UTF-8 | 202 | 3.03125 | 3 | [] | no_license | def now(text):
f=open(text)
wrds=0
fi=f.readlines()
for lines in fi:
words=lines.split()
wrds=wrds+len(words)
print(wrds)
now(input("enter text file here"))
|
Rust | UTF-8 | 4,340 | 2.84375 | 3 | [
"BSD-3-Clause",
"0BSD",
"LicenseRef-scancode-free-unknown",
"GPL-1.0-or-later",
"MIT",
"Apache-2.0"
] | permissive | use ruff_python_ast::{Expr, Ranged};
use ruff_diagnostics::{Diagnostic, Violation};
use ruff_macros::{derive_message_formats, violation};
use crate::checkers::ast::Checker;
/// ## What it does
/// Checks for the use of legacy `np.random` function calls.
///
/// ## Why is this bad?
/// According to the NumPy document... |
C++ | UTF-8 | 2,082 | 2.625 | 3 | [] | no_license | #include "ShopScreen.h"
ShopScreen::ShopScreen(RenderWindow* w, Player* p) {
window = w;
player = p;
spaceTex.loadFromFile("Textures/general/space.png");
space.setTexture(spaceTex);
space.setPosition(0, 0);
for (int i = 0; i < ChargeChoices; i++) {
ShoptionCharge* shopt = new ShoptionCharge();
shopt->SetPo... |
Java | UTF-8 | 1,329 | 2.875 | 3 | [] | no_license | package dad.javafx.bindings.window;
import javafx.application.Application;
import javafx.beans.binding.Bindings;
import javafx.beans.binding.DoubleExpression;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public cl... |
Java | UTF-8 | 1,361 | 1.820313 | 2 | [] | no_license | package top.leeti.controller;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.... |
Python | UTF-8 | 2,223 | 2.59375 | 3 | [
"MIT"
] | permissive | import sklearn
from sklearn.utils import shuffle
from sklearn.neighbors import KNeighborsClassifier
import pandas as pd
import numpy as np
from sklearn import linear_model, preprocessing
data = pd.read_csv("car.data")
enc = preprocessing.LabelEncoder()
buying = enc.fit_transform(list(data["buying"]))
maint = enc.fit... |
C# | UTF-8 | 3,561 | 2.6875 | 3 | [] | no_license | // 2020-12-24, Bruce
//string sql = "SELECT * FROM Person WHERE LastName = '" + lastName + "' OR '1' = '1'"; // SQL注入
//string sql = string.Format("SELECT * FROM Person WHERE LastName = '{0}'", lastName); // 格式化
//string sql = $"SELECT * FROM Person WHERE LastName = '{lastName}'"; // C#6语法
//string sql = $"SELECT * FR... |
Python | UTF-8 | 249 | 3.703125 | 4 | [] | no_license | w = input("가로를 입력하세요")
h = input("세로를 입력하세요")
try:
area = float(w*h)
preimeter = float(2*(w+h))
except ValueError:
pass
print("사각형의 넓이 : ", area)
print("사각형의 둘레 : ", preimeter)
|
C++ | UTF-8 | 899 | 3 | 3 | [] | no_license | #pragma once
#include "../../core/all.h"
#include "TextBox.h"
///////////////////////////////////////////////////////////////////////////////
/*
Text_Manager class
-class for handling texture data for fonts and rendering
-This class holds ont the texture data for each font and a pointer needs to be passed to every ... |
C# | UTF-8 | 412 | 2.984375 | 3 | [] | no_license | using System.Globalization;
private void Convert_From_Hijri_To_Gregorian(System.Object sender, System.EventArgs e)
{
CultureInfo arCI = new CultureInfo("ar-SA");
string hijri = TextBox1.Text;
DateTime tempDate = DateTime.ParseExact(hijri, "dd/MM/yyyy", arCI.DateTimeFormat, DateTimeStyles... |
Ruby | UTF-8 | 4,322 | 2.609375 | 3 | [
"MIT"
] | permissive | module FathomAnalytics
class Api
LIMIT = 50
attr_reader :url, :email, :password
def initialize(url:, email:, password:)
@url = url
@email = email
@password = password
@auth_token = nil
end
def add_site(name:)
post_request(path: "/api/sites", params: { name: name })... |
Python | UTF-8 | 359 | 2.609375 | 3 | [] | no_license | import urllib.request, urllib.response, urllib.error
fhand = urllib.request.urlopen('http://data.pr4e.org/romeo.txt') #Like open command
counts=dict()
for line in fhand:
#print(line.decode().strip()) #it skipps header, only showing body
words=line.decode().split()
for word in words:
counts[word]=co... |
JavaScript | UTF-8 | 1,724 | 2.625 | 3 | [] | no_license | const commando = require("discord.js-commando");
const req = require("request");
const fs = require("fs");
class Weather extends commando.Command {
constructor(client) {
super(client, {
name : "weather",
memberName : "weather",
description : "Shows you the weather of a g... |
JavaScript | UTF-8 | 6,601 | 4.21875 | 4 | [] | no_license | //Ejercicio 1
//Determina el resultado de un número x elevado a una potencia n.
function elevar(x, y) {
return Math.pow(x, y);
}
console.log("---------------------------------------------------");
console.log("Potencia de 2^4 es:");
console.log(elevar(2, 4))
//Ejercicio 2
//Determina si un número n se ... |
Markdown | UTF-8 | 2,022 | 3.21875 | 3 | [] | no_license | ---
title: No Student Left Behind! A session for true beginners who want to learn Python/Django
layout: talk
body_class: talk
permalink: talks/no-student-left-behind-a-session-for-true-beginners-who-want-to-learn-pythondjango
about: We are a mother and daughter coding team and we're new at it! Deanna (mom) just graduat... |
JavaScript | UTF-8 | 823 | 3.671875 | 4 | [] | no_license | /////// Ingresar dato semana
let dia = prompt("ingrege el dia de la semana");
// if(dia == null){
// console.log("dato nulo, ingrese un dato valido");
// } else{
// console.log("dato valido");
// dia = dia.toLowerCase();
// if (dia == "sabado" || dia == "domingo") {
// console.log("fin de sema... |
Markdown | UTF-8 | 28,960 | 2.59375 | 3 | [] | no_license | # 2018年 西邮Linux兴趣小组 纳新免试题揭秘 - Pangda NoSilly - CSDN博客
2018年05月07日 23:14:59[hepangda](https://me.csdn.net/hepangda)阅读数:765
# 前言
小组2018年的免试题的五位出题人是:小组16级成员刘付杰、李猛、时宇辰、王良、娄泽豪。(此处应有掌声若干秒)
本人虽然参与了出题,但是我对其他关卡知之甚少,于是好奇的我在免试题上线了之后,与大家一起开始了破关之旅。以下以我作为第一视角所写而成的“免试题攻略”,若有错漏,还请多多包涵,与我在评论区进行交流。
# 第一关
目前微信推送中第一关的入口已经下线,想要挑战的同学... |
JavaScript | UTF-8 | 1,119 | 2.546875 | 3 | [] | no_license | /*global define*/
define(['events', 'jquery'], function (events, $) {
'use strict';
var self = {};
self.add = function add() {
var operands = Array.prototype.slice.call(arguments),
total = 0;
operands.forEach(function (value) {
if (typeof value === 'str... |
Python | UTF-8 | 1,234 | 3.1875 | 3 | [] | no_license | from matplotlib import pyplot as plt
import numpy as np
# plt.xkcd() # Cartoonic Style
plt.style.use("fivethirtyeight")
###########################################################################################################################################
# Median Developer Salaries by Age
age... |
Python | UTF-8 | 660 | 4.03125 | 4 | [] | no_license | pet = input("what pet do you have? ")
age = int(input("how old is your pet? "))
human_age = 0
if pet == "cat":
if age == 1:
human_age = 15
elif age == 2:
human_age = 24
if age > 2:
calc_age = age - 2
for i in range(0,calc_age+1):
yrs = i * 4
human_age ... |
Markdown | UTF-8 | 3,083 | 2.5625 | 3 | [
"MIT"
] | permissive | # Autopilot-TensorFlow
A TensorFlow implementation of this [Nvidia paper](https://arxiv.org/pdf/1604.07316.pdf) with some changes. For a summary of the design process and FAQs, see [this medium article I wrote](https://medium.com/@sullyfchen/how-a-high-school-junior-made-a-self-driving-car-705fa9b6e860).
# IMPORTANT
A... |
Shell | UTF-8 | 1,548 | 2.75 | 3 | [] | no_license | # Contributor: William Rea <sillywilly@gmail.com>
# Contributor: Eduard Warkentin <eduard.warkentin@gmail.com>
# Contributor: neuromante <lorenzo.nizzi.grifi@gmail.com>
# Contributor: Eduardo Robles Elvira <edulix@gmail.com>
pkgname=opensc-svn
pkgver=4619
pkgrel=1
pkgdesc="Access smart cards that support cryptographic... |
Python | UTF-8 | 472 | 3.609375 | 4 | [] | no_license | #encoding:utf-8
# num_list = (x for x in range(1,10000))
# print(type(num_list))
# 自己写生成器
# def my_gen():
# yield 1
# yield 2
# yield 3
#
# ret=my_gen()
# print(next(ret))
# print(next(ret))
# print(next(ret))
#send 方法
# def my_gen(start):
# while start<10:
# temp = yield start
# print(... |
Python | UTF-8 | 1,483 | 2.734375 | 3 | [] | no_license | # coding=utf-8
from collections import namedtuple
import pandas as pd
import numpy as np
from statsmodels.tsa.stattools import grangercausalitytests
def gc(df, maxlag, addconst=True, verbose=False, thershold=0.05):
ssr_ftest_explain = ['teststatistic', 'pvalue', 'u', 'degrees_of_freedom']
s = namedtuple('ssr_... |
JavaScript | UTF-8 | 1,059 | 3.421875 | 3 | [] | no_license | //var fs = require('fs');
/*console.time('Assincrono');
var counter = 0;
for(var i =0; i < 1000; i++){
fs.readFile('my_file.txt', function (err, data){
if(err){
return console.error(err);
}
counter++;
console.log("Assincrono: " + data.toString());
if (counter === 1000) {
console.time... |
Java | UTF-8 | 2,565 | 2.21875 | 2 | [] | no_license | /*-
* ========================LICENSE_START=================================
* de.geewhiz.pacify.pacify-maven-plugin
* %%
* Copyright (C) 2011 - 2018 gee-whiz.de
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may ob... |
Python | UTF-8 | 2,064 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | #!python
# -*- coding: utf-8 -*-
"""
Helper functions for test cases in Pyhaystack
"""
# Assume unicode literals as per Python 3
from __future__ import unicode_literals
import hszinc
def grid_meta_cmp(msg, expected, actual):
errors = []
for key in set(expected.keys()) | set(expected.keys()):
if key n... |
Python | UTF-8 | 5,114 | 2.640625 | 3 | [] | no_license | from flask import Response, json
import re, warnings
from .googlemovies import GoogleMovies
from .localization_functions import calculate_expiration_time
class MoviesEndpoint:
def __init__(self, near, days_from_now, use_military_time, local_time_cache, military_time_cache):
self.response = None
sel... |
JavaScript | UTF-8 | 2,803 | 2.6875 | 3 | [
"MIT"
] | permissive |
import React, { useContext, useState } from 'react';
import { useHistory } from "react-router-dom";
import AuthContext from "../context/AuthContext.js";
import { Link } from 'react-router-dom';
import axios from "axios";
export default function Navbar() {
//username tab password login at the extreme right of navbar... |
Markdown | UTF-8 | 10,217 | 3.359375 | 3 | [] | no_license | ---
layout: post
title: "О локаторах в общем"
date: 2017-02-27
---
Немного(или много) будем говорить о локаторах.
Итак, давайте начнем с основ. Для автоматизированного тестирования мы используем
Selenium WebDriver - драйвер, позволяющий писать программы для управления действиями
web браузера (Firefox, Chrome и т.д... |
C# | UTF-8 | 7,263 | 2.859375 | 3 | [] | no_license | namespace SQLDAL
{
using IDAL;
using System.Data;
using System.Data.SqlClient;
using System.Text;
/// <summary>
/// 数据访问类:ContactGroup
/// </summary>
public partial class ContactGroup : IContactGroup
{
/// <summary>
/// Initializes a new instance of the <see cref="C... |
Shell | UTF-8 | 204 | 3.28125 | 3 | [] | no_license | #!/bin/bash
echo "Enter any file name:"
read -p "FileName:" fname
echo "----------------checking-----------------"
sleep 2
if [ -e /root/$fname ]
then
echo "File exists"
else
echo "File not exists"
fi
|
Python | UTF-8 | 170 | 3.03125 | 3 | [] | no_license | import tkinter
def main():
#Create a root window
root = tkinter.Tk ()
#Call the event loop
root.mainloop ()
#Call the function main main()
main() |
JavaScript | UTF-8 | 1,575 | 2.609375 | 3 | [] | no_license | // Import
import React from 'react';
// Local import
// Code
class Header extends React.Component {
// Lifecycle
componentDidMount() {
this.props.actions.loadHeader();
this.checkLogin();
}
checkLogin = () => {
if(localStorage.getItem('username')){
let username = localStorag... |
Java | UTF-8 | 891 | 2.015625 | 2 | [] | no_license | package spring.boot.first.mvc.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.spr... |
Swift | UTF-8 | 1,264 | 3.234375 | 3 | [] | no_license | //
// Game.swift
// NumberBaseball
//
// Created by Changhyun Paik on 2020/07/06.
// Copyright © 2020 Changhyun Baek. All rights reserved.
//
class Game {
private(set) var inning: Inning
private(set) var answer: Answer
private(set) var totalInning: Int = 9
private(set) var inningCount: Int = 1
... |
C++ | UTF-8 | 1,461 | 3.515625 | 4 | [] | no_license |
// Print a given linked list in reverse order. Tail first. You cant change any pointer in the linked list
#include <iostream>
#include<bits/stdc++.h>
class node{
public:
int data;
node * next;
node(int data){
this->data=data;
this->next=NULL;
}
};
using namespace std;
// #include "sol... |
Python | UTF-8 | 254 | 3.84375 | 4 | [] | no_license | # Project Euler | Problem 20 | Jacob Waters
# Find the sum of the digits in the number 100!
# 648
# date : 2015.07.20
import math
def factorialDigitSum(n):
return sum([int(i) for i in str(math.factorial(n))])
print factorialDigitSum(100)
|
Markdown | UTF-8 | 2,363 | 2.828125 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: Can't add a DHCP reservation that is outside of the scope distribution range
description: Provides a solution to an issue where you can't add a DHCP reservation that is outside of the scope distribution range.
ms.date: 05/12/2021
author: Deland-Han
ms.author: delhan
manager: dcscontentpm
audience: itpro
ms.... |
C | UTF-8 | 338 | 3.71875 | 4 | [] | no_license | #include <stdio.h>
int factorial(int a){
if (a == 1 || a == 0)
{
return 1;
}else if (a%2 == 0)
{
return a/2 * factorial(a-1);
}else
{
return a * factorial(a-1);
}
}
int main(){
int a;
scanf("%d", &a);
printf("%d\n", factorial(a));... |
Python | UTF-8 | 907 | 3.34375 | 3 | [] | no_license | dayWords = ["first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth", "ninth", "tenth", "eleventh", "twelfth"]
countWords = ["a", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve"]
items = [
"Partridge in a Pear Tree",
"Turtle Doves",
"French Hens",
"Call... |
Java | UTF-8 | 690 | 1.890625 | 2 | [] | no_license | package com.yhf.xuedaoqian.dao;
import com.yhf.xuedaoqian.model.Leave;
import com.yhf.xuedaoqian.model.reps.LeaveReps;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author yaohengfeng
* @version 1.0
* @date 2020/3/25 11:16
*/
@Mapper
public... |
Markdown | UTF-8 | 754 | 3.15625 | 3 | [] | no_license | ## 文法
https://www.shido.info/lisp/scheme5.html
### if
```scheme
(define (method i)
(if (= i 1)
i
(* i 2)))
```
### let
第1引数が名前と内容のペアのリスト
第2引数の処理内で↑がバインドされる
```scheme
(define (method i)
(let(
(one 1)
(two 2))
display (+ one two i)))
```
### cond
条件とreturnのペアのリスト
elseあり
```scheme
(defin... |
Shell | UTF-8 | 308 | 3.25 | 3 | [] | no_license | #!/bin/bash
stake=100
goal=200
bets=1
won=0
numberOfBet=0
while [[ $stake -lt $goal && $stake -ge $bets ]]
do
numberOfBet=$(($numberOfBet+1))
if [ $((RANDOM%2)) -eq 1 ]
then
stake=$(($stake+$bets))
won=$(($won+1))
else
stake=$(($stake-$bets))
fi
done
echo won = $won
echo number of bet made = $numberOfBet
|
Python | UTF-8 | 193 | 3.734375 | 4 | [] | no_license | print ('====== DESAFIO 05 ======')
n = int(input('Digite um número: '))
a = n - 1
s = n + 1
print('Analisando o valor, podemos ver que seu antecessor é {} e seu sucessor é {}' .format(a, s)) |
Java | UTF-8 | 815 | 3.015625 | 3 | [] | no_license | /**
*
*/
package com.bridgelabz.designpattern.Observerdesignpatern;
/*************************************************************************************************************
*
* purpose:
*
* @author sowjanya467
* @version 1.0
* @since -05-17
*
* *********************************************************... |
JavaScript | UTF-8 | 385 | 3.796875 | 4 | [] | no_license | (function() {
/*
* method invocation 实际上也是一个 property access expression,
* 因此即可以使用(.), 也可以使用([]);
*/
console.log("\n-------------------------------------------------- 01");
const obj01 = {
x: function fn01() {
console.log(this === obj01);
}
};
/* true */
obj01.x();
/* true */
obj... |
C | UTF-8 | 1,276 | 2.765625 | 3 | [] | no_license | #include "czmq.h"
static int s_timer_event (zloop_t *loop, zmq_pollitem_t *item, void *output)
{
zstr_send (output, "PING");
return 0;
}
static int s_socket_event (zloop_t *loop, zmq_pollitem_t *item, void *arg)
{
// Just end the reactor
return -1;
}
void izloop_test (bool verbose)
{
printf (" * ... |
Python | UTF-8 | 242 | 2.921875 | 3 | [] | no_license | read = lambda: eval(input())
read_line = lambda: [int(x) for x in input().split(',')]
ns = read_line()
for i in range(len(ns)):
if (not i or ns[i] > ns[i - 1]) and (i == len(ns) - 1 or ns[i] > ns[i + 1]):
print(i)
exit(0) |
Python | UTF-8 | 331 | 4.40625 | 4 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Thu May 21 16:03:20 2020
輸入一個字元, 判斷是大寫或小寫或是其他字元
@author: ASUS
"""
ch = (input('輸入一個字元:'))
asc=ord(ch)
if asc >= 65 and asc <= 90:
print('大寫')
elif asc >=97 and asc <=122:
print('小寫')
else:
print('請輸入英文字母') |
PHP | UTF-8 | 4,246 | 3.15625 | 3 | [] | no_license | <?php
namespace App;
class Message{
// customer name
private $name;
// customer email address
private $email;
// customer phone number
private $phone;
// customer message body
private $content;
// customer email recipient
private $recipient;
// customer email body
p... |
C# | UTF-8 | 5,733 | 3.640625 | 4 | [] | no_license | using System;
namespace Extensions
{
/// <summary>
/// Algorithms of finding the greatest common divisor with delegate using.
/// </summary>
public static class EuclideanAlgorithmsRefactoring
{
/// <summary>
/// Delegate
/// </summary>
/// <param name="a"></... |
Markdown | UTF-8 | 944 | 4 | 4 | [] | no_license | ## Detail
[Happy^^ numbers](https://www.codewars.com/kata/happy-numbers-2/train/haskell)
A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), o... |
Markdown | UTF-8 | 11,248 | 2.65625 | 3 | [] | no_license | title: Как знакомиться с девушкой
{align=right width=200}
Прочитаешь статью, и понимаешь, что ты должен быть чуть ли не идеалом в общении с девушкой, что вся вина лежит исключительно на парне. Ощущение, что статья написана женщиной для манипуляции мужчиной. Женщина выставлена в вы... |
Python | UTF-8 | 864 | 3.0625 | 3 | [
"MIT"
] | permissive | import sys
sys.setrecursionlimit(1000000000)#just for bigger recursion loop.
x = 1
in_res = None
dec_res = None
def eqnSolve(eqn_state,inc_num):
def solve(eqn:str,increament):
global x
global in_res, dec_res
if eval(eqn) == 0:
y = x
return y
elif eval(eqn) >... |
C++ | UTF-8 | 750 | 2.65625 | 3 | [] | no_license | #include "Camera.h"
#include <math.h>
#ifndef FREECAM_H
#define FREECAM_H
class FreeCamera:public Camera
{
private:
float stepSize;
public:
//constructors
//arcball camera has no meaning without object attached...defaults to looking at origin
FreeCamera();
//always set an arcball camera with the xyz of th... |
Java | UTF-8 | 481 | 1.921875 | 2 | [] | no_license | package edu.unc.cs.htmlBuilder.util;
/**
* @author Andrew Vitkus
*
*/
public interface ITableStylable extends IColorable, IBGColorable {
public void setBorderColor(String color);
public String getBorderColor();
public String getBorderCollapse();
public void setBorderCollapse(String collapse);
... |
C++ | UTF-8 | 1,087 | 2.890625 | 3 | [] | no_license | #pragma once
//STD Headers
#include <functional>
//Library Headers
//Coati Headers
#include "core/input/definitions/Input.h"
namespace core {
enum class MouseButton : unsigned {
LEFT = 0,
RIGHT = 1,
MIDDLE = 2,
THUMB_1 = 3,
THUMB_2 = 4
};
using MouseInput = Input<MouseButton>;
static std::unordered_... |
Python | UTF-8 | 1,691 | 3.796875 | 4 | [] | no_license | '''
Title: 841. Keys and Rooms (Medium) https://leetcode.com/problems/keys-and-rooms/
Runtime: 76 ms, faster than 22.86% of Python online submissions for Keys and Rooms.
Memory Usage: 12.3 MB, less than 5.55% of Python online submissions for Keys and Rooms.
Description:
There are N rooms and you start in room... |
Java | UTF-8 | 640 | 2.140625 | 2 | [] | no_license | package com.zootr.tracker.ootTracker.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
public class ParentObject {
private EntranceParent entrances;
private LocationParent locations;
public ParentObject() {
super();
// TODO Auto-generated constru... |
Java | UTF-8 | 851 | 1.992188 | 2 | [] | no_license | package com.deppon.foss.module.base.baseinfo.api.server.dao.commonselector;
import java.util.List;
import com.deppon.foss.module.base.baseinfo.api.shared.domain.GeneralTaxpayerInfoEntity;
/**
*
* 一般纳税人信息dao接口
* @author 308861
* @date 2016-2-28 下午2:48:41
* @since
* @version
*/
public interface ICommonGeneralT... |
Python | UTF-8 | 12,618 | 3.0625 | 3 | [] | no_license | from itertools import product, chain
import numpy as np
recentering_precision = 1e-7
reach_factor = 10
def get_complex_zeros(square_dimension):
"""
Get matrix of complex zeros
:param square_dimension: Dimension of matrix
:return:
"""
return np.zeros((square_dimension, square_dimension), dtyp... |
Python | UTF-8 | 134 | 3.3125 | 3 | [] | no_license | stack=[]
for i in "hello,world!":
stack.append(i)
list=[]
while len(stack)!=0:
list.append(stack.pop())
print("".join(list)) |
Java | UTF-8 | 222 | 2.578125 | 3 | [] | no_license | package 命令模式;
public class Receiver {
public void bakeChilken(){
System.out.println("烤鸡翅.......");
}
public void bakeMie(){
System.out.println("烤羊肉串儿.......");
}
}
|
Python | UTF-8 | 1,648 | 3.375 | 3 | [] | no_license | from os import system
from time import sleep
import numpy as np
def print_frames(frames):
for i, frame in enumerate(frames):
system('cls')
print(frame['frame'])
print(f"Time-step: {i + 1}")
print(f"State: {frame['state']}")
print(f"Action: {frame['action']}")
print... |
Ruby | UTF-8 | 339 | 3.3125 | 3 | [] | no_license | class Box
def initialize(w,h)
@width,@height=w,h
end
def getWidth
@width
end
def getHeight
@height
end
def setWidth=(value)
@width=value
end
def setHeight=(value)
@height=value
end
end
box=Box.new(10,20)
box.setWidth=30
box.setHeight=40
puts "Width of the box is : #{box.getWidth()}"
puts "Height of the box is : #{... |
Markdown | UTF-8 | 6,833 | 2.671875 | 3 | [] | no_license | ---
layout: post
title: "I spy Alison Spiess kicking some serious a**"
date: 2016-02-24 21:56
author: Beth Crane
tags: [early-career]
location: Texas
company: National Instruments
field: Tech
image: 'images/posts/2015/11/IMG_5322.jpg'
---
*What do you do after a week of being surrounded by women in tech at Grace Hoppe... |
PHP | UTF-8 | 2,757 | 2.796875 | 3 | [] | no_license | <?php
session_start();
if ( !isset($_SESSION["login"])){
header('Location: login.php');
exit;
}
require 'functions.php';
// Ambil Rank dari dari URL
$Rank = $_GET["Rank"];
// Query mahasiswa berdasarkan Rank
$blbuls = query("SELECT * FROM blackbulls WHERE Rank = $Rank")[0];
// Cek ap... |
Ruby | UTF-8 | 552 | 3.75 | 4 | [
"MIT"
] | permissive | input = []
File.open("../input.txt", "r").each_line do |line|
input << line.chomp
end
def count_chars(str)
found = {}
str.chars.each do |c|
found[c] = 0 unless found.has_key? c
found[c] += 1
end
counts = {}
found.values.each do |count|
counts[count] = true
end
return counts
end
def check... |
Java | UTF-8 | 2,861 | 2.359375 | 2 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | package com.st.serviceImpl;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import com.st.mode... |
Java | UTF-8 | 1,820 | 2.484375 | 2 | [] | no_license | package com.app.ebank.mbanking;
import java.util.Date;
/**
* Created by Hichem Himovic on 07/06/2017.
*/
public class PersonModel {
private String nom;
private String prenom;
private String adresse;
private String type;
private String email;
private String password;
private Date date;
... |
Markdown | UTF-8 | 9,468 | 3.921875 | 4 | [] | no_license | # 正则表达式 #
----------
正则表达式用于对字符串模式匹配及检索替换。
**修饰符**
- `g`,全局模式,即模式将被应用于所有字符串,而非在发现第一个匹配项时立即停止;
- `i`,不区分大小写模式,即在确定匹配项时忽略模式与字符串的大小写;
- `m`,多行模式,即在到达一行文本末尾时还会继续查找下一行中是否存在与模式匹配的项;
**元字符**
元字符是拥有特殊含义的字符。
- `.`,查找单个字符,除了换行和行结束符;
- `\w`,查找单词字符;
- `\W`,查找非单词字符;
- `\d`,查找数字;
- `\D`,查找非数字字符;
- `\s`,查找空白字符;
- `\S`,查找非空白字符... |
C# | UTF-8 | 1,533 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | using System;
using System.Collections.Generic;
using System.Text;
//TODO: perhaps instead of having Initialize() to set the internal state, I should use a factory interface that creates
// immutable IResidualCorrection objects.
//TODO: Join this with the version in PCG
//TODO: ICGConvergence.Initialize() must b... |
PHP | UTF-8 | 1,276 | 2.59375 | 3 | [] | no_license | <?php
include("../php_includes/mysqli_connect.php");
if(isset($_POST['bzmobile']) && !empty($_POST['bzmobile'])) {
$bizmobile = preg_replace('#[^0-9+]#i', '', $_POST['bzmobile']);
$mobile = preg_replace('#[^0-9+]#i', '', $_POST['mobile']);
$comment = preg_replace('#[^a-z0-9:.,-?@!=+ \']#i', '', $_POST['comment'])... |
Markdown | UTF-8 | 3,843 | 2.78125 | 3 | [] | no_license | _[mojo](../../modules/mojo/mojo-module.md):[mojo.graphics](../../modules/mojo/mojo-graphics.md).Image_
##### Class Image Extends [std.resource.Resource](../../modules/std/std-resource-resource.md)
The Image class.
An image is a rectangular array of pixels that can be drawn to a canvas using one of the [Canvas.DrawImag... |
JavaScript | UTF-8 | 735 | 3.59375 | 4 | [] | no_license | function Mostrar()
{
//var numero = prompt("ingrese un número entre 0 y 10.");
/*
while(numero<0 || numero>10) //opcion1
{
numero = prompt("Reingrese un número entre 0 y 10.");
}
alert("Bienvenido");
*/
//numero=parseInt(numero);
//while(isNaN(numero) || (numero<0 || numero>10))
// {
// numero... |
Java | UTF-8 | 2,723 | 2.3125 | 2 | [] | no_license | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License")... |
Java | UTF-8 | 2,596 | 2.15625 | 2 | [] | no_license | package com.ecotesch.proy;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import com.android.volley.Requ... |
JavaScript | UTF-8 | 952 | 2.515625 | 3 | [
"MIT"
] | permissive | const { RichEmbed } = require("discord.js");
const { randomInt } = require('mathjs');
module.exports.run = async (bot, msg) => {
let { config } = bot;
var random;
if(msg.author.id == config.owner){
random = randomInt(1,10000)
}else{
random = randomInt(1,300)
}
let cEmbed = new R... |
Java | UTF-8 | 7,459 | 2.203125 | 2 | [
"BSD-3-Clause"
] | permissive | package org.openmrs.module.sana.queue.impl;
import java.util.Date;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.openmrs.Encounter;
import org.openmrs.Obs;
import org.openmrs.Patient;
import org.openmrs.annotation.Authorized;
import org.openmrs.... |
PHP | UTF-8 | 1,551 | 3.15625 | 3 | [] | no_license | <?php
class Promotion {
/**
* @var integer
*/
private $id;
/**
* @var string
*/
private $name;
/**
* @var array
*/
private $variants;
/**
* @var boolean
*/
private $valid = false;
public function __construct($promotion) {
if(!is_array($promotion))
throw new Exception('Not an array');... |
C | UTF-8 | 3,188 | 2.546875 | 3 | [] | no_license | #include "common.h"
#define SHMSZ1 800
#define SHMSZ2 100
#define SHMSZ3 100
#define QUEUE_SIZE 5
void Async_API(client_request *q, int *queue_full, sem_t *semlock, int num_req)
{
int req_count = 0; //keeps track of the number of requests made by process
if(!(*queue_full))
*queue_full = 0; // indicates that ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.