“If your business depends on you, you don't own a business--you have a job. And it's the worst job in the world because you're working for a lunatic!”
by Michael E. Gerber The E-Myth (Revisited)

Archive for December, 2007

Snippet: ROT-13

ROT-13 is a very simple variation of the Caesar Cipher in which each character is rotated thirteen positions along the Roman alphabet. The purpose of this simplistic cipher is typically to “obstruct” material from view; not necessarily to conceal it. The significance of the thirteen (over Caesar’s three) is to allow the cipher to be used as a “toggle” instead of with separate encoding and decoding routines. Since the Roman alphabet has twenty-six letters, rotating a letter thirteen positions will give you its exact inverse; rotating again will give you the original.

Click here to download the snippet: ROT-13

Sample Input:
I’m ROT-13, baby!

Sample Output:
V’z EBG-13, onol!

Snippet: Die Roll

This snippet replaces instances of #d# in a text block with random numbers generated similarly to table-top gaming dice rolls. The random numbers are generated the same way that a die would be rolled in this situation (e.g. “3d6″ equates to “roll random 1 to 6 three times; add all three rolls”).

Click here to download the snippet: Die Roll

Sample Input:
I have a +1d3 Ring of Codefu, but I may be inclined to part with it for say… 3d20 gold? Hmmm…

Sample Output:
I have a +3 Ring of Codefu, but I may be inclined to part with it for say… 13 gold? Hmmm…

Snippet: HTML Encode

This snippet will ensure that text will store inside “markup” languages (i.e. HTML and XML). Nothing elegant… but highly useful. ;)

Click here to download the snippet: HTML Encode

Sample Input:
<Sample>Some common text & such. Lance really likes using the · symbol in S·O·S, doesn’t he?</Sample>

Sample Output:
&lt;Sample&gt;Some common text &amp; such. Lance really likes using the &#183; symbol in S&#183;O&#183;S, doesn’t he?&lt;/Sample&gt;

Snippet: Line Number

This snippet will prefix text line with their respective line numbers.
Handy little diagnostic snippet, it is. It supports configuration to change the line-numbers’ surrounding characters.

Click here to download the snippet: Line Number

Sample Input:
* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
* Donec posuere nulla eu eros.
* Mauris fringilla fermentum lorem.
* Morbi eget orci pulvinar nunc sodales malesuada.
* Integer at est at dui dapibus ultrices.

Sample Output:
(1) * Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
(2) * Donec posuere nulla eu eros.
(3) * Mauris fringilla fermentum lorem.
(4) * Morbi eget orci pulvinar nunc sodales malesuada.
(5) * Integer at est at dui dapibus ultrices.

SOS.Tray v0.8

So here is the download link to the installer for the SOS.Tray application. It will also install a “My SOS” folder into your “My Documents”. This is crucial.

The SOS application looks at directories under the “My SOS” folder as categories for snippets (e.g. “My Documents\My SOS\Development”). Under these categories, it looks for “.sos” files (the console applications).

The installer does not contain any snippets by default, but I have a few that I will be posting soon. They are simply “.zip” files that you will need to extract into a category prior to use.

After installing any new snippets (until I write a bit more code), you will need to restart the SOS.Tray application to see the menus and trees rebuild.

Here is the download link for the SOS application…

Click here to download Snippets on Steroids (S·O·S) v0.8

Out of the gates…

Off to a good start, I believe. SOS has now hit v0.8 without even a public release. I’ll be attaching an installer to the next post, and will soon after be monkeying around with Blogger to see if I can remember how to use it. ;)

Oh… what’s SOS? Hmmm… ;Þ

Well, it’s basically just a (hopefully useful) wrapper around a very simple concept of text manipulation. Let’s face it. Most of us do things with text daily that are almost autonomous. Unfortunately, they aren’t always as easy as we’d like. That’s where SOS (Snippets on Steroids) was envisioned; in the muck.

So I’m out of the muck now, and have a little gem that I think you may find useful. Let me know if you do.

The application version may say “v0.8″, but don’t let it fool you. It’s not going to be an official release (v1.0) until quite a few improvements that I’m in the process of hammering out.

This does, however raise the interesting point of “why would I make it publicly available if I wasn’t even done with v1.0?” So glad you asked…

SOS is so much more than my pesky little application. It’s a new freedom! Okay, not really… but it really is cool. ;)

SOS needs problems. I need people to post what they think SOS could do for their “block o’ text”. Take a look at some of the examples that I’ll list soon, and try to think beyond them.

As many problems as it may need, it will never be free of the need of solutions. Developers, take this simple system and make a quick application (.NET console apps work quite well). I’ll explain more in detail in subsequent posts, but I want to make sure I have everyone’s ears.

Oh yeah! Before I forget… SOS is free. ;)

Tags
Get a free book about code review best practices.