sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminatorTerminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").
| impl Solution { | |
| pub fn longest_common_prefix(strs: Vec<String>) -> String { | |
| if strs.len() == 0 { | |
| return "".to_string(); | |
| } | |
| let mut prefix = strs[0].clone(); | |
| for n in 1..strs.len() { | |
| while(!strs[n].contains(&prefix)){ | |
| prefix = prefix[..prefix.len()-1].to_string(); | |
| } |
| use std::collections::HashMap; | |
| impl Solution { | |
| pub fn two_sum(nums: Vec<i32>, target: i32) -> Vec<i32> { | |
| let mut index_hashmap = HashMap::with_capacity(nums.len()); | |
| for (idx, &n) in nums.iter().enumerate() { | |
| let y = target - n; | |
| if let Some(&i) = index_hashmap.get(&y) { | |
| return vec![i as i32, idx as i32]; |
| import getpass | |
| import sys | |
| import re | |
| from netmiko import ConnectHandler | |
| pattern = re.compile(r'Huawei\s\w+\s\w+\suptime') | |
| COMMAND = sys.argv[1] | |
| USER = input('Username: ') | |
| PASSWORD = getpass.getpass() |
| use std::io; | |
| fn main() { | |
| let mut input = String::new(); | |
| loop { | |
| io::stdin().read_line(&mut input) | |
| .expect("Failed to read line"); | |
| input = input.trim().to_string(); | |
| piglatinize(&mut input); | |
| println!("{}", input); |
| #![allow(unused)] | |
| use std::collections::HashMap; | |
| fn main() { | |
| let mut vec = vec![3, 5, 6, 3, 4, 7, 4]; | |
| println!("Averege ={}", averege(&vec)); | |
| assert_eq!(median(&mut vec), 4.0); | |
| println!("Median ={}", median(&mut vec)); | |
| println!("Mode ={}", mode(&vec)); | |
| } | |
| fn averege(v: &[i32]) -> f32 { |
| with open('SK-KN-USKARS-SW-CE-1.txt', 'r') as myfile: | |
| data = myfile.read() | |
| # Hostname | |
| result = re.search(r'hostname (SK-\S+)\n', data) | |
| print(result.group(1)) | |
| #Loopback interface | |
| result = re.search(r'interface Loopback\d+\n.*ip address (\d+.\d+.\d+.\d+)', data) | |
| print(result) | |
| #SNMP RW and RO Access list | |
| result = re.search(r'snmp-server community (.+) RO (.+)', data) |
| #include <fcntl.h> | |
| #include <sys/mman.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <errno.h> | |
| #include <stdarg.h> | |
| #define MAXLINE 4096 /* max line length */ |
| function getUrlVars() { | |
| var vars = {}; | |
| var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { | |
| vars[key] = value; | |
| }); | |
| return vars; | |
| } | |
| $(document).ready(function() { | |
| $.ajax({ |
| #include <stdio.h> | |
| #include <inttypes.h> | |
| #include <x86intrin.h> | |
| int bcd2int(int bcd) | |
| { | |
| static __v2di output = {0,0}; | |
| output[0]=bcd; | |
| asm volatile( | |
| “\tmovq\t%0, %%xmm0;\n” // use 128 bit SSE xmm registers |