2012-11-14

Why Would Anyone Use Cygwin?

So, while browsing Lifehacker today, I came across an article (http://lifehacker.com/5807358/how-to-get-mac-os-xs-best-features-on-windows) that focused on using some of OS X's nicest features in Windows.

They suggested that using a *nix command line processor would make you feel right at home. I scratched my head as they said that, as Cygwin has given me grief over the years. It doesn't quite behave like a good ol' *nix shell, yet it doesn't behave like something in Windows it should. I've seen bugs with Grep and RegExes, to name a couple frustrations. Turns out, thought, I'm not alone...
Why anyone would use a poorly ported bash shell in Windows as opposed to the absolutely remarkable Windows Powershell is beyond me. PowerShell gives you the full power of the .NET framework, WMI, and ActiveXObjects directly from the command prompt. I'm sorry but cygwin just can't compete (on any level) with the native Windows Powershell.
Bill Clark approved this comment
Bill and Neal are right. PowerShell is amazing. Microsoft has a winner with that tech... As I'm sure you've already seen by reading this blog, I love PowerShell.

Alas, Zoidberg away!

2012-11-07

Mustache Templates

Time again to post a link to something I need to read up on.

Mustache provides functionality for merging JSON into HTML templates. Must research.

http://coenraets.org/blog/2011/12/tutorial-html-templates-with-mustache-js/

2012-11-05

SQL Server -> MongoDB - Foreign Keys

MongoDB, and for that matter, other nosql databases, is a new beast for many developers. Foreign Keys is a concept that may need to be implemented in Mongo, although, before you explore this route, I highly encourage you to try to embed sub-information in your document rather than try to relate it. NoSQL engines do a beautiful job of persisting whole objects.

Regardless, you'll at some point, run into a scenario where it doesn't make sense to keep embedding documents into other documents. And a DBRef probably makes sense. Read more about 'em here. The folks at mongodb.org recommend that, when you can, you use manual references ("Unless you have a compelling reason for using a DBRef use manual references."). This is an example of a manual reference:


original_id = ObjectId()

db.places.insert({
    "_id": original_id
    "name": "Broadway Center"
    "url": "bc.example.net"
})

db.people.insert({
    "name": "Erin"
    "places_id": original_id
    "url":  "bc.example.net/Erin"
})

But you can also do a DBRef, doing embedding something like this in your document:

{ $ref : <value>, $id : <value>, $db : <value> }

And apparently the order of the fields matter.

Also, apparently the C# Driver offers support for DBRefs--which may be nice than manual refs. Helper functions and what not.

That's all there is. Zoidberg away!