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 <iostream> | |
| #include <vector> | |
| struct Node { | |
| int value; | |
| struct Node *left; | |
| struct Node *right; | |
| }; | |
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 <iostream> | |
| using namespace std; | |
| struct Node { | |
| int data; | |
| struct Node *left; | |
| struct Node *right; | |
| }; |
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 <iostream> | |
| using namespace std; | |
| int maxAND(int[], int); | |
| int main() { | |
| int t; |
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 __init__(self, n): | |
| self.data = [i for i in range(1, n)] | |
| def connected(self, p, q): | |
| return self.data[q] == self.data[p] | |
| def union(self, p, q): | |
| pid = self.data[p] | |
| qid = self.data[q] |
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" | |
| "log" | |
| "strconv" | |
| "github.com/miekg/dns" | |
| ) |
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/bash | |
| if [ "$UID" -ne 0 ]; | |
| then | |
| echo "Run this script as root user only" | |
| exit 100 | |
| fi | |
| while getopts ":p:f:u:" o; do | |
| case "${o}" in |
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/bash | |
| VBoxManage setproperty machinefolder /data/vbox | |
| VM="centos7" | |
| mkdir /data/vbox/$VM | |
| VBoxManage createhd --filename /data/vbox/$VM/$VM.vdi --size 32768 | |
| #RedHat_64 | |
| VBoxManage createvm --name $VM --ostype "RedHat_64" --register |
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/bash | |
| if [ "$UID" -ne 0 ] | |
| then | |
| echo "Must be root to run this script." | |
| exit 100 | |
| fi | |
| cd /etc/yum.repos.d | |
| wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo |
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 Loan < ActiveRecord::Base | |
| has_many :short_messages, dependent: :destroy | |
| belongs_to :shop | |
| belongs_to :player | |
| belongs_to :inventory_racket | |
| validate :check_availabilty, on: :create |
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" | |
| ) | |
| func main() { | |
| var t int | |
| fmt.Scan(&t) | |
| numbers := make([]int, t) |
NewerOlder