Skip to content

Instantly share code, notes, and snippets.

@Quantumplation
Created December 12, 2012 19:12

Revisions

  1. Quantumplation revised this gist Dec 12, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion blog1.md
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,7 @@ Advantages
    ------------
    * One of the major barriers to entry for writing a blog for me was finding/writing the software, configuring wordpress, or something of the sort, and then finding a cheap/free host for it and maintaining it. Gist hosts my content for me.
    * Gist supports markdown! This means I can have some pretty formatting instead of just text files.
    * I can embedd images and code as well!
    * I can embedd images and code as well! (No LaTeX support unfortunately)
    * ![](https://a248.e.akamai.net/camo.github.com/06a279212063fc9d9f9ffddb936e103adbe623e1/687474703a2f2f692e696d6775722e636f6d2f4f49416a692e706e67)

    ```C#
  2. Quantumplation revised this gist Dec 12, 2012. 1 changed file with 0 additions and 12 deletions.
    12 changes: 0 additions & 12 deletions Test.tex
    Original file line number Diff line number Diff line change
    @@ -1,12 +0,0 @@
    This is a test of LaTeX

    \begin{description}
    \item [{\emph{Pf.}}] One possible construction for a TM which accepts the
    concatenation of two polynomial-time languages is to run the machine
    accepting the first language in polynomial time, $T_{1}$, on increasingly
    long prefixes of the input until it accepts, then run the machine
    accepting the second language in polynomial time, $T_{2}$, on the
    remaining input until it accepts. The time would be $O(nt_{1}(n)t_{2}(n))$
    if $t_{1}(n)$ and $t_{2}(n)$ were polynomial running times of $T_{1}$
    and $T_{2}$ respectively, which is in the time-complexity class $P$.
    \end{description}
  3. Quantumplation revised this gist Dec 12, 2012. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions Test.tex
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    This is a test of LaTeX

    \begin{description}
    \item [{\emph{Pf.}}] One possible construction for a TM which accepts the
    concatenation of two polynomial-time languages is to run the machine
    accepting the first language in polynomial time, $T_{1}$, on increasingly
    long prefixes of the input until it accepts, then run the machine
    accepting the second language in polynomial time, $T_{2}$, on the
    remaining input until it accepts. The time would be $O(nt_{1}(n)t_{2}(n))$
    if $t_{1}(n)$ and $t_{2}(n)$ were polynomial running times of $T_{1}$
    and $T_{2}$ respectively, which is in the time-complexity class $P$.
    \end{description}
  4. Quantumplation revised this gist Dec 12, 2012. 1 changed file with 17 additions and 0 deletions.
    17 changes: 17 additions & 0 deletions Sample.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    // I can also attach sample code files

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    namespace MassiveGalaxyBattles
    {
    public static class Extensions
    {
    public static IEnumerable<T> NextPermuatation<T>(this List<T> source, Func<T, T, Boolean> comparison)
    {
    }
    }
    }
  5. Quantumplation revised this gist Dec 12, 2012. 1 changed file with 22 additions and 4 deletions.
    26 changes: 22 additions & 4 deletions blog1.md
    Original file line number Diff line number Diff line change
    @@ -19,10 +19,28 @@ Advantages
    * I can embedd images and code as well!
    * ![](https://a248.e.akamai.net/camo.github.com/06a279212063fc9d9f9ffddb936e103adbe623e1/687474703a2f2f692e696d6775722e636f6d2f4f49416a692e706e67)

    ```ruby
    require 'redcarpet'
    markdown = Redcarpet.new("Hello World!")
    puts markdown.to_html
    ```C#
    public static IEnumerable<T> NextPermuatation<T>(this List<T> source, Func<T, T, Boolean> comparison)
    {
    int i = source.Count - 2;
    for (; i >= 0 && comparison(source[i+1], source[i]); i--) ;
    if (i == -1)
    {
    for (int x = source.Count - 1; x >= 0; x--)
    yield return source[x];
    yield break;
    }
    int j = source.Count - 1;
    for(; j > 0 && comparison(source[j], source[i]); j--);
    for(int x = 0; x < Math.Min(i, j); x++)
    yield return source[x];
    yield return source[Math.Max(i, j)];
    for (int x = source.Count - 1; x > Math.Max(i, j); x--)
    yield return source[x];
    yield return source[Math.Min(i, j)];
    for (int x = Math.Max(i, j) - 1; x > Math.Min(i, j); x--)
    yield return source[x];
    }
    ```

    * They're more or less permanently hosted. No need to worry about backups or harddrive failures.
  6. Quantumplation revised this gist Dec 12, 2012. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions blog1.md
    Original file line number Diff line number Diff line change
    @@ -18,11 +18,13 @@ Advantages
    * Gist supports markdown! This means I can have some pretty formatting instead of just text files.
    * I can embedd images and code as well!
    * ![](https://a248.e.akamai.net/camo.github.com/06a279212063fc9d9f9ffddb936e103adbe623e1/687474703a2f2f692e696d6775722e636f6d2f4f49416a692e706e67)

    ```ruby
    require 'redcarpet'
    markdown = Redcarpet.new("Hello World!")
    puts markdown.to_html
    ```

    * They're more or less permanently hosted. No need to worry about backups or harddrive failures.
    * They're written through the wonderful Ace editor.
    * They're all assosciated with my account for easy searching if I want to look up how I solved a problem before.
  7. Quantumplation revised this gist Dec 12, 2012. 1 changed file with 4 additions and 22 deletions.
    26 changes: 4 additions & 22 deletions blog1.md
    Original file line number Diff line number Diff line change
    @@ -18,28 +18,10 @@ Advantages
    * Gist supports markdown! This means I can have some pretty formatting instead of just text files.
    * I can embedd images and code as well!
    * ![](https://a248.e.akamai.net/camo.github.com/06a279212063fc9d9f9ffddb936e103adbe623e1/687474703a2f2f692e696d6775722e636f6d2f4f49416a692e706e67)
    ```
    public static IEnumerable<T> NextPermuatation<T>(this List<T> source, Func<T, T, Boolean> comparison)
    {
    int i = source.Count - 2;
    for (; i >= 0 && comparison(source[i+1], source[i]); i--) ;
    if (i == -1)
    {
    for (int x = source.Count - 1; x >= 0; x--)
    yield return source[x];
    yield break;
    }
    int j = source.Count - 1;
    for(; j > 0 && comparison(source[j], source[i]); j--);
    for(int x = 0; x < Math.Min(i, j); x++)
    yield return source[x];
    yield return source[Math.Max(i, j)];
    for (int x = source.Count - 1; x > Math.Max(i, j); x--)
    yield return source[x];
    yield return source[Math.Min(i, j)];
    for (int x = Math.Max(i, j) - 1; x > Math.Min(i, j); x--)
    yield return source[x];
    }
    ```ruby
    require 'redcarpet'
    markdown = Redcarpet.new("Hello World!")
    puts markdown.to_html
    ```
    * They're more or less permanently hosted. No need to worry about backups or harddrive failures.
    * They're written through the wonderful Ace editor.
  8. Quantumplation revised this gist Dec 12, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion blog1.md
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,7 @@ Advantages
    * Gist supports markdown! This means I can have some pretty formatting instead of just text files.
    * I can embedd images and code as well!
    * ![](https://a248.e.akamai.net/camo.github.com/06a279212063fc9d9f9ffddb936e103adbe623e1/687474703a2f2f692e696d6775722e636f6d2f4f49416a692e706e67)
    ```C#
    ```
    public static IEnumerable<T> NextPermuatation<T>(this List<T> source, Func<T, T, Boolean> comparison)
    {
    int i = source.Count - 2;
  9. Quantumplation revised this gist Dec 12, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion blog1.md
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,7 @@ Advantages
    * Gist supports markdown! This means I can have some pretty formatting instead of just text files.
    * I can embedd images and code as well!
    * ![](https://a248.e.akamai.net/camo.github.com/06a279212063fc9d9f9ffddb936e103adbe623e1/687474703a2f2f692e696d6775722e636f6d2f4f49416a692e706e67)
    * ```C#
    ```C#
    public static IEnumerable<T> NextPermuatation<T>(this List<T> source, Func<T, T, Boolean> comparison)
    {
    int i = source.Count - 2;
  10. Quantumplation revised this gist Dec 12, 2012. 1 changed file with 24 additions and 1 deletion.
    25 changes: 24 additions & 1 deletion blog1.md
    Original file line number Diff line number Diff line change
    @@ -16,8 +16,31 @@ Advantages
    ------------
    * One of the major barriers to entry for writing a blog for me was finding/writing the software, configuring wordpress, or something of the sort, and then finding a cheap/free host for it and maintaining it. Gist hosts my content for me.
    * Gist supports markdown! This means I can have some pretty formatting instead of just text files.
    * I can embedd images as well!
    * I can embedd images and code as well!
    * ![](https://a248.e.akamai.net/camo.github.com/06a279212063fc9d9f9ffddb936e103adbe623e1/687474703a2f2f692e696d6775722e636f6d2f4f49416a692e706e67)
    * ```C#
    public static IEnumerable<T> NextPermuatation<T>(this List<T> source, Func<T, T, Boolean> comparison)
    {
    int i = source.Count - 2;
    for (; i >= 0 && comparison(source[i+1], source[i]); i--) ;
    if (i == -1)
    {
    for (int x = source.Count - 1; x >= 0; x--)
    yield return source[x];
    yield break;
    }
    int j = source.Count - 1;
    for(; j > 0 && comparison(source[j], source[i]); j--);
    for(int x = 0; x < Math.Min(i, j); x++)
    yield return source[x];
    yield return source[Math.Max(i, j)];
    for (int x = source.Count - 1; x > Math.Max(i, j); x--)
    yield return source[x];
    yield return source[Math.Min(i, j)];
    for (int x = Math.Max(i, j) - 1; x > Math.Min(i, j); x--)
    yield return source[x];
    }
    ```
    * They're more or less permanently hosted. No need to worry about backups or harddrive failures.
    * They're written through the wonderful Ace editor.
    * They're all assosciated with my account for easy searching if I want to look up how I solved a problem before.
  11. Quantumplation created this gist Dec 12, 2012.
    28 changes: 28 additions & 0 deletions blog1.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    Gist as a blogging platform
    ==========================

    Introduction
    -------------
    I've been meaning to write myself a blog for a while. As my roommate described, it would have several benefits:
    * Helps keep you organized and distills things you've learned or thought about recently.
    * Lets you offload ideas from your mind.
    * Lets you reference those ideas later.
    * Ever have that moment where you remember solving something, but don't remember how?
    * Lets you get exposure for your thoughts.

    It occured to me today that Gist makes the perfect platform for blogs like these. Why?

    Advantages
    ------------
    * One of the major barriers to entry for writing a blog for me was finding/writing the software, configuring wordpress, or something of the sort, and then finding a cheap/free host for it and maintaining it. Gist hosts my content for me.
    * Gist supports markdown! This means I can have some pretty formatting instead of just text files.
    * I can embedd images as well!
    * ![](https://a248.e.akamai.net/camo.github.com/06a279212063fc9d9f9ffddb936e103adbe623e1/687474703a2f2f692e696d6775722e636f6d2f4f49416a692e706e67)
    * They're more or less permanently hosted. No need to worry about backups or harddrive failures.
    * They're written through the wonderful Ace editor.
    * They're all assosciated with my account for easy searching if I want to look up how I solved a problem before.
    * Coworkers/friends can comment with their own thoughts on the topic, and they can use markdown as well.
    * I can submit revisions if I find an error in the blog posts.
    * I/someone else can fork/clone/revise it if I have a better idea to solve the problem I'm blogging about, and related solutions are all automatically linked to eachother.

    So, Here's my first entry in (hopefully) a long line of personal expositions and reflections on programming and the like.