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
| Build Page: https://datascience.stackexchange.com/questions/694/best-python-library-for-neural-networks | |
| 1. Get Question Details | |
| hgetall questions:694 | |
| 2. Get tags for this question | |
| smembers questions:694:tags | |
| 3. Get all comments for this question: | |
| lrange posts:694:comments 0 -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
| --Top 10 users by reputation | |
| select id, DisplayName, Reputation | |
| from Users order by Reputation desc limit 10; | |
| --Top 10 questions asked by user Mitch | |
| select p.Title, p.Score, u.DisplayName | |
| from Posts p inner join Users u on p.OwnerUserId = u.Id | |
| and p.PostTypeId = 1 | |
| where u.DisplayName = 'Mitch' | |
| order by p.Score desc; |
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
| psycopg2-binary==2.7.4 | |
| python-dateutil==2.6.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
| from __future__ import print_function | |
| from redis import StrictRedis, ConnectionError | |
| import pprint | |
| pp = pprint.PrettyPrinter(indent=4) | |
| def get_connection(): | |
| # This is the object we will use to connect to redis server | |
| # You can pass host, port and password to StrictRedis... | |
| # ... but for this assigment, we will stick to defaults |
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
| # -*- coding: utf-8 -*- | |
| """ | |
| Imports h1b data from a CSV file into redis | |
| h1b_kaggle.csv contains ~3 million h1b applications. This script | |
| will create ~4 million keys in redis. | |
| Motivation: | |
| ----------- | |
| This script is a part of redis-rdb-tools, |
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
| # -*- coding: utf-8 -*- | |
| """ | |
| Imports stackexchange xml files into redis | |
| Motivation: | |
| ----------- | |
| This script is a part of redis-rdb-tools, | |
| and helps us generate realistic dump files to help in testing | |
| Schema Documentation: |
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 final Map<String, String> _(String ...args) { | |
| Map<String, String> map = new HashMap<String, String>(); | |
| if ((args.length %2) != 0) { | |
| throw new IllegalArgumentException("Mismatched keys and values"); | |
| } | |
| for(int i=0; i<args.length-1; i+=2) { | |
| map.put(args[i], args[i+1]); | |
| } | |
| return map; | |
| } |
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 TwilioSmsClient: | |
| def __init__(self, account_key, auth_key, sender, twilio_url): | |
| self.account_key = account_key | |
| self.auth_key = auth_key | |
| self.sender = sender | |
| self.uri = twilio_url | |
| def send_sms(self, phone_number, message): | |
| payload = { | |
| 'From': self.sender, |
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 AirtelStatefulSMSGateway: | |
| def __init__(self, authentication_url, message_url, username, password): | |
| self.authentication_url = authentication_url | |
| self.message_url = message_url | |
| self.username = username | |
| self.password = password | |
| self.session_id = None | |
| def send_sms(self, phone_number, message): |
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 AirtelStatelessSMSGateway: | |
| def __init__(self, url, username, password): | |
| self.url = url | |
| self.username = username | |
| self.password = password | |
| def send_sms(self, phone_number, message): | |
| payload = {'mob_no': phone_number, 'text': message, | |
| 'login': self.username, 'pass': self.password} |
NewerOlder