Skip to content

Instantly share code, notes, and snippets.

View jarhoads's full-sized avatar

Josh jarhoads

  • Pittsburgh
View GitHub Profile
open System
// I'm creating two functions: cylinderVolumeEdx and cylinderVolumePrecise
// this is because the definition of the formula in the Edx assignment is
// both incorrect (should be PI*r^2*h) and uses a rounded version of PI(3.14)
// this version will give you the correct answer for the assignment
let cylinderVolumeEdx (r:float) (h:float) = 2.0 * 3.14 * r * r * h
let cylinderVolumePrecise (r:float) (h:float) = Math.PI * Math.Pow(r,2.0) * h
@jarhoads
jarhoads / .gitignore
Created October 9, 2015 14:31
Visual Studio Git Ignore File
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
/*
I did this while I was drinking wine after my kids went to bed.
My wine brain added an extra challenge to most of the problems that should have been easier.
This is why the code probably doesn't look as clean as it should.
I'm sure there are probably some edge cases somewhere that I'm not seeing and I didn't write any unit tests for any of it.
I could probably update the splitQuakes() method to return a new ArrayList<List<Marker>> instead of mutating the private one.
Also, that method looks goofy anway and there is probably a better way to do it.
My wine brain says it looks legit though so I'm just going with it. Thanks wine brain!
I thought this extension would be easier than it turned out to be.
@jarhoads
jarhoads / GetTimeline.java
Last active February 9, 2016 21:49
A simple example using the twitter API and a simple Markov generator to create a simple Trump bot
package twittergen;
import twitter4j.Status;
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
/* REXX */
/* REXX PROGRAM FOR PROCESSING SDSF WITH REXX */
/* CHANGE THE DDNAME TO BE THE OUTPUT FILE YOU WANT */
/* CHANGE ISFPREFIX TO BE THE PREFIX FOR YOUR JOBS */
/* I USUALLY USE THIS TO FIND ALL OF MY TEST FILES */
/* AFTER RUNNING THE SUPERCE UTILITY IN BATCH MODE */
/* JOSH RHOADS - MARCH 2015 */
DDNAME = "'HLQUAL.DD.MIDQUAL.TSTFILES'"
@jarhoads
jarhoads / isogram.js
Last active June 5, 2018 01:26
Some ideas on checking for an isogram in javascript
var Isogram = function(w){
var word = w.toLowerCase().split('');
this.isIsogram = function(){
var letters = new Object(null);
for(var i = 0; i < word.length; i++){
@jarhoads
jarhoads / RXSTART.rex
Last active September 19, 2016 19:42
RXSTART - REXX exec used to set screens at the beginning of a session
/* REXX */
/* REXX RXSTART */
/*-----------------------------------------------------------------------*/
/* RXSTART - CREATE MANY SPLIT SCREENS */
/* USAGE: ADD THE FOLLOWING TO YOUR ISPF ZSTART VARIABLE (OPTION 7.3) */
/* ISPF;6;EX 'HLQUAL.REXX.EXEC(RXSTART)' */
/* REPLACE HLQUAL.REXX.EXEC WITH THE PDS OF YOUR REXX FILES */
/*-----------------------------------------------------------------------*/
ADDRESS ISPEXEC
unique:
parse arg s
l = length(s)
do i=1 to l
c = substr(s,i,1)
rest = substr(s,(i+1))
if verify(c,rest) = 0 then return 0
end
t1 = unique("abc")
call test t1 "abc"
t2 = unique("abbc")
call test t2 "abbc"
exit 0
test:
parse arg test_val test_string
@jarhoads
jarhoads / FMFLTPR0.jcl
Created November 16, 2016 14:17
JCL PROC that allows for a REXX EXEC to be passed as a symbolic to FILEMGR Utility
//*************************************************************
//* FILE MANAGER FILTER PROC
//* EXECUTES FILEMGR UTILITY USING A USER DEFINED REXX EXEC
//*
//* SYMBOLICS:
//* &DSN1 - LAST QUALIFIER FOR THE INPUT DATASET
//* &DSN2 - LAST QUALIFIER FOR THE OUTPUT DATASET
//* &FMPROCS - USER LIBRARY WITH REXX EXEC ELEMENTS
//* MUST END IN .EXEC UNLESS OVERRIDDEN IN JCL
//* &FMEXEC - REXX EXEC WITH USER CODE FOR FILEMGR UTILITY