Skip to content

Instantly share code, notes, and snippets.

View Atlas7's full-sized avatar

Johnny Chan Atlas7

  • London, UK
View GitHub Profile
@Atlas7
Atlas7 / theme-son-of-obsidian.css
Created November 22, 2017 18:35 — forked from vgaidarji/theme-son-of-obsidian.css
Son of Obsidian rouge theme
pre.highlight,
.highlight pre { background-color: #272822; }
.highlight .hll { background-color: #22282A }
.highlight .c { color: #99AA8A } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #93C763 } /* Keyword */
.highlight .l { color: #ae81ff } /* Literal */
.highlight .n { color: #F1F2F3 } /* Name */
.highlight .o { color: #E8E2B7 } /* Operator */
.highlight .p { color: #F1F2F3 } /* Punctuation */
@Atlas7
Atlas7 / SGBP.md
Last active March 17, 2025 11:03
Intel Joule, Ubuntu, and Intel RealSense - Setup Instructions

Use this page to jot down notes regarding small garden birdwatch project.

Intel Joule

@Atlas7
Atlas7 / nbody.md
Last active August 28, 2024 17:21
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

@Atlas7
Atlas7 / useful-resource-page.md
Last active October 30, 2023 10:10
Useful Resources

Introduction

Over time I come across lots of useful resources but then quickly forget about them. What a shame. So I have decided to put it all together in this page. Hopefully this page will come in handy one day. Will populate this page from time to time.

Dictionary type web / app

AI / Machine Learning / Deep Learning

@Atlas7
Atlas7 / blog.md
Created January 5, 2016 20:16
Inline commenting within a Jinja2 HTML template

Learnt something new today. If we are to perform an inline commenting within a Jinja2 HTMl template...

The following will be rendered as a comment - via the {# and #} tags.

{# {{ Hello World }} #}

The following however may cause problem - because Jinja2 will try to parse the Python variable Hello and World, which may not exist.

@Atlas7
Atlas7 / remove_postgres_on_mac_os.md
Last active March 23, 2023 13:02
Note - How completely uninstall PostgreSQL 9.X on Mac OSX

This blog post has helped me clean up my postgres development environment on Mac. So making a copy!

How completely uninstall PostgreSQL 9.X on Mac OSX

This article is referenced from stackoverflow:

If installed PostgreSQL with homebrew , enter brew uninstall postgresql

If you used the EnterpriseDB installer , follow the following step.
@Atlas7
Atlas7 / entropy-cost.md
Last active October 5, 2022 05:31
Deep Neural Network - cross entropy cost - np.sum vs np.dot styles

Cross Entropy Cost and Numpy Implementation

Given the Cross Entroy Cost Formula:

cross-entroy-cost-function.png

where:

  • J is the averaged cross entropy cost
  • m is the number of samples
  • super script [L] corresponds to output layer
@Atlas7
Atlas7 / octave_tip.md
Last active December 23, 2021 17:25
Octave - find the min (or max) value of a Matrix, and the associated row and column

Whilst working through the many (Octave) coding assignment from Andrew Ng's Stanford Machine Learning course, a common problem that I have to solve revolves around this:

Given a Matrix A with m rows, and n columns find the mininum (or maximum) value and the associated row and column number

This article summarises my solution to this problem (which, hopefully this will also come in hadny to you!). Note that Octave index start from 1 (instead of 0).

Sample Matrix

Say we have a Matrix A that look like this:

@Atlas7
Atlas7 / gist:d0c0680ae573a72e2d3d
Created January 13, 2016 17:20 — forked from mrcasals/gist:2788529
Rails: Reinstall postgreSQL via brew ang pg gem on Mac OS X
$ brew uninstall postgresql
$ gem uninstall pg # ALL OF THEM
$ rm -fr /usr/local/var/postgres
$ launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
$ pg_ctl -D /usr/local/var/postgres stop -s -m fast # WE SHOULD HAVE ALL postgres SERVERS & PROCESSES STOPPED BY NOW
$ brew install postgres
$ env ARCHFLAGS="-arch x86_64" gem install pg
$ echo "DONE." >> /dev/null