I hereby claim:
- I am hunj on github.
- I am hunj (https://keybase.io/hunj) on keybase.
- I have a public key ASAJoF7vcKllXYF7TfPzomysgiHFM0Q53xtHso0p8TAv0wo
To claim this, I am signing this object:
## Found in: http://blog.firsthand.ca/2010/09/ruby-rdoc-example.html | |
# * Style guide based on Rails documention | |
module Namespace #:nodoc: don't document this | |
# Generic Namespace exception class | |
class NamespaceError < StandardError | |
end | |
# Raised when... |
I hereby claim:
To claim this, I am signing this object:
Howdy Y'all! I'm @kordless on YouTube and I occasionally play and stream Rust, the game.
This repo is for deploying a Rust Server running on Google Container Engine. Google has a deal going where you can get $300 of free credits for a year on Google Cloud, so it's a good excuse to signup and run your own server. And no, I don't work for Google!
This deployment uses an image built by @dids, which is hosted on Docker Hub: https://hub.docker.com/r/didstopia/rust-server/
This deployment method can be used to start a small server to play with friends or practice building things. In a few days, I'll update the scripts to include a way to save the content you've created, in-game, with others who can then run their own servers and load your content in to explore it for themselves.
For now, start by navigating to Google Cloud and signup for an account. You'll need to enter some credit card details to get this going, but Google is giving you $300 in credits for the next year. Should be e
import inspect | |
frame = inspect.currentframe() | |
args, _, _, values = inspect.getargvalues(frame) | |
print('function name "%s"' % inspect.getframeinfo(frame)[2]) | |
for i in args: | |
print(" %s = %s" % (i, values[i])) |
Calculated pi: 3.1411426428303537942242780347543442930366295786973371671458932366545818227278409801225153144143017877234654331791473934241780222527815976997124640580072509063632954119264908113514189273659207400925115639454931866483310413801725215651956494561820227528441055131891486435804475559444930616327040880110013751718964870608826103262907863482935366920865108138517314664333041630203775471933991748968621077634704338042255281910238779847480935116889611201400175021877734716839604950618827353419177397174646830853856732091511438929866233279159894986873359169896237029628703587948493561695211901487685960745093136642080260032504063007875984498062257782222777847230903862982872859107388423552944118014751843980497562195274409301162645330666333291661457682210276284535566945868233529191148893611701462682835354419302412801600200025003125390673834229278659832479059882485310663832979122390298787348418552319039879984998124765595699462432804100512564070508813601700212526565820727590948868608576072009001125140642580322540 |
from decimal import * | |
def compute_pi(): | |
pi = Decimal(3.0) | |
curr_multiplier = Decimal(2) | |
iteration = Decimal(0) | |
load = Decimal(1) | |
getcontext().prec = 6 | |
while 1: |
require 'benchmark' | |
the_number = 600_851_475_143 | |
# monkeypatching | |
class Fixnum | |
def prime? # O(n) | |
(2..(self - 1)).each do |divisor| | |
return false if self % divisor == 0 | |
end |
require 'csv' | |
# Data generation | |
@data = {} | |
(0..100).each do |i| | |
@data[i] = { | |
:age => Random.rand(18...80), | |
:gender => Random.rand(0..1), | |
:prescription_history => [] |
def perfect_number? number | |
return number == divisors_of(number) | |
end | |
def divisors_of number | |
arr = [] | |
(1..number).each do |iter| | |
if number % iter == 0 | |
arr << iter | |
end |
DESIRED_SIZE = 1073741824 # 1gb | |
FILE_NAME = "dummy" # name of the dummy file | |
dummy_file = File.new(FILE_NAME, "w") | |
while dummy_file.size < DESIRED_SIZE | |
dummy_file.write([0,1].sample) | |
end | |
dummy_file.close |