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 nice_index(tens: Tensor, index: Tensor) -> Tensor: | |
""" | |
A multi-level indexing function. | |
The last dimension of the index is a multi-level specifier | |
All other dimensions of the index are batch | |
For example, if the index is [[[1, 2], [3, 4]], [[5, 6], [7, 8]]] | |
the result will be [[tens[1, 2], tens[3, 4]], [tens[5, 6], tens[7, 8]]] | |
See tests for more details | |
""" |
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
chrome.tabs.onUpdated.addListener( function (tabId, changeInfo, tab) { | |
console.log("Tab changed"); | |
if(changeInfo.status == 'complete'){ | |
console.log("Tab changed 2"); | |
chrome.tabs.getSelected(null,function(tab){ | |
if(tab){ | |
console.log("Tab defined"); | |
var current = tab.url; | |
console.log(current); | |
var regex = /(https?:\/\/docs\.oracle\.com\/javase\/)(.*)(\/docs\/api.*)/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
#include "cuda_runtime.h" | |
#include "device_launch_parameters.h" | |
#include <stdio.h> | |
#include <stdlib.h> | |
//MAKE SURE TO SET TERMINAL FONT SIZE AS SMALL AS POSSIBLE | |
#define WIDTH 940 //In chars, adjust to screen |
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
var LegoURL = "https://ideas.lego.com/comments/project/32812051-934d-4d73-9961-b7a6cc652007/comments?order=newest&from=max" | |
function onOpen() { | |
var ui = SpreadsheetApp.getUi(); | |
ui.createMenu('Refresh Lego Comments') | |
.addItem('Refresh', 'RefreshLegoCount') | |
.addToUi(); | |
} | |
function RefreshLegoCount() { |
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
import java.util.*; | |
public class ExampleUsage { | |
static final int LIST_SIZE = 1000000; //size of list | |
//Requires about 250-300MB of RAM per million list entries | |
//Has only been tested with random lists, may require more with sorted lists | |
public static void main(String[] args) { |
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
import java.util.*; | |
import java.util.concurrent.*; | |
import java.util.logging.Level; | |
import java.util.logging.Logger; | |
public class RecursiveQuicksort { | |
static int listLength = 1000000; | |
public static void main(String[] args) { |
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
//Simple substr implementation | |
//Paramaters | |
//String:the string you want to operate on | |
//Start:starting position, indexed from 0 | |
//End:ending position, indexed from 0 | |
//Curpos:used internally by the recursion loop- leave blank | |
//Examples | |
//echo(substr("Hello world",0,4)); Returns "Hello" |