Skip to content

Instantly share code, notes, and snippets.

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

Ariel Vernaza dsapandora

🏠
Working from home
View GitHub Profile
(define (domain n64-zelda-majora)
(:requirements :typing :fluents :durative-actions)
(:types
item cycevt location object
)
(:constants
bow ocarina powder-keg goron-mask eponas-song song-of-time - item
@dsapandora
dsapandora / async.cpp
Last active January 17, 2017 01:57
Async and Await in C++14
#include <future>
#include <iostream>
#include <vector>
// for use of std::accumulate
#if _MSC_VER
#include <numeric>
#else
#include <algorithm>
#endif
# This can be used to get the branch for any case needed.
# Eliminate the white spaces in the beginning and the end of the string
BRANCH=`git branch | grep "*" | cut -d "*" -f2 | sed 's/^[ \t]*//;s/[ \t]*$//'`
@dsapandora
dsapandora / cs
Created April 29, 2017 19:42
follow_camera
using UnityEngine;
using System.Collections;
public class follow_camera: MonoBehaviour {
public GameObject player; //Public variable to store a reference to the player game object
private Vector3 offset; //Private variable to store the offset distance between the player and camera
using CnControls; //Free Packege CN control
using UnityEngine;
namespace CustomJoystick
{
//Requieres to work
[RequireComponent(typeof (Animator))]
[RequireComponent(typeof (CapsuleCollider))]
[RequireComponent(typeof (Rigidbody))]
speed = (transform.position - lastPosition).magnitude;
GameObject FindClosestEnemy()
{
GameObject[] gos;
gos = GameObject.FindGameObjectsWithTag("Enemy");
GameObject closest = null;
float distance = Mathf.Infinity;
Vector3 position = transform.position;
foreach (GameObject go in gos)
{
Vector3 diff = go.transform.position - position;
@dsapandora
dsapandora / Perceptron.c
Last active June 20, 2017 04:49
Single layer Perceptron
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#define LEARNING_RATE 0.1
#define MAX_ITERATION 100
float randomFloat()
{
import java.util.*;
import java.io.*;
import java.text.*;
import java.math.*;
class Perceptron
{
static int MAX_ITER = 100;
static double LEARNING_RATE = 0.1;
static int NUM_INSTANCES = 100;
import numpy as np
class Perceptron:
def __init__(self, n_inputs, learning_rate):
"""
:param n_inputs: the number of inputs of the perceptron
:param learning_rate: the learning rate
"""
self.n_inputs = n_inputs