This file contains hidden or 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
# Toy examples that demonstrate how to configure | |
# nolearn.lasagne.NeuralNet and what data to send in for | |
# classification problems with single and multiple classes, and | |
# regression problems with and without multiple targets. | |
from lasagne.layers import DenseLayer | |
from lasagne.layers import InputLayer | |
from lasagne.nonlinearities import softmax | |
from nolearn.lasagne import NeuralNet | |
import numpy as np |
This file contains hidden or 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
# Markus Gesmann | |
library(arm) # for 'display' function only | |
icecream <- data.frame( | |
# http://www.statcrunch.com/5.0/viewreport.php?reportid=34965&groupid=1848 | |
temp=c(11.9, 14.2, 15.2, 16.4, 17.2, 18.1, | |
18.5, 19.4, 22.1, 22.6, 23.4, 25.1), | |
units=c(185L, 215L, 332L, 325L, 408L, 421L, | |
406L, 412L, 522L, 445L, 544L, 614L) | |
) | |
basicPlot <- function(...){ |
This file contains hidden or 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
# Helper functions that allow string arguments for dplyr's data modification functions like arrange, select etc. | |
# Author: Sebastian Kranz | |
# Examples are below | |
#' Modified version of dplyr's filter that uses string arguments | |
#' @export | |
s_filter = function(.data, ...) { | |
eval.string.dplyr(.data,"filter", ...) | |
} |
This file contains hidden or 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
## INHERIT from a base class | |
# ----------------------------------------- | |
class Product < ActiveRecord::Base | |
belongs_to :category | |
def self.lookup(item_code) | |
where(:item_code => item_code).first | |
end | |
end |
This file contains hidden or 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
# SELENIUM_SERVER is the IP address or hostname of the system running Selenium | |
# Server, this is used to determine where to connect to when using one of the | |
# selenium_remote_* drivers | |
SELENIUM_SERVER = "10.10.11.1" | |
# SELENIUM_APP_HOST is the IP address or hostname of this system (where the | |
# tests run against) as reachable for the SELENIUM_SERVER. This is used to set | |
# the Capybara.app_host when using one of the selenium_remote_* drivers | |
SELENIUM_APP_HOST = "10.10.11.2" |
This file contains hidden or 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/env ruby | |
# lazy hack from Robert Klemme | |
module Memory | |
# sizes are guessed, I was too lazy to look | |
# them up and then they are also platform | |
# dependent | |
REF_SIZE = 4 # ? | |
OBJ_OVERHEAD = 4 # ? |
This file contains hidden or 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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |