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 subprocess | |
| import collections | |
| gpus = subprocess.check_output("nvidia-smi | grep ' C' | awk '{print $2}'", shell=True).split('\n')[:-1] | |
| gpids = subprocess.check_output("nvidia-smi | grep ' C' | awk '{print $3}'", shell=True).split('\n')[:-1] | |
| cnames = subprocess.check_output("docker ps -q | xargs docker inspect --format '{{.State.Pid}} {{.Name}}' | awk '{print $2}'", shell=True).split('\n')[:-1] | |
| cpids = subprocess.check_output("docker ps -q | xargs docker inspect --format '{{.State.Pid}} {{.Name}}' | awk '{print $1}'", shell=True).split('\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
| # Updade and fix brew | |
| echo "[Update] brew" | |
| brew update && brew doctor | |
| # Build-essentials | |
| brew install autoconf | |
| brew install automake | |
| brew install libtool |
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
| if [ "$#" -eq 0 ]; then | |
| myArray=( ) | |
| else | |
| urls=( $1 ) | |
| names=( $2 ) | |
| src=$3 | |
| fi | |
| for ((i=0;i<${#urls[@]};++i)); do |
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 os | |
| import sys | |
| import glob | |
| import requests | |
| def main(): | |
| url_result = sys.argv[1] | |
| url_result_zip = "/".join(url_result.split("/")[0:-1] + ["result_zip"]) | |
| url_compilation_error = "/".join(url_result.split("/")[0:-1] + ["compilation_error"]) |
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
| SRC=$(wildcard *.java) | |
| OBJ=$(patsubst %.java, %, $(SRC)) | |
| CLASS=$(patsubst %.java, %.class, $(SRC)) | |
| CC=javac | |
| IC=java | |
| compile: | |
| @$(CC) $(SRC) > compilation.out | |
| clean: |
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
| class List { | |
| private Node head; | |
| public List() { | |
| this.head = null; | |
| } | |
| public void insert(int value){ | |
| Node n_node = new Node(value); | |
| if (this.head == null) { |
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.Scanner; // Import the Scanner class | |
| public class Main { | |
| public static void main(String[] args){ | |
| int n, buff; | |
| Node tmp; | |
| Scanner scanner = new Scanner(System.in); // Create a Scanner object | |
| Stack myStack = new Stack(); |
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.Scanner; // Import the Scanner class | |
| public class Main { | |
| public static void main(String[] args){ | |
| int n, buff; | |
| Node tmp; | |
| Scanner scanner = new Scanner(System.in); // Create a Scanner object | |
| Queue myQueue = new Queue(); |
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.Scanner; // Import the Scanner class | |
| import java.util.Comparator; | |
| public class HeapExample { | |
| public static class Heap<Key> { | |
| private Key[] data; | |
| private int n; | |
| private int size; | |
| private Comparator cmp; |
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.Scanner; // Import the Scanner class | |
| import java.util.Stack; | |
| public class StackExample { | |
| public static void main(String[] args){ | |
| int n; | |
| String buff; | |
| Scanner scanner = new Scanner(System.in); // Create a Scanner object | |
| Stack<String> stack = new Stack<String>(); |