Skip to content

Instantly share code, notes, and snippets.

View ixaxaar's full-sized avatar
🏔️

ixaxaar ixaxaar

🏔️
View GitHub Profile
@ixaxaar
ixaxaar / nbody.md
Created August 28, 2024 17:21 — forked from Atlas7/nbody.md
High Performance Computing (HPC) with Intel Xeon Phi: N-body Simulation Example

Abstract

Imagine we have n particles in our "universe". These particles have a random initial x, y, and z coordinates to begin with. Defined by Newton's law of universal gravitation, each particle attracts every other particles in this universe using a force that is directly proportional to the product of their masses and inversely proportional to the square of the distance between their centers. As as result, these particles gain (and lose) velocities and change positions over time. The modelling of this physical mechanics is called a N-body simulation.

There currently exists many N-body simulation algorithms. Some are less advanced and highly computational costly (execution time in the order of O(N^2)) - but simple and easy to understand. Some others are more advanced and significantly more efficient (execution in the order of O(n*log(n)) - but not as simple and easy to understand. This articles focuses on the implementation aspect of the less advanced toy algorithm - for the benefit of ease o

Keybase proof

I hereby claim:

  • I am ixaxaar on github.
  • I am ixaxaar (https://keybase.io/ixaxaar) on keybase.
  • I have a public key ASB1_GhKK6fgdyPZ7b47W-Ml_eVJZzPVa9M6YlAXm5ph5Ao

To claim this, I am signing this object:

@ixaxaar
ixaxaar / AgdaBasics.agda
Created February 8, 2019 07:02 — forked from bitonic/AgdaBasics.agda
Agda tutorial
module AgdaBasics where
apply : (A : Set)(B : A → Set) → ((x : A) → B x) → (a : A) → B a
apply A B f a = f a
_∘_ : {A : Set}{B : A → Set}{C : (x : A) → B x → Set}
(f : {x : A}(y : B x) → C x y)(g : (x : A) → B x)
(x : A) → C x (g x)
(f ∘ g) x = f (g x)
#!/bin/sh
###############################################################################################
# Run as ./run_on_save.sh ./file/to/watch ./script/to/run.sh --args --to --give --to --script
###############################################################################################
# get the current path
CURPATH=`pwd`
TO_WATCH=$1
@ixaxaar
ixaxaar / install-chrome.sh
Last active September 19, 2018 06:39 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/bin/bash
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get install -y google-chrome-stable
@ixaxaar
ixaxaar / unmerge_backoff.py
Created July 11, 2018 07:02
Backoff by blocks when batch inserting data somewhere, and a few records tend to fail
from collections import Iterable
def flatten(l):
if not isinstance(l, Iterable):
yield l
else:
for el in l:
if isinstance(el, Iterable) and not isinstance(el, (str, bytes)):
yield from flatten(el)
@ixaxaar
ixaxaar / hadoop_root.sh
Last active June 21, 2018 05:07
Find and extract hadoop root url for use in bash scripts
#!/usr/bin/env bash
HH=`awk '/fs\.defaultFS/{getline; print}' /etc/hadoop/conf/core-site.xml `
HH1=`echo "${HH/<value>/}"`
HADOOP_ROOT=`echo "${HH1/<\/value>/}"`
echo $HADOOP_ROOT
sudo pip uninstall -y azure
sudo pip uninstall -y azure-batch
sudo pip uninstall -y azure-common
sudo pip uninstall -y azure-cosmosdb-nspkg
sudo pip uninstall -y azure-cosmosdb-table
sudo pip uninstall -y azure-datalake-store
sudo pip uninstall -y azure-eventgrid
sudo pip uninstall -y azure-graphrbac
sudo pip uninstall -y azure-keyvault
sudo pip uninstall -y azure-mgmt
@ixaxaar
ixaxaar / mnist_one_shot_aae_classification.ipynb
Created April 30, 2018 07:30
One-shot exemplar classification using Adversarial Autoencoders
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env bash
sudo su -
cd
apt update
apt install -y build-essential libssl-dev libcurl4-openssl-dev automake autoconf git pkg-config libtool libjansson-dev
git clone https://github.com/unitusdev/unitus-cpuminer.git
cd unitus-cpuminer