I do all this SSH'd into the DGX Spark from another machine, so everything is terminal commands.
sudo apt install python3-dev
curl -LsSf https://astral.sh/uv/install.sh | sh
| import time | |
| import numpy as NP | |
| from redis import StrictRedis as redis | |
| # a 2D array to serialize | |
| A = 10 * NP.random.randn(10000).reshape(1000, 10) | |
| # flatten the 2D NumPy array and save it as a binary string | |
| array_dtype = str(A.dtype) |
| defmodule Loop do | |
| defmacro while(predicate, do: block) do | |
| quote do | |
| try do | |
| for _ <- Stream.cycle([:ok]) do | |
| if unquote(predicate) do | |
| unquote(block) | |
| else | |
| throw :break | |
| end |
| #!/usr/bin/env python | |
| # | |
| # Converts any integer into a base [BASE] number. I have chosen 62 | |
| # as it is meant to represent the integers using all the alphanumeric | |
| # characters, [no special characters] = {0..9}, {A..Z}, {a..z} | |
| # | |
| # I plan on using this to shorten the representation of possibly long ids, | |
| # a la url shortenters | |
| # |
There are a lot of ways to serve a Go HTTP application. The best choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.
So, these are the different settings we are going to compare:
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| - name: Install wget package (Debian based) | |
| action: apt pkg='wget' state=installed | |
| only_if: "'$ansible_pkg_mgr' == 'apt'" | |
| - name: Install wget package (RedHat based) | |
| action: yum name='wget' state=installed | |
| only_if: "'$ansible_pkg_mgr' == 'yum'" |
| [Unit] | |
| Description=App Redis Sidekick | |
| Requires=docker.service | |
| Requires=etcd.service | |
| After=docker.service | |
| After=etcd.service | |
| After=app-redis.service | |
| BindsTo=app-redis.service |