Snippets created by david klein

  • Alternative Conditional Printfn

    A different approach to conditional debug functions

    1 people like this

    Posted: 12 years ago by David Klein

  • WMI F#

    Determining If You Are Running the Checked Build p.48 Windows Internals 5th Edition.

    1 people like this

    Posted: 12 years ago by David Klein

  • Frequency Tables, Shift Cipher

    Solving Ceasar shfit with frequency tables.

    3 people like this

    Posted: 12 years ago by David Klein

  • F# yet another Interop example

    Quick demo of using F# to interop with a native C library. C Library has not been checked for algorithm correctness (but works exactly as the origional).

    13 people like this

    Posted: 11 years ago by David Klein

  • playing with dns + async composition

    just some snippets ive been using to play around with async + DNS, nothing production, updated: ipsOfDomain and domainOfIp now both return string array

    2 people like this

    Posted: 11 years ago by david klein

  • Rudimentary IL dissembler for use within FSI.

    got distracted and decided I wanted to be able to 'disassemble' a function inside of FSI, much like you can do in many Lisps, this isnt very complete and I think it will only work on the most basic functions, but it was very challenging to get working so I thought I would paste it.

    4 people like this

    Posted: 11 years ago by David Klein

  • streams, memoization, suspension

    translation of http://www.cs.cmu.edu/~rwh/introsml/techniques/memoization.htm , no particular reason, just satisfying a tangent, read the cmu site for comments & insights.

    2 people like this

    Posted: 11 years ago by David Klein

  • tcpStream abstraction

    Basic (but experimental) TCP stream wrappers to help make TCP more abstracted and cleaner. Giving the user just the impression of a 'stream' that one connects to and sends and receives. This helps promote composition. The first abstraction is 'stream', really just wrapping .NET stream functions so that read returns the read n bytes and write returns the stream, all functions take NetworkStream as the first parameters, followed by other parameters. Currently we don't care about timeouts, exceptions, or other nasty's.

    5 people like this

    Posted: 11 years ago by David Klein

  • local wireless passwords

    dump out saved windows wireless passwords in plaintext. they're stored in xml file, to successfully dump them you must be logged in as the same user who created them (at least in the below code ;)

    3 people like this

    Posted: 10 years ago by David Klein

  • log parsing.

    basically an extension of http://msdn.microsoft.com/en-us/magazine/gg983490.aspx I can't remember why I wrote it now, it should be more generic than MSDN's version.

    2 people like this

    Posted: 10 years ago by David Klein

  • ipv4 conversion snippet

    ipv4 conversion snippet, updated based on current version, changed a lot to make it a bit more .NETish

    6 people like this

    Posted: 12 years ago by david klein

  • md5 cracking

    Simple md5 cracker, example of using permutations and pseq rather than cracking.

    2 people like this

    Posted: 12 years ago by david klein

  • reflection

    reflection, not exactly efficient but good canvas to start exploring

    5 people like this

    Posted: 12 years ago by David Klein

  • crc32

    have a project to write some basics from gzip, needed crc32, seems fast enough, fixed one bug!

    4 people like this

    Posted: 11 years ago by David Klein

  • Affine Cipher

    simple affineCipher translated from https://github.com/asweigart/codebreaker/blob/master/affineCipher.py not sure if actually correct. I updated the below to make it easier to understand because I was bored, made some more changes, now pass in lambda as function to pxn instead of individual functions, as suggested by rwbarton for my haskell version.

    4 people like this

    Posted: 11 years ago by david klein

  • Csv + Registry

    Had a C tool to parse a csv of queries and check registry against query, then spit out the result, was horrible to parse and model the data in C (just too much code) so I have converted it to F#.

    2 people like this

    Posted: 11 years ago by David Klein

  • String Manipulation

    hackthissite.org programming level 12, string manipulation.

    6 people like this

    Posted: 11 years ago by David Klein

  • C Struct to F#

    Quick function to take a wireshark 'C Structure' and turn it into a F# byte array

    3 people like this

    Posted: 11 years ago by David Klein

  • Unmanaged memory search

    Useful for pinvoke stuff where your native API requires that you have a unmanaged buffer containing the data you want to work on. Edit: Changed native calls, removed Marshal.Copy (there is a async corner case but I won't delve into it here) and replaced with pinning.

    5 people like this

    Posted: 10 years ago by David Klein

  • Porter Stemmer

    Porter Stemmer, please contribute fixes, suggestions, this is merely a syntactic rewrite, I believe though there are some slight mistakes. http://tartarus.org/~martin/PorterStemmer/ ,fixed up endswithdoubleconsonant and endswithocondition

    1 people like this

    Posted: 5 years ago by David Klein