Skip to content

Instantly share code, notes, and snippets.

View eaa3's full-sized avatar
🤖
Focusing

Ermano Arruda eaa3

🤖
Focusing
View GitHub Profile
@sandello
sandello / sifp.cpp
Created February 29, 2012 23:47
Seemingly Impossible Functional Program in C++
// Ivan Pouzyrevsky, EWSCS'12.
#include <iostream>
#include <functional>
#include <memory>
#include <utility>
// This is a C++ implementation for Seemingly Impossible Functional Program, which in finite time tests whether
// a computable predicate on binary strings yields True for some binary string. It does so by exhaustive search
// on whole space. Some nasty-nasty tricks like call-by-need can make this algorithm run fast.
@cgoldberg
cgoldberg / merge_junit_results.py
Last active February 28, 2025 22:08
Merge multiple JUnit XML results files into a single results file.
#!/usr/bin/env python
"""Merge multiple JUnit XML results files into a single results file."""
# MIT License
#
# Copyright (c) 2012 Corey Goldberg
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@vjt
vjt / copy-from-time-machine.sh
Last active June 21, 2025 01:13
Copy data from a Time Machine volume mounted on a Linux box.
#!/bin/bash
#
# Copy data from a Time Machine volume mounted on a Linux box.
#
# Usage: copy-from-time-machine.sh <source> <target>
#
# source: the source directory inside a time machine backup
# target: the target directory in which to copy the reconstructed
# directory trees. Created if it does not exists.
#
@bomberstudios
bomberstudios / top_100_anime_movies.md
Last active March 3, 2026 22:51
Top 100 Anime Movies Of All Time (from http://imgur.com/a/k2vwE)
  1. Colorful (2010) [T]

    Probably not the title that most people expected to see in the #1 slot. I urge everyone to give it a shot though. No other film has ever brought me through a greater spectrum of emotions. It's a supernatural film, but the characters are so well fleshed out and developed that they feel real. I've probably seen a hundred films since, but none have compared.

  2. Time of Eve (2010) [T]

Director: Yasuhiro Yoshiura - "Sometime in future Japan, androids have been involved in every aspect of peoples lives. One day, upon checking his android's behavioral log, Rikuo, a student, noticed his android's returning times have been odd recently. With his friend Masaki, they found out the place where his android, Sammy, have been visiting: a small cafe called Eve no Jikan where an

@amroamroamro
amroamroamro / README.md
Last active February 24, 2025 18:17
[Python] Fitting plane/surface to a set of data points

Python version of the MATLAB code in this Stack Overflow post: https://stackoverflow.com/a/18648210/97160

The example shows how to determine the best-fit plane/surface (1st or higher order polynomial) over a set of three-dimensional points.

Implemented in Python + NumPy + SciPy + matplotlib.

quadratic_surface

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cryptolok
cryptolok / dbm2m.py
Last active February 13, 2025 09:33
convert WiFi signal strength (dBm) to distance (meters)
#!/usr/bin/env python2
# a simple script for one of my articles - https://cryptolok.blogspot.com/2017/08/practical-wifi-hosts-triangulation-with.html
from math import log10
MHz=raw_input('MHz FREQUENCY (2417, 5200, ...) : ')
MHz=int(MHz)
dBm=raw_input('dBm TRANSMITTER POWER (23, 63, ...) : ')
<!DOCTYPE html>
<html>
<head><title>SOUND</title></head>
<body>
<div>Frequence: <span id="frequency"></span></div>
<script type="text/javascript">
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
var oscillatorNode = audioCtx.createOscillator();
var gainNode = audioCtx.createGain();
@peteflorence
peteflorence / pixelwise_contrastive_loss.py
Last active August 11, 2022 09:15
Pixelwise Contrastive Loss in PyTorch
import torch
class PixelwiseContrastiveLoss(torch.nn.Module):
def __init__(self):
super(PixelwiseContrastiveLoss, self).__init__()
self.num_non_matches_per_match = 150
def forward(self, image_a_pred, image_b_pred, matches_a, matches_b, non_matches_a, non_matches_b):
loss = 0