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 smokeping::packages{ | |
package { 'epel-release': ensure => present} | |
package { 'mod_fcgid': ensure => present } | |
package { 'httpd': ensure => present } | |
package { 'httpd-devel': ensure => present } | |
package { 'rrdtool': ensure => present } | |
package { 'perl-CGI-SpeedyCGI': ensure => present } | |
package { 'fping': ensure => present } | |
package { 'rrdtool-perl': ensure => present } | |
package { 'perl': ensure => present } |
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
sudo su - | |
mkdir -p /opt/bin | |
curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/bin/docker-compose | |
chmod +x /opt/bin/docker-compose |
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 largestOfFour(arr) { | |
var largeNumber = arr[0][0] | |
for (var i = 0; i < arr.length; i++) { | |
largeNumber = Math.max(largeNumber, Math.max.apply(null,arr[i])); // You can do this! | |
} | |
return largeNumber; | |
} | |
console.log(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 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
if __name__ == '__main__': | |
students = [] | |
for _ in range(int(input())): | |
name = input() | |
score = float(input()) | |
students.append([name, score]) | |
students.sort(key = lambda x: (x[1], x[0])) | |
for student in students: | |
if (student[1] == students[1][1]): | |
print(student[0]) |
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 __name__ == '__main__': | |
students = [] | |
scores = [] | |
for _ in range(int(input())): | |
name = input() | |
score = float(input()) | |
students.append([name, score]) | |
scores.append(score) | |
scores = list(set(scores)) | |
students.sort(key = lambda x: (x[1], x[0])) |
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 timeit | |
def array123(arr): | |
return ''.join(list(map(str,arr))).find('123') >= 0 | |
def array123_noob(arr): | |
stack = [0,0,0] | |
for num in arr: | |
stack.append(num) | |
stack.pop(0) |
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 timeit | |
def array123(arr): | |
return ''.join(list(map(str,arr))).find('123') >= 0 | |
def array123_noob(arr): | |
stack = [0,0,0] | |
for num in arr: | |
stack.append(num) | |
stack.pop(0) |
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
/* | |
Enter your query here. | |
Please append a semicolon ";" at the end of the query and enter your query in a single line to avoid error. | |
*/ | |
declare @maxprime int | |
declare @i int | |
declare @j int | |
declare @answer varchar | |
declare @isprime bit | |
set @maxprime = 10 |
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/python3 | |
import sys | |
from functools import reduce | |
def solve(a0, a1, a2, b0, b1, b2): | |
# Complete this function | |
a = [a0, a1, a2] | |
b = [b0, b1, b2] | |
alice = sum([1 if i-j > 0 else 0 for i,j in zip(a,b)]) |
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 checkUnread() { | |
var e = document.getElementsByClassName("feedUnreadCount") | |
var t = 0; | |
for( i = 0; i < e.length; i++ ) t += parseInt(e[i].innerHTML.trim() || 0); | |
updateBadge(t); | |
} | |
function updateBadge(e) { | |
e >= 1 ? document.title = "(" + e + ") " + originalTitle : document.title = originalTitle | |
} |