Skip to content

Instantly share code, notes, and snippets.

View AndreasMadsen's full-sized avatar

Andreas Madsen AndreasMadsen

View GitHub Profile
@AndreasMadsen
AndreasMadsen / graph.json
Last active August 29, 2015 14:04
bug in chrome?
[{"group":4097, "nodes":[["Qualcomm Boosts Stock Buyback Plan, Dividend",5,5280]], "links":[]},
{"group":4098, "nodes":[["Jeffrey Immelt Aims to Assure Investors by Buying Company Stock",5,5281]], "links":[]},
{"group":11786, "nodes":[["The World's Riskiest Stock Market?",5,15376]], "links":[]},
{"group":20494, "nodes":[["Fidelity Investments Creating New Stock-Trading Venue",5,26784]], "links":[]},
{"group":19475, "nodes":[["Investors lose taste for Just Eat as tech stocks slide",2,25699],["Investors lose taste for Just Eat as tech stocks slide",2,25701],["Just Eat causes indigestion as shares fall below listing price",2,25454],["Just Eat causes indigestion as shares fall below listing price",2,25458],["Just Eat causes indigestion as shares fall below listing price",2,25464],["Investors lose taste for Just Eat as tech stocks slide",2,25688]], "links":[[25699,25701,0.0042186519],[25454,25701,0.0522736423],[25454,25699,0.0552179068],[25454,25688,0.0549006723],[25454,25464,0.0005187572],[25454,25458,0.001480041
@AndreasMadsen
AndreasMadsen / README.md
Created July 17, 2014 20:21
d3 force layout overflow

In the figure it is seen that some nodes appear outside the container, this causes them to be hidden. Furthermore it is not possible to drag the figure such that all nodes can be seen.

From the documentation:

The function is evaluated whenever the layout starts. Typically, the distance is specified in pixels; however, the units are arbitrary relative to the layout's size.

While it is not completely clear. I believe this means that the distance is scaled such that all information (nodes) is visible.

@AndreasMadsen
AndreasMadsen / README.md
Last active August 29, 2015 14:04
d3 force layout overflow

In the figure it is seen that some nodes appear outside the container, this causes them to be hidden. Furthermore it is not possible to drag the figure such that all nodes can be seen.

From the documentation:

The function is evaluated whenever the layout starts. Typically, the distance is specified in pixels; however, the units are arbitrary relative to the layout's size.

While it is not completely clear. I believe this means that the distance is scaled such that all information (nodes) is visible.

@AndreasMadsen
AndreasMadsen / README.md
Last active August 29, 2015 14:04
d3 force layout overflow

d3 force layout issue

@AndreasMadsen
AndreasMadsen / README.md
Last active July 23, 2021 14:35
Escape-from-xp

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 / build.log
Last active August 29, 2015 14:03
MKL numpy
--2014-07-06 12:26:29-- https://pypi.python.org/packages/source/n/numpy/numpy-1.8.1.tar.gz
Resolving pypi.python.org... 185.31.17.175
Connecting to pypi.python.org|185.31.17.175|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3794076 (3.6M) [application/octet-stream]
Saving to: 'numpy-1.8.1.tar.gz'
0K .......... .......... .......... .......... .......... 1% 945K 4s
50K .......... .......... .......... .......... .......... 2% 1.10M 4s
100K .......... .......... .......... .......... .......... 4% 3.13M 3s
@AndreasMadsen
AndreasMadsen / readme.md
Last active December 10, 2018 06:02
MKL numpy and scikit on Mac OS X
@AndreasMadsen
AndreasMadsen / README.md
Last active October 12, 2017 18:49
Install python and friends on DTUs shared user system.

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
var dgram = require('dgram');
console.log('step 1');
dummy(function () {
console.log('step 2');
tester(function () {
console.log('step 3');
});
});
//
// Copyright 2010, 2011, Chris Winberry <chris@winberry.net>. All rights reserved.
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in