Skip to content

Instantly share code, notes, and snippets.

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

Gabriel Melo Correia gmfc

🏠
Working from home
View GitHub Profile
@gmfc
gmfc / online
Created November 2, 2020 17:44
true
import Ai from "./Ai"
export default class AutomatonAi extends Ai {
constructor(agent) {
super(agent)
this.addAction('Walk to target', action => {
action.score('Fixed 50', ({ wState, agent }) => 50)
action.do(({ wState, agent }) => {
agent.goToTarget()
agent.turnBlack()
var fA = function (toPrt, cb) {
console.log('fA: ' + toPrt)
cb()
}
var fB = function(toPrt) {
console.log('fB: ' + toPrt)
}
fA('oi',fB('tchau'))
@gmfc
gmfc / NGW.js
Created December 4, 2017 15:04
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var ganetics = require('./genetics.js');
var sm = require('simple-statistics');
var csvWriter = require('csv-write-stream');
var fs = require('fs');
function NGW(options) {
this.populationSize = options.populationSize || 10000;
this.targetScore = options.targetScore;
if (!options.targetScore) throw Error("Target Score needs to be set!");
var array = [1,2,3];
// Esta coisa feia:
var arrayOneUp = [];
for(var i=0;i<array.length;i++){
arrayOneUp[i] = array[i] + 1;
}
console.log(arrayOneUp);
// Pode ser feita assim
@gmfc
gmfc / wiki-100k.txt
Created April 13, 2016 19:13 — forked from h3xx/wiki-100k.txt
Wictionary top 100,000 most frequently-used English words [for john the ripper]
#!comment: This is a list of the top 100,000 most frequently-used English words
#!comment: according to Wiktionary.
#!comment:
#!comment: It was compiled in August 2005 and coalesced into a handy list for
#!comment: use in John the Ripper.
#!comment:
#!comment:
#!comment: Pull date: Sun Jan 15 22:03:54 2012 GMT
#!comment:
#!comment: Sources:
@gmfc
gmfc / config.json
Last active December 27, 2015 02:38
{
"email":"SEU@EMAIL.com",
"pass":"pass",
"k1":"https://cleverbot.io/ <--- SEE HERE",
"k2":"https://cleverbot.io/ <--- SEE HERE"
}
package percursos;
public class Percursos {
public void preOrdemRec(Node root) {
if (root != null) {
visit(root);
preOrdemRec(root.getNoE());
preOrdemRec(root.getNoD());
}
}
public void posOrdem(Node root) {
public static void fullRender(Grid grid,int sLevel){
String[] paleta = {" ",".",":","+","!","J","I","M","Q","#",};
double[][] data = grid.getGrid();
for(double[] r:data){
for(double v:r){
int point = (int) (10*v);
if(point-1>sLevel){
System.out.print(paleta[point-1]);
} else {
System.out.print(paleta[0]);
@gmfc
gmfc / Grid.java
Created April 28, 2014 23:51
Fractais, fractais em todos os lugares
package qfrac.fractalizator;
import java.util.Random;
public class Grid {
private final double ANCHOR = 0.5;
private int DATA_SIZE;
private double[][] grid;
private double h = 0.5;