{{ message }}

Instantly share code, notes, and snippets.

💪
Trying to find time to contribute more.

# OJ Reeves OJ

💪
Trying to find time to contribute more.
Created Sep 11, 2019
keybase.md
View keybase.md

### Keybase proof

I hereby claim:

• I am oj on github.
• I am oj (https://keybase.io/oj) on keybase.
• I have a public key ASDEtNxWXtN0-EAM9rF-6tP-qjzzVpaJbq6rVyq8Eo0tIAo

To claim this, I am signing this object:

Created Mar 22, 2017
Dark windbg workspace
View windbg_dark.wew.b64
This file contains 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
Created Oct 26, 2011
Solution to the Ruler Problem in Haskll
View Ruler.hs
This file contains 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
 ruler :: Int -> Int -> String ruler h s = ruler' (2 ^ h * s + 1) h 1 [] [] where outChar c r = if (c `mod` (2 ^ r)) == 1 then '|' else ' ' ruler' _ 0 _ _ a = unlines \$ reverse a ruler' w r c l a = let nl = (outChar c r) : l in if c == w then ruler' w (r - 1) 1 [] (nl : a) else ruler' w r (c + 1) nl a -- to diplay results:
Created Jan 10, 2010
View gist:273516
This file contains 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
 let rec nums = seq { yield 1 for n in nums do yield n+1 } How does this work? First thing to remember is that seq is a lazy sequence. It's an IEnumerable under the hood I believe. It'll only evaluate those values which you actually attempt to access. When you take the first element of the sequence, it'll return 1 (I'll assume you know the yield keyword already). The next time you hit the sequence it knows, thanks to yield, that it bypasses the first yield statement and makes it ways to the for loop. That loop iterates over the already-evaluated values in the sequence, which in our case is just 1. So the second item in the sequence is a yield of 1 + 1, whichi s 2. So yes, the two elements of the evaluated sequence are now 1 and 2. When you next access the sequence to get the next value, you are returned to the point where the yield statement was last called and hence we're back in the for loop. The loop has already taken the value of 1 from the previous iteration, but now the sequence
Created Jan 3, 2010
View words.erl
This file contains 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
 %% My second code kata. %% This is the first part of the question listed at this URL: %% http://codekata.pragprog.com/2007/01/kata_eight_conf.html %% more to come later. -module(words). -author('OJ Reeves '). -export([composition/1]). -define(WORDLENGTH, 6). composition(FileName) ->
Created Dec 31, 2009
View anagrams.erl
This file contains 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
 %% @author OJ Reeves %% %% My first crappy attempt at Dave Thomas' 6th Code Kata %% (located at http://codekata.pragprog.com/2007/01/kata_six_anagra.html) %% %% Extra bits are now done. %% %% Refactored some small bits, and made changes based on suggestions from %% the guys on Google Wave.
Created Apr 20, 2009
Another pile of shit that I stumbled across!
View MoreAbsoluteFuckingGenius.cs
This file contains 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
 XmlDocument doc = rs.BuildXmlDoc(); System.IO.MemoryStream aMemoryStream = new System.IO.MemoryStream(); XmlTextWriter aXmlTextWriter = new XmlTextWriter(aMemoryStream, System.Text.Encoding.UTF8); //save the xml representation in a memory stream doc.Save(aXmlTextWriter); //pass the xml as a parameter param[2] = System.Text.Encoding.UTF8.GetString(aMemoryStream.ToArray());
Created Apr 15, 2009
A large pile of shit that I recently discovered in an open source code base from CodePlex.
View AwfulPileOfShit.cs
This file contains 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
 public void SendMessage() { lock(this) { //do some sanity checking if(host == null || host.Trim().Length == 0) { throw new Exception("No host specified."); } if(from == null || from.Trim().Length == 0)
Last active Aug 29, 2015
View keybase.md

### Keybase proof

I hereby claim:

• I am oj on github.
• I am oj (https://keybase.io/oj) on keybase.
• I have a public key whose fingerprint is D64B 75C1 3A08 FB66 D196 4A56 D5DC 61FB 9326 0597

To claim this, I am signing this object: