Skip to content

Instantly share code, notes, and snippets.

View albertogiunta's full-sized avatar

Alberto Giunta albertogiunta

View GitHub Profile
@albertogiunta
albertogiunta / gist:69a9dd1c74f57948c70cbb5bcaa5d8c5
Created May 29, 2023 16:31
Tom Scott video - SRT subtitles
1
00:00:00,120 --> 00:00:02,193
- This is test one.
2
00:00:08,189 --> 00:00:10,859
The Catesby Tunnel in
Northamptonshire, England
3
import { searchWeatherLocation } from "utils/sourceSuggestionFetchers";
import { v4 as uuidv4 } from "uuid";
/*
Generic props with sensible defaults, they should stay in their own file
The input params could be composed even more, by creating a couple more
that capture the various possible sensible configurations
*/
interface ISourceProps {
import Foundation
// MARK: Katana
public protocol State {}
public protocol AnyStateUpdater {}
public protocol AnySideEffect {}
public protocol AnySideEffectContext {
func getAnyState() -> State
}
import Katana
import Ramen
import SBundle
import Storages
import Tempura
final class DependenciesContainer: RamenAppDelegate, SBundleProvider, Provider, <#Other app specific protocols#> {
// MARK: - Basic Dependencies Container requirements
let dispatch: StoreDispatch

Privacy Policy

built the ReadIT 🔥 Never forget to read a link again app as an Ad Supported app. This SERVICE is provided by at no cost and is intended for use as is.

This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.

If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at ReadIT 🔥 Never forget to read a link again unless otherwise defined in this Privacy Policy.

def do_aut_distance(data, sse, aut):
rec_do_aut_distance(sse.coauthor_network(aut), sse, [aut])
def rec_do_aut_distance(graph, sse, already_expanded_list):
for co_aut in graph.nodes():
if co_aut not in already_expanded_list:

Privacy Policy

Alberto Giunta built the JustInTrain app as an Ad Supported app. This SERVICE is provided by Alberto Giunta at no cost and is intended for use as is.

This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.

If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at JustInTrain unless otherwise defined in this Privacy Policy.

def get_bpcer(self, feature_vectors, classes):
# apcer - attack presentation classification error rate: proportion of morphed presentations incorrectly classified as bona fide
# bpcer - bonafide presentation classification error rate: proportion of bona fide presentations incorrectly classified as morphed face attacks
apcer = [0.001, 0.003, 0.005, 0.01, 0.02, 0.03, 0.05, 0.1]
# apcer = [0.05, 0.1]
bpcer = []
X_test = feature_vectors
y_test = classes
self._load_classifier()
@albertogiunta
albertogiunta / Extensions.kt
Created March 20, 2018 10:30
Extension functions (Kotlin) & build.gradle files for Android projects
/**
* ANY
*/
fun Any.toJson(): String = GsonInitializer.toJson(this)
/**
* VIEW
*/
fun View.toggleVisibility(setAsVisible: Boolean) = if (setAsVisible) this.visible() else this.gone()
@albertogiunta
albertogiunta / Hackerrank Twitter University Challenge - Scala
Last active February 18, 2018 16:32
This code was used for the Hackerrank Twitter challenge. The code works well on 6 of the 9 test cases, but they don't tell you what's wrong in the wrong test cases, hence it's quite difficult to know what's wrong.
import java.text.SimpleDateFormat
import java.util.{Calendar, Date}
import scala.collection.mutable
object Solution {
def main(args: Array[String]) {
val rawLogs = mutable.MutableList[String](