Test cases for the blog post [Encoding tic-tac-toe in 15 bits][post].
Run like this:
# Base4 test
$ cc base4.c && ./a.out
# Base3 test
$ cc base3.c && ./a.outTest cases for the blog post [Encoding tic-tac-toe in 15 bits][post].
Run like this:
# Base4 test
$ cc base4.c && ./a.out
# Base3 test
$ cc base3.c && ./a.out| #!/usr/bin/env bash | |
| # Install Git Large File Storage (LFS) | |
| brew install git-lfs | |
| git lfs install | |
| # Download & Install Llama | |
| git clone https://github.com/ggerganov/llama.cpp | |
| cd llama.cpp | |
| LLAMA_METAL=1 make -j # build with Metal support for (M-series) Apple Silicon |
Since version 2.1 Neo4j provides out-of-the box support for CSV ingestion. The LOAD CSV command that was added to the Cypher Query language is a versatile and powerful ETL tool. It allows you to ingest CSV data from any URL into a friendly parameter stream for your simple or complex graph update operation, that … conversion.
| # taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
| # generate server.xml with the following command: | |
| # openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes | |
| # run as follows: | |
| # python simple-https-server.py | |
| # then in your browser, visit: | |
| # https://localhost:4443 | |
| import BaseHTTPServer, SimpleHTTPServer | |
| import ssl |
| require 'rubygems' | |
| require 'mechanize' | |
| FIRST_NAME = 'FIRST_NAME' | |
| LAST_NAME = 'LAST_NAME' | |
| PHONE = 'PHONE' | |
| EMAIL = 'EMAIL@provider.com' | |
| PARTY_SIZE = 2 | |
| SCHEDULE_RANGE = { :start_time => '19:00', :end_time => '20:30' } |
| #!/bin/bash | |
| NAME="hello_app" # Name of the application | |
| DJANGODIR=/webapps/hello_django/hello # Django project directory | |
| SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket | |
| USER=hello # the user to run as | |
| GROUP=webapps # the group to run as | |
| NUM_WORKERS=3 # how many worker processes should Gunicorn spawn | |
| DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use | |
| DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name |
| GUIDE: https://github.com/jbergantine/django-newproj/blob/master/docs/vagrant.markdown | |
| mkdir website | |
| cd website | |
| curl https://gist.github.com/rileycrane/5326580/raw/294046048b77bfd610685307de31df2199ac4935/Gemfile > Gemfile | |
| bundle |
| # Make sure we're using Ruby 1.9.3 and checkout the heroku-demo branch of our fork | |
| rvm use 1.9.3 | |
| git clone git://github.com/chrisconley/clockworkraven.git my-raven | |
| cd my-raven/ | |
| git checkout heroku-demo | |
| # Create the heroku app and add the Redis and Mysql add-ons | |
| heroku create | |
| heroku addons:add redistogo:nano | |
| heroku addons:add cleardb:ignite |
| import time | |
| import win32api, win32con | |
| VK_CODE = {'left_arrow':0x25, | |
| 'spacebar':0x20, | |
| 'right_arrow':0x27} | |
| def press(x): | |
| win32api.keybd_event(VK_CODE[x], 0,0,0) | |
| win32api.keybd_event(VK_CODE[x],0 ,win32con.KEYEVENTF_KEYUP ,0) |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |