Skip to content

Instantly share code, notes, and snippets.

[00:59:23][Step 1/4] running install_scripts
[00:59:23][Step 1/4] Traceback (most recent call last):
[00:59:23][Step 1/4] File "<string>", line 1, in <module>
[00:59:23][Step 1/4] File "/opt/TeamCity/temp/buildTmp/pip-u7Hfek-build/setup.py", line 12, in <module>
[00:59:23][Step 1/4] 'boto',
[00:59:23][Step 1/4] File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
[00:59:23][Step 1/4] dist.run_commands()
[00:59:23][Step 1/4] File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
[00:59:23][Step 1/4] self.run_command(cmd)
[00:59:23][Step 1/4] File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
---- Minecraft Crash Report ----
WARNING: coremods are present:
CCLCorePlugin (CodeChickenLib-1.10.2-2.5.7.241-universal.jar)
EnderCorePlugin (EnderCore-1.10.2-0.4.1.65-beta.jar)
NEICorePlugin (NotEnoughItems-1.10.2-2.1.3.207-universal.jar)
IC2core (industrialcraft-2-2.6.204-ex110.jar)
AppleCore (AppleCore-mc1.10.2-2.1.2.jar)
CoFH Loading Plugin (CoFHCore-1.10.2-4.1.1.156-universal.jar)
Contact their authors BEFORE contacting forge
@thanatos
thanatos / argparse_in_rust.rst
Last active February 20, 2017 06:07
Argument Parsing in Rust

Basically, I'm looking to follow the POSIX recommendations for argument parsing.

Ideally, being able to have arguments parse themselves into types (e.g., if the arg is an integer, the library helps with the parsing.)

argparse:

  • Fails to make non-optional arguments … non-optional by default.
  • It's ParseResult type isn't a Result. (Actually, sometimes, it is, but it's a Result<(), i32>, which has its own ergonomic problems.
  • Not great support for subcommands. You can do it, but the generated usage strings don't come out right.
  • The author refuses to do rustdoc documentation. It's not so much the refusal to use rustdoc, as the fact that there is simply nothing supplimented. People are free to do as they feel best as to how they generate their documentation, but argparse offers no reference documentation at all.
@thanatos
thanatos / why-not-wsgi.rst
Last active October 17, 2016 02:12
Why NOT WSGI
  • Response body streaming is impossible. wsgi.input looks like it should be a file object, but it isn't, and attempting to treat it like one has some very nasty side effects, down to hosing the connection entirely. Aside from the file-like type that will cause bugs in your code, WSGI doesn't actually support streaming input.
  • It throws its hands in the air w.r.t. decoding. Both of HTTP/1.1 and HTTP/2.0 define the encoding of text elements; by the book decoding is both possible, and unlikely to break anything. But getting headers whose values are bytes is not useful. (I'm not advocating sending non-ASCII text in headers; I'm advocating using the right type for text data.)
@thanatos
thanatos / left-pad.rst
Last active April 1, 2016 02:22
left-pad

leftpad()

What concerns me here is that so many packages took on a dependency for a simple left padding string function, rather than taking 2 minutes to write such a basic function themselves.

Okay, let's start with the original leftpad itself:

@thanatos
thanatos / strict-aliasing.rst
Last active March 17, 2016 05:12
Strict Aliasing

struct to const char* is unspecified behavior

const char* to const struct* is undefined behavior

The following is a violation of the standard:

@thanatos
thanatos / about.rst
Last active August 29, 2015 14:21
Why do these ping packets not get dropped?

Why do these ping packets not get dropped?

See the attached ping outputs, where I get hilariously bad ping times, including this beauty:

64 bytes from 8.8.8.8: icmp_seq=425 ttl=55 time=92255.756 ms

This is on mobile.

There's a corresponding ping to the phone, but it tends to be at about ~2ms. The phone reports terrible signal ("-107 dBm * 3 ASU") for about the first half (up to the part where I'm getting 90 second pings) at which point I move to a window, and my signal improves drastically to "-85 dBm * 14 ASU" (full bars); regardless, the entire time the phone reports that it has "(DC)HSDPA+ * 42.2 Mbps", which I understand to be the best my phone can do (Samsung Galaxy Nexus). Even after moving to the high signal location, the high ping times continue. It's not until I bounce (I go into airplane mode briefly) the antennas on my phone that things improve.

@thanatos
thanatos / printf.py
Created May 1, 2015 04:21
printf() in Python
# Bring together the wonderful .format() function, and print():
def printf(pformat, *args, **kwargs):
print_kwargs = {}
for arg in ('sep', 'end', 'file', 'flush'):
if arg in kwargs:
print_kwargs[arg] = kwargs.pop(arg)
print(pformat.format(*args, **kwargs), **print_kwargs)
@thanatos
thanatos / Cargo.toml
Last active August 29, 2015 14:17
Rust regex! requires `extern crate regex` in `src/lib.rs`?
[package]
name = "regextest"
version = "0.0.1"
[dependencies]
regex = "*"
regex_macros = "*"
@thanatos
thanatos / context_switch_speed.py
Created February 3, 2015 16:12
Context Switches Speeds: OS threads vs. gevent greenlets
from __future__ import print_function
import datetime
import threading
import gevent
# Greenlets: