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
| def is_prime(n): | |
| for i in range(2, n/ 2 + 1): | |
| if n % i is 0: | |
| return False | |
| return True | |
| print [i for i in range(2, 100) if is_prime(i)] |
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
| // Fetch a SQL string from a jOOQ Query in order to manually execute it with another tool. | |
| // For simplicity reasons, we're using the API to construct case-insensitive object references, here. | |
| String sql = create.select(field("BOOK.TITLE"), field("AUTHOR.FIRST_NAME"), field("AUTHOR.LAST_NAME")) | |
| .from(table("BOOK")) | |
| .join(table("AUTHOR")) | |
| .on(field("BOOK.AUTHOR_ID").equal(field("AUTHOR.ID"))) | |
| .where(field("BOOK.PUBLISHED_IN").equal(1948)) | |
| .getSQL(); | |
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
| package main | |
| import ( | |
| "fmt" | |
| "io/ioutil" | |
| "net/http" | |
| ) | |
| func main() { | |
| resp, err := http.Get("https://www.ops-class.org/") |
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
| public class Solution { | |
| private int[][] dp; | |
| public boolean isInterleave(String s1, String s2, String s3) { | |
| if (s1.length() + s2.length() != s3.length()) { | |
| return false; | |
| } | |
| if (s3.length() == 0) { | |
| return true; | |
| } | |
| dp = new int[s1.length()][s2.length()]; |
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
| $('#searchText').on('input propertychange paste', function() { | |
| $(this).trigger(jQuery.Event('keyup', {which: 13, keyCode: 13})); | |
| }); |
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
| customjsReady('.icon-hide-conversation', function(element) { | |
| element.click(); | |
| }); |
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
| console.log('Hello'); |
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
| (function(win){ | |
| 'use strict'; | |
| var listeners = [], | |
| doc = win.document, | |
| MutationObserver = win.MutationObserver || win.WebKitMutationObserver, | |
| observer; | |
| function ready(selector, fn){ | |
| // Store the selector and callback to be monitored | |
| listeners.push({ |
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
| task a << { | |
| println 'task a' | |
| } | |
| task b(dependsOn: {a}) << { // works | |
| // task b(dependsOn: 'a') << { // works | |
| // task b(dependsOn: [a]) << { // doesn't work | |
| // task b(dependsOn: a) << { // doesn't work | |
| // task b << { | |
| println 'task b' |