Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Mohit Rathore markroxor

🎯
Focusing
Block or report user

Report or block markroxor

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@markroxor
markroxor / excitel_usage.py
Created Apr 13, 2019
Calculates net usage by Excitel broadband services.
View excitel_usage.py
from bs4 import BeautifulSoup
with open('Excitel.htm', 'r') as f:
html = f.read()
parsed_html = BeautifulSoup(html, "lxml")
total_usage = 0
for i, a in enumerate(parsed_html.findAll('table')[0].findAll('td')):
if i % 6 == 4:
View every-stackoverflow-question.md

How do I do this thing?

I'm not aware of how to use Google, how do I do this basic thing in Language X?

tagged coding, question

edited by Grammar Nazi (2.5M), asked by 1337z0r (2)

Answer 1 (12)

View get_intersection.py
import sys
import matplotlib.pyplot as plt
import numpy as np
from scipy.spatial import ConvexHull
eps = np.random.rand(1)/100
def on_segment(p, q, r):
return ((q[0] <= max(p[0], r[0])) and (q[0] >= min(p[0], r[0]))
@markroxor
markroxor / becca_gym.py
Created Sep 25, 2018
testing becca gym
View becca_gym.py
import numpy as np
import becca.brain as becca_brain
from becca.base_world import World as BaseWorld
import gym
class World(BaseWorld):
def __init__(self, env_name, seed=None):
BaseWorld.__init__(self)
self.name = 'gym_cartPole'
View promise_broken.js
const axios = require('axios');
// Make a request for a user with a given ID
var server_url = 'http://127.0.0.1:5000'
var url = server_url + '/v1/envs/';
var msg = {'env_id': 'CartPole-v0'};
let axiosConfig = {
headers: {
'Content-Type': 'application/json',
View gymHTTPClient.js
"use strict";
var axios = require("axios");
var Client = (function () {
function Client(remote) {
this.remote = remote;
this.shouldLog = (process.env.SHOULD_LOG === "true");
if (this.shouldLog) {
console.log("Logging enabled");
}
else {
View rl_example.js
"use strict";
var gymHTTPClient_1 = require("/home/markroxor/Documents/RL/gym-http-api/binding-js/dist/lib/gymHTTPClient");
var RandomDiscreteAgent = (function () {
function RandomDiscreteAgent(n) {
this.n = n;
}
RandomDiscreteAgent.prototype.act = function (observation, reward, done) {
return Math.floor(Math.random() * this.n);
};
return RandomDiscreteAgent;
View stn_example.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View apidocs.md
>>> list.__doc__
"list() -> new empty list\nlist(iterable) -> new list initialized from iterable's items"
>>> list().__doc__
"list() -> new empty list\nlist(iterable) -> new list initialized from iterable's items"
>>> help(list)
Help on class list in module builtins:

class list(object)
 |  list() -> new empty list
View test.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.