This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Licensed to the Apache Software Foundation (ASF) under one | |
# or more contributor license agreements. See the NOTICE file | |
# distributed with this work for additional information | |
# regarding copyright ownership. The ASF licenses this file | |
# to you under the Apache License, Version 2.0 (the | |
# "License"); you may not use this file except in compliance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# a short implementation of arow in theano | |
def arow(params, loss, lbda1, lbda2): | |
sigma = [theano.shared(value=np.ones(p.value.shape)) for p in params] | |
gl = [T.grad(cost=loss, wrt=p) for p in params] | |
ups = {} | |
for i in xrange(len(params)): | |
ups[params[i]] = params[i] - lbda1*gl[i]/sigma[i] | |
ups[sigma[i]] = sigma[i] + lbda2*gl[i]*gl[i] | |
return ups |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add this file to ~/.sbt/plugins/plugins.sbt. | |
// | |
// Once this is ready, make sure you have sbt 0.12 ("brew install sbt" should do it), | |
// then try running | |
// | |
// sbt "ensime generate" | |
// | |
// in bijection's root directory. ("git clone git@github.com:twitter/bijection.git") | |
resolvers += "Scala-Tools Maven2 Snapshots Repository" at "http://scala-tools.org/repo-snapshots" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(if window-system | |
(tool-bar-mode -1) | |
(menu-bar-mode -1)) | |
(when (eq window-system 'ns) | |
(add-to-list 'default-frame-alist '(height . 80)) | |
(add-to-list 'default-frame-alist '(width . 132))) | |
(require 'package) | |
(setq package-enable-at-startup nil) | |
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo first uninstall evernote using the wine uninstaller | |
wine uninstaller | |
echo now searching forregistry entry to remove | |
cd ~/.wine/drive_c/windows/profiles/$USER/temp | |
upgrade_code="`grep 'with upgrade code' EvernoteSetup.log | tail -n 1 | sed 's/^.*with upgrade code {\([A-Fa-f0-9-]*\).*$/\1/'`" | |
reverse_upgrade_code="`python -c "x='${upgrade_code}' ; y = x[:18].split('-') ; x = x.replace('-', '') ; z = [a+b for a, b in zip(x[16::2], x[17::2])] ; print ''.join(''.join(reversed(part)) for part in y+z).upper()"`" | |
echo please use regedit to navigate to '\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes\' and remove the key "$reverse_upgrade_code" | |
wine regedit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'mine-jabber) | |
;; Username & nickname fields from https://banno.hipchat.com/account/xmpp | |
(setq hipchat-username "") | |
(setq hipchat-nickname "") | |
(setq hipchat-password "") | |
(setq hipchat-autojoin-rooms | |
'("aggregation" "assets" "banno_talk" "banno_cms" "data_services" "emacs" "grip" "kernel" "southen" "troll_talk" "webdev" "design_talk")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Deriving Typeclass Instances using Typed Holes | |
> module Conc where | |
> import Control.Applicative | |
We're presented with the following structure: | |
> data Concurrent a = Concurrent ((a -> Action) -> Action) | |
> data Action = Atom (IO Action) | |
> | Fork Action Action |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
rng = np.random.RandomState(0) | |
print "Trace" | |
A = rng.rand(3, 3) | |
print np.trace(A) | |
print np.einsum("ii", A) | |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer