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 | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return "Welcome to Golab REST API" | |
if __name__ == '__main__': | |
app.run() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 ctypes import * | |
import math | |
import random | |
import numpy as np | |
from numpy.linalg import norm | |
import cv2 | |
def sample(probs): | |
s = sum(probs) |
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 ctypes import * | |
import math | |
import random | |
import numpy as np | |
from numpy.linalg import norm | |
import cv2 | |
def sample(probs): | |
s = sum(probs) |
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 spacy | |
import random | |
TRAIN_DATA = [('what is the price of polo?', {'entities': [(21, 25, 'PrdName')]}), | |
('what is the price of ball?', {'entities': [(21, 25, 'PrdName')]}), | |
('what is the price of jegging?', {'entities': [(21, 28, 'PrdName')]}), | |
('what is the price of t-shirt?', {'entities': [(21, 28, 'PrdName')]}), | |
('what is the price of jeans?', {'entities': [(21, 26, 'PrdName')]}), | |
('what is the price of bat?', {'entities': [(21, 24, 'PrdName')]}), |
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 numpy as np | |
a = np.array([6,0]) | |
b = np.array([0,0]) | |
c = np.array([0,6]) | |
ba = a - b | |
bc = c - b | |
cosine_angle = np.dot(ba, bc) / (np.linalg.norm(ba) * np.linalg.norm(bc)) |
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 getAngle(a, b, c): | |
ang = math.degrees(math.atan2(c[1]-b[1], c[0]-b[0]) - math.atan2(a[1]-b[1], a[0]-b[0])) | |
return ang + 360 if ang < 0 else ang | |
print(getAngle((5, 0), (0, 0), (0, 5))) |
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
<?php | |
$myfile = fopen("newfile.txt", "r") or die("Unable to open file!"); | |
$email = fread($myfile,filesize("newfile.txt")); | |
fclose($myfile); | |
$myObj->name = "Manivannan"; | |
$myObj->username = "Manivannan"; | |
$myObj->email = $email; | |
$myJSON = json_encode($myObj); | |
echo $myJSON; | |
?> |
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
<?php | |
$myObj->access_token = "d50d9fd00acf797ac409d5890fcc76669b727e63"; | |
$myObj->token_type = "Bearer"; | |
$myObj->expiry_in = "1295998"; | |
$myObj->refresh_token="TZzj2yvtWlNP6BvG6UC5UKHXY2Ey6eEo80FSYax6Yv8"; | |
$myJSON = json_encode($myObj); | |
echo $myJSON; | |
?> |
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
<?php | |
$state = $_GET['state']; | |
$state = urlencode($state); | |
$url = "http://localhost:3000/login/generic_oauth?state=".$state."&code=cc536d98d27750394a87ab9d057016e636a8ac31"; | |
$user_email = $_COOKIE["user_email"]; | |
if($user_email != "") | |
{ | |
$myfile = fopen("userinfo/newfile.txt", "w") or die("Unable to open file!"); | |
fwrite($myfile, $user_email); | |
fclose($myfile); |