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 conv(x): | |
| i = ord(x) | |
| if i < 121: | |
| return chr(i + 2) | |
| elif i == 121: | |
| return chr(ord('a')) | |
| elif i == 122: | |
| return chr(ord('b')) | |
| alfabeto = list(x for x in 'abcdefghijklmnopqrstuvwxyz') |
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
| file_characters = open("pc_02.txt", "rt") | |
| characters = file_characters.read() | |
| file_characters.close() | |
| occurrences = {} | |
| for l in characters: | |
| occurrences[l] = str.count(characters, l) | |
| for k, v in occurrences.items(): | |
| if v == 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
| import re | |
| import itertools | |
| especial_letters = set() | |
| in_file = open('pc_03.txt', "rt") | |
| while True: | |
| line = in_file.readline() | |
| if not line: | |
| break |
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 urllib2, re, sys | |
| uri = 'http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=' | |
| nothing = '12345' | |
| def get_next(nothing): | |
| request = request = urllib2.Request(uri + nothing) | |
| result = str(urllib2.urlopen(request).read()) | |
| if 'html' in result: | |
| print("secret word :D -----> " + result) |
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 re | |
| class InputScanner(object): | |
| def __init__(self, filename, parse_function): | |
| with open(filename) as f: | |
| self.reversed_lines = list(reversed(f.read().split('\n'))) | |
| self.case_count = 0 | |
| self.total_cases = self.next_int() | |
| self.parse_function = parse_function |
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
| public WebDriver chrome() { | |
| try { | |
| //MAC - Deve instalar o servidor web driver antes http://code.google.com/p/chromedriver/downloads/list | |
| //System.setProperty("webdriver.chrome.driver", "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"); | |
| //LINUX - Deve instalar o servidor web driver antes http://code.google.com/p/chromedriver/downloads/list | |
| System.setProperty("webdriver.chrome.driver", "/usr/bin/google-chrome"); | |
| final DesiredCapabilities desiredCapabilities = DesiredCapabilities.chrome(); |
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
| João - | |
| 1) ssh para maquina aonde ocorrerá o pareamento | |
| $ ssh user@<ip> | |
| 2) nome para a sessão: | |
| $ screen -S <nome_da_sessao> | |
| 3) ativar multiuser: | |
| $ Ctrl-a :multiuser on |
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 criarCampoEvaluated() { | |
| var cursor = db.website_performance.find({evaluated: {$exists: false}}); | |
| while (cursor.hasNext()) { | |
| var doc = cursor.next(); | |
| if (doc) { | |
| db.website_performance.update(doc, {$set: {evaluated: false}}); | |
| printjson( doc ); | |
| } | |
| } | |
| } |
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
| public static void main(String[] args) { | |
| try { | |
| CsvReader products = new CsvReader("products.csv"); | |
| products.readHeaders(); | |
| while (products.readRecord()) | |
| { | |
| String productID = products.get("ProductID"); |
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 resumeDomainsFromCampaign(campaign) { | |
| var cursorAds = db.rtb_bid_reference.find({campaign_id: campaign}, {id: 1}); | |
| var rtbBidRefDomainColl = db.rtb_bid_reference_domain; | |
| while (cursorAds.hasNext()) { | |
| var adId = cursorAds.next(); | |
| if (adId != null) { |
OlderNewer