Skip to content

Instantly share code, notes, and snippets.

View JoaoGFarias's full-sized avatar
🏠
Working from home

João Farias JoaoGFarias

🏠
Working from home
View GitHub Profile
@cgrand
cgrand / tarjan.clj
Last active November 18, 2020 03:08
Implementing Tarjan in Clojure, step by step
;; Now, replace the loop by more telling operations.
(defn tarjan
"Returns the strongly connected components of a graph specified by its nodes
and a successor function succs from node to nodes.
The used algorithm is Tarjan's one."
[nodes succs]
(letfn [(sc [env node]
; env is a map from nodes to stack length or nil, nil means the node is known to belong to another SCC
; there are two special keys: ::stack for the current stack and ::sccs for the current set of SCCs
@embs
embs / Getting Started With Subversion.markdown
Created June 3, 2012 19:11
Primeiros passos com o controlador de versão Apache Subversion

Getting Started With Subversion

O que é Subversion (SVN)?

Resposta curta: um controlador de versão.

Resposta longa: não é incomum haver projetos em que mais de um programador desenvolve código simultaneamente. Uma solução para a sincronização do desenvolvimento é a criação de um repositório de código remoto (armazenado em alguma máquina na Internet) para onde cada programador fará o upload do seu código e de onde cada programador poderá fazer o download da versão mais recente do projeto (isto é, baixar modificações realizadas por outros programadores). O, então, Apache SVN

@bellbind
bellbind / genetic.py
Created December 15, 2010 10:46
[python]Genetic Algorithm example
"""Genetic Algorithmn Implementation
see:
http://www.obitko.com/tutorials/genetic-algorithms/ga-basic-description.php
"""
import random
class GeneticAlgorithm(object):
def __init__(self, genetics):
self.genetics = genetics
pass
@HashNuke
HashNuke / gist:608259
Created October 3, 2010 04:13
to undo push and commits
# to undo a git push
git push -f origin HEAD^:master
# to get to previous commit (preserves working tree)
git reset --soft HEAD
# to get back to previous commit (you'll lose working tree)
git reset --hard HEAD^
@btbytes
btbytes / .gitignore
Created March 16, 2009 13:32
A simple Particle Swarm Optimisation implementation in Python
*~
*.pyc