This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
// муха + муха = слон | |
int main() { | |
// Числа не могут начитаться с нуля. | |
// Поэтому муха >= 1000 | |
// и слон = 2*муха содержит 4 числа, поэтому | |
// 2*муха <= 9999 | |
// муха <= 4999 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.List | |
import Control.Monad | |
data Operation = Plus | Minus | Mul | Div deriving (Eq,Ord) | |
data Tree = Compute Operation Tree Tree | Leaf Rational deriving (Eq,Ord) | |
instance Show Tree where | |
show (Compute op a b) = "(" ++ (show a) ++ (show op) ++ (show b) ++")" | |
show (Leaf x) = show (fromRational x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
bool is_mirror(int n) { | |
if (n<=0) return true; | |
int n1, n2; | |
cin >> n1; | |
if (n==1) return true; | |
bool inner_mirror = is_mirror(n-2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void swap(int *a, int *b) { | |
int tmp = *a; *a = *b; *b = tmp; | |
} | |
void move_left(int a[], size_t size, int n) { | |
n = ((n % (int)size) + size) % size; | |
size_t remaining_size = size; | |
for(size_t i=0; i<size-1; i++) { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.spark.ml.linalg.SQLDataTypes.VectorType | |
import org.apache.spark.ml.linalg.{Vector, Vectors} | |
import org.apache.spark.sql.Row | |
import org.apache.spark.sql.expressions.{MutableAggregationBuffer, UserDefinedAggregateFunction} | |
import org.apache.spark.sql.types._ | |
class VectorMean extends UserDefinedAggregateFunction { | |
// This is the input fields for your aggregate function. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python3 | |
from pathlib import Path | |
import subprocess | |
import csv | |
import re | |
linterpath = Path("/mnt/c/Program Files (x86)/Linter/bin/") | |
inl = linterpath / "inl.exe" | |
loarel = linterpath / "loarel.exe" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python3 | |
from urllib.request import * | |
from urllib.parse import unquote | |
import json | |
import re | |
from pprint import pprint | |
match_url="http://www.oddsportal.com/tennis/france/french-open-mixed-doubles/groenefeld-anna-lena-farah-robert-dabrowski-gabriela-bopanna-rohan-Iqu25RYO/" | |
res=urlopen(match_url).read().decode("utf-8") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: Avoids displaying the commands we execute | |
@ECHO OFF | |
:: Adds linter utilities to the path | |
SET PATH=%PATH%;C:\Program Files (x86)\Linter\bin | |
:: Creates a database table named people | |
set sqlstr=CREATE OR REPLACE TABLE people (id INTEGER PRIMARY KEY, name VARCHAR(1024)); | |
echo %sqlstr% | inl -u SYSTEM/MANAGER -n Demo -t -q | |
:: generates the csv | |
del people.csv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PVector centerOrb, centerPup, speed; | |
// Durée autour du comportement en veille | |
int initial_time = 0; | |
int inactivity = 1000; | |
float rotation_inactivity = 0.003; | |
float last_active_angle = 0; | |
// Caractérisitques de l'oeil | |
int rOrb = 50; |