Skip to content

Instantly share code, notes, and snippets.

View starhopp3r's full-sized avatar

Nikhil Raghavendra starhopp3r

View GitHub Profile
#include <stdio.h>
// Blocks in map
char blk_1 = ' ';
char blk_2 = ' ';
char blk_3 = ' ';
char blk_4 = ' ';
char blk_5 = ' ';
char blk_6 = ' ';
char blk_7 = ' ';
import gym
import rocket_lander_gym
from stable_baselines import PPO2
env = gym.make('RocketLander-v0')
# Monitor the run
env = gym.wrappers.Monitor(env, "./video", force=True)
# Load the saved model
model = PPO2.load("ppo2-falcon.zip", env=None)
# Run the trained agent
// C++ Program to compute the area of a circle
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
// Variables to hold the radius and area
float radius, area;
@starhopp3r
starhopp3r / linkers_101.md
Created November 18, 2018 14:38 — forked from jvns/linkers_101.md
How to understand what's in a binary, with code!

Step 0: A program, and prerequisites

We're going to be dealing with a "Hello, world!" program. Just one. There's going to be a bunch of fruit for discussion here. I'm going to be assuming you're on Linux, because we're gonna be talking about ELF and Macs use Mach-O and I don't know anything about Mach-O.

#include <stdio.h>

char *penguin = "Penguin";
char array[5] = {'a', 'b', 'c', 'd', 'e'};
@starhopp3r
starhopp3r / 00-dragndrop.swift
Created November 10, 2018 08:10 — forked from erica/00-dragndrop.swift
Building an OSX Drag and Drop Playground: Throw the dragndrop.swift into shared Sources and then test out the examples in individual playgrounds. Make sure the assistant is open and set to the timeline. I prefer vertical assistant stacking for this.
import Cocoa
// Support Foundation calls on String
public extension String { public var ns: NSString {return self as NSString} }
/// Custom Labeled Playground-Based Drag-and-Drop window
public class DropView: NSTextField {
// Default action handler
public var handler: ([String]) -> Void = { paths in Swift.print(paths) }
#include <xc.h>
#include "amt.h"
#include <stdio.h>
#pragma config XINST = OFF
#pragma config FOSC = HS
#pragma config WDT = OFF
void interrupt HighIsr(void) // High priority interrupt
{
//
// esp8266-mqtt-client.ino
// Beverly
//
// Created by Nikhil Raghavendra on 25/6/18.
// Copyright © 2018 Nikhil Raghavendra. All rights reserved.
//
#include <Arduino.h>
#include <Stream.h>
#!/bin/bash
#PBS -q normal
#PBS -l select=1:ncpus=1:mem=100M
#PBS -l walltime=00:10:00
#PBS -P 21170158
cd ${PBS_O_WORKDIR}
module load composerxe/2018.0.128
./helloworld
import pandas as pd
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
# Read cols
cols = cols = [1, 2, 3, 4, 7, 10]
# Training data
training_file = "training_data.csv"
# Numbers between 1534 and 2435 that are divisible by 7
[print(i) for i in range(1534, 2436) if i % 7 == 0]
# Numbers between 1534 and 2435 that are divisible by 7 OR 8
[print(i) for i in range(1534, 2436) if i % 7 == 0 or i % 8 == 0]
# Numbers between 1534 and 2435 that are divisible by 7 AND 8
[print(i) for i in range(1534, 2436) if i % 7 == 0 and i % 8 == 0]
# Last question with user input