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
| % The Question in Question- | |
| % Find a polynomial p(t) such that p(n) and the derivative p'(n) | |
| % are both equal to n for n = 1, 2, 3, 4, and 5. | |
| % 'degree' is the largest n we want this to be true for | |
| % Loses precision around degree = 8 | |
| function ans = FancyFunction(degree) | |
| % Max power we're raising a particular degree to. | |
| % There are degree * 2 equations for any solution. | |
| % As 0 based, - 1 |
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
| import java.util.Map; | |
| import java.util.Arrays; | |
| // Our constraints | |
| int MAX = 100; | |
| int MIN = -10; | |
| int SUM = 60; | |
| // IO | |
| PrintWriter output; |
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
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
| import random | |
| global pointer, A | |
| class State: | |
| # Keep paths with obj scope | |
| def __init__(self): | |
| self.paths = [] | |
| # Path class for tidiness | |
| class Path(): |
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
| #!/bin/bash | |
| # Make sure you source this in rc | |
| # Encapsulate everything since I don't feel like making an extra script | |
| gh(){ | |
| local folder="/home/dylan/projects/github" \ | |
| archive="/home/dylan/projects/archive" \ | |
| regex="[a-zA-Z]+[a-zA-Z0-9_-]*" \ | |
| USERNAME="dmadisetti" \ |
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
| <!-- First form logs us in --> | |
| <form id="login" action="http://192.168.0.1/goform/login" method=POST name="login" target="login_frame"> | |
| <input type="password" name="loginUsername" value="admin"> | |
| <input type="password" name="loginPassword" value="admin"> | |
| <input id='btnLogin' type="submit" value="Login"> | |
| </form> |
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
| app.filter('parseUrl', function() { | |
| var //URLs starting with http://, https://, or ftp:// | |
| replacePattern1 = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim, | |
| //URLs starting with "www." (without // before it, or it'd re-link the ones done above). | |
| replacePattern2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim, | |
| //Change email addresses to mailto:: links. | |
| replacePattern3 = /(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6})/gim; | |
| return function(text, target, otherProp) { | |
| if(!text) return; |
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
| #!/bin/sh | |
| # Short script to auto format on save | |
| MATCHING=false; | |
| press(){ | |
| xte "$1"; | |
| if [ "x" = "$2x" ]; then | |
| sleep 0.05; |
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
| dick="Call me Ishmael. Some years ago--never mind how long precisely--havinglittle or no money in my purse, and nothing particular to interest me onshore, I thought I would sail about a little and see the watery part ofthe world. It is a way I have of driving off the spleen and regulatingthe circulation. Whenever I find myself growing grim about the mouth;whenever it is a damp, drizzly November in my soul; whenever I findmyself involuntarily pausing before coffin warehouses, and bringing upthe rear of every funeral I meet; and especially whenever my hypos getsuch an upper hand of me, that it requires a strong moral principle toprevent me from deliberately stepping into the street, and methodicallyknocking people's hats off--then, I account it high time to get to seaas soon as I can. This is my substitute for pistol and ball. With aphilosophical flourish Cato throws himself upon his sword; I quietlytake to the ship. There is nothing surprising in this. If they but knewit, almost all men in their degree, some t |
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
| % Third stab at matlab | |
| function out = newtonRaphson(funct,old) | |
| delta = 0.001; | |
| y = funct(old); | |
| m = (funct(old+delta)-y)/delta; | |
| new = (m*old-y)/m; | |
| apprx = funct(new); | |