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
| var express = require('express'), | |
| redis = require('redis'), | |
| logger = require('morgan'), | |
| bodyParser = require('body-parser'); | |
| var client = redis.createClient(),//CREATE REDIS CLIENT | |
| app = express(); | |
| app.use(logger("tiny")); | |
| app.use(bodyParser.urlencoded({ extended: false })) |
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 -*- | |
| from __future__ import unicode_literals | |
| import requests | |
| from lxml import etree | |
| import codecs | |
| def get_tracking_numbers(): | |
| with open('input.txt') as f: |
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 to calculate price of a coupon bond | |
| double bondprice(unsigned int n, double couponyield, unsigned int m, double ytm, double f){ | |
| double price = 0; | |
| //discounting all the coupons | |
| for (int i = 1; i <= (n*m); ++i){ | |
| price += (couponyield*f/m)/pow((1+ytm/m), double(i)); | |
| } |