Seen season 1
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
| { | |
| "metadata": { | |
| "name": "", | |
| "signature": "sha256:9d0a83225f170377ef40bebd15348e81d24b51425191fbadd75c0ba6afaee38a" | |
| }, | |
| "nbformat": 3, | |
| "nbformat_minor": 0, | |
| "worksheets": [ | |
| { | |
| "cells": [ |
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
| use "hw1.sml"; | |
| print("-------------------------\n"); | |
| print("-- Starting tests...\n"); | |
| print("primepower;\n"); | |
| primepower; | |
| print("primepower(0);\n"); | |
| primepower(0); |
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
| fun decbin(0, l) = l | |
| | decbin(n, l) = | |
| let | |
| val quotient = floor(real(n) / 2.0); | |
| val remainder = n mod 2; | |
| in | |
| decbin(quotient, remainder::l) | |
| 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
| lastDigit :: Integer -> Integer | |
| lastDigit n = if n >= 10 then n `mod` 10 | |
| else n; | |
| dropLastDigit :: Integer -> Integer | |
| dropLastDigit n = n `div` 10 | |
| toDigits :: Integer -> [Integer] | |
| toDigits 0 = [] | |
| toDigits n = if n < 0 then [] |
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
| fun rev(nil, M) = M | |
| | rev(x::xs, ys) = rev(xs, x::ys); |
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
| add_filter( ' | |
| ;; with cursor directly after single quote: | |
| (looking-back "add_\\(action\\|filter\\)([[:space:]]?+\\('\\|\"\\)") => t | |
| (match-string 0 "add_\\(action\\|filter\\)([[:space:]]?+\\('\\|\"\\)") => "add_\\(ac" ;; expects whole string | |
| (match-string 1 "add_\\(action\\|filter\\)([[:space:]]?+\\('\\|\"\\)") => nil ;; expects action or 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
| from scrapy.selector import HtmlXPathSelector | |
| from scrapy.contrib.spiders import CrawlSpider, Rule | |
| from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor | |
| from scrapy.item import Item, Field | |
| class LinkItem(Item): | |
| url = Field() | |
| referer = Field() | |
| status = Field() |
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
| fun factorial(n) = if n = 0 | |
| then 1 | |
| else n * factorial(n-1) |
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
| --- | |
| - hosts: amd64_personal | |
| remote_user: dan | |
| vars: | |
| - root_password: "foo" | |
| tasks: | |
| - name: change root password | |
| sudo: yes | |
| user: | |
| name=root |