Rabbit built robots.
Why?
Nobody knows. Rabbit doesn't know. The robots definitely don't know, and they've been asked,
| # Copyright 2022 Google LLC. | |
| # SPDX-License-Identifier: Apache-2.0 | |
| # Author: Maithra Raghu <maithra@google.com> | |
| def compute_distance_matrix(patch_size, num_patches, length): | |
| """Helper function to compute distance matrix.""" | |
| distance_matrix = np.zeros((num_patches, num_patches)) |
| .-"-._( ) ) | |
| / , , 66\ | |
| `======\ )_\\=\_o)= | |
| `~~"~ `" |
| using Compat | |
| # Original C version at https://naml.us/post/inverse-of-a-hash-function/ | |
| function inverse_hash(key::UInt64) | |
| local tmp::UInt64 | |
| # Invert key = key + (key << 31) | |
| tmp = key-(key<<31) | |
| key = key-(tmp<<31) |
To the members of the MIT community:
We are writing to inform you of plans to upgrade the MIT campus network, and in particular to upgrade MIT to the next generation of Internet addressing. (Please note that no action is required on your part.)
Machines on the Internet are identified by addresses. The current addressing scheme, called IPv4, was specified around 1980, and allowed for about 4 billion addresses. That seemed enough at the time, which was before local area networks, personal computers and the like, but the Internet research community recognized around 1990 that this supply of addresses was inadequate, and put in place a plan to replace the IPv4 addresses with a new address format, called IPv6. IPv6 uses a 128-bit address scheme and is capable of 340 undecillion addresses (340 times 10^36, or 340 trillion trillion trillion possible IP addresses). This stock of addresses allows great flexibility in how addresses are assigned to hosts, for example allowing every host to use a range of addresses to
| if (platform == "win") { | |
| libc = ctypes.open("Ws2_32.dll"); | |
| var dnsapi = ctypes.open("Dnsapi.dll"); | |
| var DNS_RECORD = new ctypes.StructType("DNS_RECORD"); | |
| DNS_RECORD.define([{"pNext":DNS_RECORD.ptr}, {"pName":ctypes.char.ptr}, {"wType":ctypes.unsigned_short}, | |
| {"wDataLength":ctypes.unsigned_short}, {"DW":ctypes.unsigned_long}, {"dwTtl":ctypes.unsigned_long}, | |
| {"dwReserved":ctypes.unsigned_long}, {"pNameHost":ctypes.char.ptr}]); | |
| var DnsQuery = dnsapi.declare("DnsQuery_A", ctypes.winapi_abi, ctypes.int, ctypes.char.ptr, ctypes.unsigned_short, | |
| ctypes.unsigned_long, ctypes.voidptr_t, DNS_RECORD.ptr, ctypes.voidptr_t); |
| immutable CheapMulBool | |
| x::Bool | |
| end | |
| immutable Negated{T} | |
| x::T | |
| end | |
| immutable BitWrapper | |
| x::Vector{Uint64} | |
| end | |
| Base.getindex(x::BitWrapper, i) = CheapMulBool(!Base.unsafe_bitgetindex(x.x, i)) |
| immutable AListWrapper{Name}; end | |
| immutable AList{Keys<:(AListWrapper...),Types} <: Associative | |
| v::Types | |
| end | |
| macro alist(args...) | |
| keys = Array(Any, length(args)) | |
| values = Array(Any, length(args)) | |
| for i = 1:length(args) | |
| if !Base.Meta.isexpr(args[i], :(=>)) |
| import Base.rem, Base.div, Base.divrem | |
| unsigned_type(::Int8) = Uint8 | |
| unsigned_type(::Int16) = Uint16 | |
| unsigned_type(::Int32) = Uint32 | |
| unsigned_type(::Int64) = Uint64 | |
| unsigned_type(::Int128) = Uint128 | |
| immutable SignedMultiplicativeInverse{T<:Signed} | |
| divisor::T | |
| multiplier::T |
| function iain_magic(n::Int) | |
| # Odd-order magic square | |
| # http://en.wikipedia.org/wiki/Magic_square#Method_for_constructing_a_magic_square_of_odd_order | |
| M = zeros(Int, n, n) | |
| for I = 1:n, J = 1:n # row, column | |
| @inbounds M[I,J] = n*((I+J-1+(n >> 1))%n) + ((I+2J-2)%n) + 1 | |
| end | |
| return M | |
| end |