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($) { | |
function addUL(parent) { | |
var $ul = $("<ul/>"); | |
var baseId = "_" + $(parent).attr("id"); | |
$(parent).children("option,optgroup").each(function(index, tag) { | |
if (tag.tagName.toLowerCase() === "option") { | |
var $option = $(this); | |
var id = baseId + index; | |
var $li = $("<li/>").appendTo($ul); |
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/python | |
# 7 minutes Ansible module to list groups in inventory (Python version) :D | |
# You can print output like "pretty-print" outside Ansible by using: | |
#./listgroups /path/to/ansible.cfg | python -m json.tool | |
import sys | |
import re | |
import json | |
#get hosts inventory from ansible.cfg file. |
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 math | |
def string_norm(s): | |
return math.sqrt(sum(ord(c) ** 2 for c in s if c != ' ')) | |
def anagram_detection(s1,s2): | |
return string_norm(s1) == string_norm(s2) | |
s1 = input("Please enter first string: ").lower() | |
s2 = input("Please enter second string: ").lower() |