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 random | |
import matplotlib.pyplot as plt | |
%matplotlib inline | |
# Create some random data | |
r = [random.randrange(10) for n in range(10)] | |
s = [random.randrange(10) for n in range(10)] | |
plt.plot(r, 'm*') | |
plt.plot(s, 'g--') | |
plt.show() |
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
# Create data. | |
colors = ['red', 'orange', 'yellow', 'green', 'blue', 'purple', 'magenta'] | |
votes = [3, 2, 5, 1, 7, 0, 2] | |
index = [i for i in range(1, len(colors)+1)] | |
# Plot data. | |
plt.bar(index, votes) |
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
from flask import Flask | |
from flask_restful import Api, Resource, reqparse | |
app = Flask(__name__) | |
api = Api(app) |
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
users = [ | |
{ | |
"name": "Nicholas", | |
"age" : 42, | |
"occupation": "Network Engineer" | |
}, | |
{ | |
"name": "Elvis", | |
"age" : 32, | |
"occupation": "Doctor" |
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
class User(Resource): | |
def get(self, name): | |
for user in users: | |
if(name == user["name"]): | |
return user, 200 | |
return "User not found", 404 | |
def post(self, name): | |
parser = reqparse.RequestParser() |
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
api.add_resource(User, "/user/<string:name>") #<string:name> indicates that it is a variable part in the route which accepts any name. | |
app.run(debug=True, port=5001) |
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
// | |
// GIFSupport.swift | |
// | |
// Created by Chaudhry Talha on 2/13/19. | |
// Copyright © 2019 ibjects. All rights reserved. | |
// | |
import UIKit | |
import ImageIO |
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
// | |
// QuestionViewController.swift | |
// WorseThanSiri | |
// | |
// Created by Chaudhry Talha on 9/16/19. | |
// Copyright © 2019 ibjects.com. All rights reserved. | |
// | |
import UIKit | |
import Firebase |
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 UIKit | |
struct Chat { | |
var users: [String] | |
var dictionary: [String: Any] { | |
return ["users": users] | |
} | |
} | |
extension Chat { |
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
% is used to add comments in code in prolog language | |
suggest(S) :- write('What is your personality type?: '),read(P),write('How is your mood?: '),read(M), song(S,_,M,P). | |
%Happy_Mood | |
song('https://www.youtube.com/watch?v=c8YIlU_30Kk',jazz,M,P):- M = happy ,(P= (entj) ; P=(enfj) ; P=(enfp)),!. | |
song('https://www.youtube.com/watch?v=SsZRci3sA4I',classical,M,P):- M = happy ,(P= (entj) ; P=(intj) ; P=(entp) ; P=(infj)),!. | |
song('https://www.youtube.com/watch?v=XYk2kt8K6E0',electronica,M,P):- M = happy ,(P= (entj) ; P=(estp) ; P=(enfp)),!. | |
song('https://www.youtube.com/watch?v=VguED7BfpgU',metal,M,P):- M = happy ,(P= (intj) ; P=(istp) ; P=(intp) ; P=(estp)),!. | |
song('https://www.youtube.com/watch?v=5f-wQBh-zbQ',alternative_rock,M,P):- M = happy ,(P= (intj) ; P=(entp) ; P=(infj) ; P=(infp) ; P=(istj) ; P=(isfj) ; P=(istp)),!. | |
song('https://www.youtube.com/watch?v=lPIiB02uqXM',rock,M,P):- M = happy ,(P= (entp) ; P=(intp) ; P=(infp) ; P=(istj) ; P=(isfj)),!. |
OlderNewer