Skip to content

Instantly share code, notes, and snippets.

@fhorlaville
fhorlaville / loader.swift
Created April 2, 2017 23:33
HackerRank Swift loader functions, to read the input
import Foundation
func loader() {
let line1 = Double(readLine()!)!
let line2 = Int(readLine()!)!
let line3 = readLine()!.components(separatedBy: " ").map{ Int($0)! }
let a = line3[0]
let b = line3[1]
let line4 = (readLine()!.components(separatedBy: " ").map{ Int($0)! }).sorted(by: { $0 > $1 })
let n = Int(readLine()!)!
let line0 = readLine()!.components(separatedBy: " ").map{ Int($0)! }.sorted(by: { $0 > $1 })
var answer = 0
var previous = line0[0]
for i in 0..<n {
if line0[i] == previous {
answer += 1
previous = line0[i]
} else {
@fhorlaville
fhorlaville / ReadMe.md
Last active January 14, 2020 20:37
Robot Electronics ETH008 PHP controlling code - moved to https://github.com/fhorlaville/ETH008

This is my PHP library for controlling a Robot Electronics ETH008 unit. This unit has eight programmable relays and an Ethernet connector.

Here are the files:

  • functions.php This is the library with the functions you need to call

  • tests.php These are the unit tests for the functions library ; it shows how you use the functions

@fhorlaville
fhorlaville / keybase.md
Created August 29, 2015 16:17
keybase.md

Keybase proof

I hereby claim:

  • I am fhorlaville on github.
  • I am fhorlaville (https://keybase.io/fhorlaville) on keybase.
  • I have a public key whose fingerprint is DF48 A057 4400 D693 C4B5 D80D 87D2 F107 0B37 8677

To claim this, I am signing this object: