Sunday, October 26, 2014

Couchbase Server + Retrieve records since a given date/time

For one of my current projects I need to be able to query for documents since a "last retrieved" date/time. To do this I created a simple view using the convenient function "dateToArray". I included Id in the key to ensure that I get a result per unique document.

The view:

function (doc, meta) {
  if(doc.Type == "Account") {
    emit([dateToArray(doc.LastModifiedDate), doc.Id], doc.Id);  
  }
}

To get the proper results I first needed to sort descending, then choose a valid start key. This will give me all of the documents since 10/16/2014. Enjoy!

http://localhost:8092/cache/_design/accounts/_view/accounts_by_source_and_lastmodifieddate?descending=false&startkey=[[2014,10,16,0,0,0]]

Tuesday, October 21, 2014

Food, shelter, and safety. ..

...are rights,  not privileges. The earth has plenty of resources to provide all three. The problem is that we've allowed greedy or misguided people to benefit by controlling these resources. Any resource aside from what one requires to survive should be taken away and given to someone without that resource.

Tuesday, October 7, 2014

I am cross platform...

I run Windows 8 in a Parallels VM on Mac OS X Mavericks. I develop software using Visual Studio in Windows 8, Xamarin Studio on Mac OS X, XCode on Mac OS X, and I heavily rely on Sublime Text for cross platform development.

Did I mention I develop with NodeJS on Ubuntu Linux and I administrate Couchbase Server running on Ubuntu Linux in a cluster on the Azure Cloud?

I am cross platform.

Friday, October 3, 2014

The Power of Introverts

I watched this a couple years ago, but I had forgotten about it.

http://www.ted.com/talks/susan_cain_the_power_of_introverts?language=en

This is beautiful.

Wednesday, October 1, 2014

Xamarin is cool, but it isn't ready yet...

I have spent the last three days learning Xamarin. I have had some huge successes such as setting up navigation, storing data via Couchbase Lite, and sharing code among platforms. The biggest disappointment so far surrounds authentication. I followed an example (http://www.joesauve.com/using-xamarin-auth-with-xamarin-forms/) but I have been unable to get Google auth or Facebook auth working with it for iOS (both work for Android). The feedback in the forums is lackluster at best. Lots of good questions, but very few decent answers. It looks like most of the time questions are left laying around rather than being responded to.

Auth is a basic function these days, and good community feedback is vital for learning these tools, if you cannot provide both of these you are simply not ready to be used on a large scale.

I will try again in six months.


Thursday, September 18, 2014

Dumb people...

...will complicate the most simple things.

Wednesday, September 10, 2014