Skip to content

Instantly share code, notes, and snippets.

Andreas Madsen AndreasMadsen

  • Computationally Demanding
  • Copenhagen, Denmark
Block or report user

Report or block AndreasMadsen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@AndreasMadsen
AndreasMadsen / README.md
Last active Jun 23, 2019
Escape-from-xp
View README.md

From twitter I was told of escape-from-xp ( https://twitter.com/sylwia_erhardt/status/489554167120527360 ). Obiusly I had to hack this an discovered that the code ( https://escapefromxp.azurewebsites.net/game.min.js ) besides not being very compressed, also contained easter eggs for any JavaScript enthusiast. This is how you enable them all:

  1. Go to: https://escapefromxp.azurewebsites.net/#arcade . https://www.modern.ie/en-us/virtualization-tools#escape-from-xp just contain an iframe to this location and #arcade makes sure no redict back to www.modern.ie occurre. #arcade also enables a few other things, you will notice the text have changed a little. Also you now change weapon on F.

  2. Open the JavaScript console in your browser and type:

event = { source: { postMessage: function () {}} };
["hardcoreMode", "originalHacker", "tanksTanksTanks", "IDDQD"].forEach(
  window.ig.game.installServicePack.bind(window.ig.game)
)
@AndreasMadsen
AndreasMadsen / gist:2693051
Created May 14, 2012
base64 shim [atob, btoa]
View gist:2693051
// Source: http://code.google.com/p/gflot/source/browse/trunk/flot/base64.js?r=153
/* Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>
* Version: 1.0
* LastModified: Dec 25 1999
* This library is free. You can redistribute it and/or modify it.
*/
/*
* Interfaces:
@AndreasMadsen
AndreasMadsen / hackTheDom.js
Created Oct 29, 2012
size of TextNode - DOM Hack
View hackTheDom.js
// This is the coolest code snippet I (Mr. Mad) have every created
// It will magicly get the size of a textnode, by createing a context
// range and get the client rects of that range.
// It will then combine the rects to one rect, and thereby get the size
// of the text node.
// Note that by any standarts a TextNode has no size.
var range = document.createRange();
range.selectNode(node);
var rect = range.getBoundingClientRect();
@AndreasMadsen
AndreasMadsen / readme.md
Last active Dec 10, 2018
MKL numpy and scikit on Mac OS X
View readme.md
View size.py
def ilog256_speed(original_num):
# Exponential search to find upper bound
ilog_upper = 8
while (original_num >> ilog_upper) > 0:
ilog_upper = ilog_upper << 1
# The lower bound is the previuse step
ilog_lower = ilog_upper >> 1
@AndreasMadsen
AndreasMadsen / WhatIHaveDone.md
Last active Mar 23, 2018
Playing with smartos
View WhatIHaveDone.md
@AndreasMadsen
AndreasMadsen / README.md
Last active Oct 12, 2017
Install python and friends on DTUs shared user system.
View README.md

PLEASE NOTE: this setup guide have moved to https://github.com/AndreasMadsen/my-setup/tree/master/dtu-hpc-python2 so it is easier to find. PLEASE DO NOT USE THIS GUIDE.

Install python and friends on DTUs shared user system. In particually with OpenCL and CUDA support.

Note the install part only works when using hpc-fe.gbar.dtu.dk as the ssh host! So ThinLinc and login.gbar.dtu.dk won't work. This is because k40sh is needed to compile the OpenCL and CUDA parts. The SSH guide can be found here: http://gbar.dtu.dk/faq/53-ssh (just be sure to replace login.gbar.dtu.dk with hpc-fe.gbar.dtu.dk).

Type or copy this after connecting with SSH, using time this have been messured to take 37 minutes:

k40sh
View gist:91e49e13f0085ececbef0f80c830c5af
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/stream_executor/cuda/cuda_driver.cc:590] creating context when one is currently active; existing: 0x118af890
W tensorflow/stream_executor/cuda/cuda_driver.cc:590] creating context when one is currently active; existing: 0x118b36a0
W tensorflow/stream_executor/cuda/cuda_driver.cc:590] creating context when one is currently active; existing: 0x118b74e0
INFO:tensorflow:0314:14:49:41.625:sg_train.py:312] Training started from epoch[001]-step[0].
W tensorflow/core/common_runtime/bfc_allocator.cc:274] **************************************************************************************_**********xxx
W tensorflow/core/co
View gist:94f5100aff697cdf5ff6c26f90a6dad7
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/common_runtime/bfc_allocator.cc:274] ****************************************************************************************************
W tensorflow/core/common_runtime/bfc_allocator.cc:275] Ran out of memory trying to allocate 148.09MiB. See logs for memory state.
W tensorflow/core/framework/op_kernel.cc:993] Resource exhausted: OOM when allocating tensor with shape[2560,892,1,17]
Traceback (most recent call last):
File "/zhome/ff/2/77654/stdpy3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1022, in _do_call
return fn(*args)
File "/zhome/ff/2/77654/stdpy3/lib/python3.6/site-p
View test_case.py
import numpy as np
import tensorflow as tf
import sugartensor as stf
# set log level to debug
stf.sg_verbosity(10)
@stf.sg_layer_func
You can’t perform that action at this time.