Skip to content

Instantly share code, notes, and snippets.

View LieutenantChips's full-sized avatar
🍏

Volga Can Karakus LieutenantChips

🍏
View GitHub Profile
private ArrayList<LatLng> closestPoints_stupidSort(ArrayList<Pair<LatLng, Double>> pairs) {
ArrayList<Pair<LatLng, Double>> newPairs = new ArrayList<Pair<LatLng,Double>>();
for(int i = 0; i < pairs.size(); i ++){
if(newPairs.size() == 0){ newPairs.add(new Pair<LatLng, Double>(pairs.get(i).first, pairs.get(i).second)); continue; }
for(int j = 0; j < newPairs.size(); j++){
if(newPairs.get(j).second > pairs.get(i).second){
int jf = (j > 0)? j-1: j;
Log.v("NEW VAL OF JF : ", newPairs.size() + " : " + jf);
newPairs.add(jf, new Pair<LatLng, Double>(pairs.get(i).first, pairs.get(i).second));
from flask import Flask, flash, redirect, render_template, request, url_for
from flaskext.mysql import MySQL
import sys
mysql = MySQL()
app = Flask(__name__)
app.secret_key = 'many random bytes'
app.config['MYSQL_DATABASE_USER'] = 'root'
<!DOCTYPE html>
<html>
<head>
<script src="https://d3js.org/d3.v4.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
function createDivGear(color, strokeWidth, dashArray, cx, cy, r, time, rot){
var svg = d3.select("svg");
import math
from scipy import ndimage as ndi
from skimage import feature
import numpy as np
import os
from scipy import ndimage as ndi
import cv2
import Queue
--ghc 7.10
f :: Integer -> Integer
f 0 = 1
f 1 = 1
f n = f (n-1) + f (n-2)
--I just google searched this.
isPrime :: Integer->Bool
isPrime x = null [y | y<-[2..floor (sqrt (fromIntegral x))], x `mod` y == 0]
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
//The network is required to be connected to the internet
//If you want the IP to be sent to the phone.
const char* ssid = "NAME OF NETWORK HERE";
const char* password = "PASSWORD OF NETWORK HERE";
//the number of steppermotors connected to arduino
package com.volgakarakus.johndeere;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.SeekBar;
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
import sys
import time
import subprocess
num_touch = 0
oldTime = 0
image_count = 0
point_index = 0
final ArrayList<View> allViews = getAllChildren(findViewById(R.id.mainLayout));
if(!allViews.contains(findViewById(R.id.mainLayout)))allViews.add(findViewById(R.id.mainLayout));
findViewById(R.id.mainLayout).getViewTreeObserver().addOnGlobalLayoutListener(
new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
// Layout has happened here.
ArrayList<View> nl = new ArrayList<>();
ArrayList<String> sl = new ArrayList<>();
echo off
rem Copyright (C) 2010 The Android Open Source Project
rem
rem Licensed under the Apache License, Version 2.0 (the "License");
rem you may not use this file except in compliance with the License.
rem You may obtain a copy of the License at
rem
rem http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software