code
10 May 2011 | 3 Comments
Today, thanks to user Lucero on StackOverflow, I learned about .NET’s “Balancing Groups” Regex feature. Basically, any time you use a named capturing group, it actually pushes the capture onto a named stack. You can then pop this stack by using the same capturing group prefixed with a hyphen, like (?< -stackToPop>). Of course, anyone [...]
Tagged in C, code, horrid, regex, silly, snippet, XML
code
23 February 2011 | 0 Comments
Here’s a little example of statically-sized stacks in C#. They’re implemented with a linked-list as the backing store: using System; namespace ConsoleApplication { public static class MainClass { // Example: public static void Main(string[] args) { var stack = Stack.New<int>(); // real type Stack<Z,int> var s1 = stack.Push(1).Push(2).Push(3); // real type Stack<S<S<S<Z>>>> [...]
Tagged in C#, code, Development, silly, snippet
code,tips
17 November 2008 | 0 Comments
Firefox 3 was running very slow for me, so I desperately tried this, thinking that it wouldn’t make much difference. I was wrong; there was a noticeable speed improvement. From a bash shell: find ~/.mozilla -iname ‘*.sqlite’ -execdir sqlite3 {} ‘vacuum;’ \;
Tagged in code, short, snippet, snippets, tips
code
1 May 2008 | 1 Comment
Prompted by A Scala Quine, here’s a nice one in Haskell that I haven’t seen anywhere else… main = (putStr . ap (++) show) "main = (putStr . ap (++) show) " Edit: I have found it somewhere else Here, to be exact.
Tagged in code, Haskell, quine, snippet