This file contains 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
/* | |
* 1. Declare a madLib variable | |
* 2. Use the adjective1, adjective2, and adjective3 variables to set the madLib variable to the message: | |
* | |
* 'The Intro to JavaScript course is amazing. James and Julia are so fun. I cannot wait to work through the rest of this entertaining content!' | |
*/ | |
var adjective1 = 'amazing'; | |
var adjective2 = 'fun'; | |
var adjective3 = 'entertaining'; |
This file contains 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
server_name = '10.1.2.254' | |
username = 'rocketchat' | |
password = 'uMdB9WAtVauyMFc' | |
database = 'rocketchat' | |
import pymongo | |
import pyodbc | |
import pandas as pd | |
import urllib.parse | |
from sqlalchemy import create_engine |
This file contains 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
--- | |
# This playbook uses the win_ping module to test connectivity to Windows hosts | |
- name: Ping | |
hosts: all | |
tasks: | |
- name: ping | |
win_ping: |
This file contains 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
--- | |
# Ansible playbook to run Windows Update and restart, if required | |
# | |
# http://docs.ansible.com/ansible/win_updates_module.html | |
# https://docs.ansible.com/ansible/win_reboot_module.html | |
- name: Windows Update | |
hosts: all | |
gather_facts: false | |
tasks: |
This file contains 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
s = "abacabaabacaba" | |
sset = sorted(set(s), key=s.index) | |
for i in sset: | |
count = 0 | |
for j in s: | |
if j == i: | |
count += 1 | |
if count == 1: | |
print(i) |
This file contains 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 | |
} |
This file contains 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 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 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 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) |
NewerOlder