Skip to content

Instantly share code, notes, and snippets.

View quirinpa's full-sized avatar
💭
Evolving

Paulo Andre Azevedo Quirino quirinpa

💭
Evolving
View GitHub Profile
@quirinpa
quirinpa / iv
Last active October 26, 2016 16:09
#!/bin/bash
# iv - a bash image viewer that uses w3mimgdisplay
# Usage: iv [filename]
# Licence: GPL - quirinpa@gmail.com
# Inspired by -
# blog.z3bra.org/2014/01/images-in-terminal.html
# wiki.vifm.info/index.php?title=How_to_preview_images
# Saitoha sensei... Gomen nasai. Ore wa boke desu.
@quirinpa
quirinpa / LICENCE
Last active December 2, 2016 20:29
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
@quirinpa
quirinpa / LICENCE
Last active October 3, 2022 08:51
efficient AVL? help me improve it! - WIP
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
#ifndef RK4_H
#define RK4_H
double rk4(double xi, double yi, double h, double df()) {
double k[4];
k[0] = df(xi, yi);
k[1] = df(xi + h/2, yi + h*k[0])/2;
k[2] = df(xi + h/2, yi + h*k[1])/2;
k[3] = df(xi + h, yi + h*k[2]);
return yi + h(k[0]+2*(k[1]+k[2]) + k[3])/6;
}
/* fileb.h - write/read files bit by bit
*
* MIT License
*
* Copyright (c) 2016 Paulo André Azevedo Quirino
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// very simple SDL snake implementation
#include "SDL/SDL.h"
#include <iostream>
const int squareSize=10;
const int squares=30;
const int hsquares=squares/2;
const int size=squareSize*squares;

Mathematica is great to check results while studying linear algebra:

X = {{2, -1}, {3, -2}};
Print["result ", Eigenvalues[X], " ", Eigenvectors[X]]
calcM[\[Lambda]_] := \[Lambda] IdentityMatrix[2] - X;
Print["how to calculate:"];
MatrixForm[aux = calcM[\[Lambda]]]
r = calcM[\[Lambda] /. #] & /@ (e = Solve[(d = Det[aux]) == 0, \[Lambda]]);
Print[d, " ", \[Lambda] /. e, " ", MatrixForm[#] & /@ r]
v = Table[{ToExpression["v" &lt;&gt; ToString[i]]}, {i, 1, Length[X]}]

Trabalho Prático de Paradigmas de Programação 07/01/2016 - Relatório

Introdução

Este relatório está organizado por tópicos que julgo servirem para para uma introdução rápida ao algoritmo, e foi construído com o intuito de ser fácil de consultar.

Pouco convencional

um relato de insegurança acerca deste relatório

Três fases

fala brevemente sobre as três fases essenciais do simulador

export default function alsoMiddleware() {
return (next) => (action) => {
if (!action.also) return next(action);
const { also, ...rest } = action;
if (typeof also === 'function') {
const alsoRes = also();
const ret = next(rest);
/* global __DEVELOPMENT__, __CLIENT__, __DEVTOOLS__ */
import { createStore, combineReducers, applyMiddleware, compose } from 'redux';
import alsoMiddleware from 'middleware/alsoMiddleware';
import deferMiddleware from 'middleware/deferMiddleware';
import clientMiddlewareCreator from 'middleware/clientMiddlewareCreator';
import waitMiddleware from 'middleware/waitMiddleware';
import { routerStateReducer } from 'redux-react-router';
import * as reducers from 'ducks';
import ApiClient from './ApiClient';