Getting things done

I’ve been over-doing it lately; which really means I’ve been doing a whole lot while getting very little done. No, no, it’s not affecting my paid work. Clients should not worry. Rather other things. I’ve got too much on my reading list, too many little side projects sitting in unfinished states, and too many other ideas floating around in my head.

I need to get more things done. I’ll start by not adding things to my list, and then finish up the lowest hanging fruit.

I’m crushing on RavenDB right now; there is a lot of promise there. RavenBlog is being built with it but I’m not making the progress I think I could. It’s going to have to wait a little bit while I clear out other distractions.

Going to finish all those books I bought from Manning, and then buy a TekPub subscription. That way Rob Conery can spoon feed new ideas directly into my brain. Should save time and money. (P.S. I still like Manning for tech books)

 
May 20, 2010 05:00 by josh
E-mail | Permalink
blog comments powered by Disqus

Lately

Lately, I’ve been pulled in multiple directions.  I did some prep work and volunteering for a local .Net event.  Plus billable work.  Plus family stuff.  Plus occasional OSS code, including RavenBlog.  I’m hoping to get some more time for RavenBlog actually.  TimesheetToaster needs work too – thinking of adding jqGrid to handle paging.  I’m gonna try to stop adding to my list of distractions todo list for the rest of this month.  But if you have some topic or idea, contact me here.

 
May 12, 2010 14:26 by josh
E-mail | Permalink
blog comments powered by Disqus

a rough cms with clouddb

Over the last while, I’ve been adding some CMS features to the Computerist Solutions site.  It’s powered by data on CloudDB, and that’s worked well.  It gave us the ability to manage content using the CloudDB web interface right away, and I’ve added some CMS management directly into the csinc site over time.  It’s a little rough but good for our purposes.  Here’s a peek:

CropperCapture[39] CropperCapture[40]

CropperCapture[47] CropperCapture[41]

 CropperCapture[42] CropperCapture[43]

 CropperCapture[44] CropperCapture[45]

Yes, there is a little HTML editor in there too, thanks to JQuery and jHtmlArea.

 
April 7, 2010 06:00 by josh
E-mail | Permalink
blog comments powered by Disqus

OK GO! Phoenix Gu 2010 VIP Contest Begins

Using our new capabilities for content management via CloudDB, we have placed a secret code somewhere on our site. It’s not on the blog portion, so you can skip looking there. To enter, you need to submit your answer on twitter to josh or csinc.

This is the first entry chance.  There will be more, but only the first respondent gets in on this one.

Oh, and please check out the rules.

 
March 30, 2010 08:47 by josh
E-mail | Permalink
blog comments powered by Disqus

Promoting Phoenix Gu 2010

Put this on your site/blog to help advertise the Phoenix Gu 2010 event.

<div style="width: 250px;"><iframe name="countdown" id="mgframe" src="
http://www.eventbrite.com/countdown-widget?eid=611672529" width="250"
height="332" marginheight="0" marginwidth="0" scrolling="no"
frameborder="0" ></iframe></div>

 

looks like this:

via @scottcate on @azgroups yahoo group

 
March 26, 2010 07:00 by josh
E-mail | Permalink
blog comments powered by Disqus

csinc cms

Just a quick note about recent changes to the site.. ComputeristSolutions.com is now largely driven by content from CloudDB. There are a couple of exceptions, namely the footer. I’ve been pleased with the experience and would definitely use CloudDB again or recommend it for the right circumstance.

I’ll be adding a little content management feature set. Plus there are a couple layout and design flaws we need to fix. It’s coming together nicely otherwise.

 
March 23, 2010 14:59 by josh
E-mail | Permalink
blog comments powered by Disqus

CloudDB v3 api

Update

So I got the csinc site switched over to using v3 api instead of the v2 CloudDB strongly typed service. Generally, I like it because it allows greater flexibility. That could have been true for v2 api, but I haven’t tried it so I can’t say. The CloudDB hasn’t put together the docs for this yet, so I’ll show you some code to use it below.

Why use it

First, it keeps the website portable. It doesn’t matter where it’s hosted because the datastore doesn’t change. Second, We can tweak content and even some behavior/layout stuff easily by making the change using the clouddb website.

Implementation

I’m not entirely settled with our implementation so far. How we read columns and set object properties needs work. Also, I re-factored the base to pass in a context object basically just to pass around a pointer to the IWindsorContainer instance so it would work in the web app and in the test project. It’s one of those quick hacks which you’re not quite happy with but don’t really have another good idea at the time. I just wanted my tests to pass.

Getting started

First you have to get an invite, and then set up a clouddb account.  Once done, add the clouddb api url as a webreference and begin coding. Start with the login code:

   1:  public static Token Login(string user, string password)
   2:  {
   3:    using (CloudDB cdb = new CloudDB())
   4:    {
   5:      return Login(cdb, user, password);
   6:    }
   7:  }
   8:   
   9:  public static Token Login(CloudDB cdb, string user, string password)
  10:  {
  11:    Token tok = cdb.LogIn(user, password).Result;
  12:    return tok;
  13:  }

Using an instance of CloudDB and the Token, you call whatever api method you need. Our site only uses reads so far.  So here’s how we get a list of rows:

   1:  public static RowsResponseData GetRowData(CloudDB cdb, Token token, string appName, string entityName, Predicate[] predicates)
   2:  {
   3:    App app = cdb.GetApplicationByName(token, token.UserID, appName, false, false).Result;
   4:    Entity e = cdb.GetEntityByName(token, app, entityName, false).Result;
   5:    RowsResponseData rowData = cdb.SearchEntity(token, app, e, predicates, 0, 0, 0, 0).Results;
   6:    return rowData;
   7:  }

 

In the above code, the Predicate array is used to specify which rows to get back from clouddb. That’s how we get a single match if we want.  Just query for the id or other unique criteria. Here’s how we handle that in our record base class:

   1:  public static T GetRecord(IAppContext context, string cacheKey, string entityName, Predicate[] predicates)
   2:  {
   3:    CachedItem ci = DataCache.GetItem(cacheKey);
   4:    if (ci != null) return (T)ci.Data;
   5:   
   6:    try
   7:    {
   8:      ICloudConnectionSettings connectionSettings = context.Container.Resolve<ICloudConnectionSettings>();
   9:      RowsResponseData rowData = CloudDBDataAccess.GetRowData(connectionSettings.CloudDBApplicationName, entityName, connectionSettings.CloudDBUser, connectionSettings.CloudDBPassword, predicates);
  10:      T item = new T();
  11:      item.Init(rowData.Data, 0);
  12:      DataCache.Add(cacheKey, item);
  13:      return item;
  14:    }
  15:    catch (Exception er)
  16:    {
  17:      T item = default(T);
  18:      DataCache.Add(cacheKey, item);
  19:      return item;
  20:    }
  21:  }

 

You’ll notice that caching is also handled at that layer so the specific model doesn’t have to know or think about it. (Yes, there are things I can do to improve this. Remember, time for our own site isn’t a high priority versus time for clients.)

..and a sample usage:

   1:  protected bool ShowDynamicContent()
   2:  {
   3:    return ShowDynamicContent(Request.FilePath.ToLower());
   4:  }
   5:   
   6:  protected bool ShowDynamicContent(string contentName)
   7:  {
   8:    var pageContent = PageContent.GetByPath(new AppContext(), contentName);
   9:    if (pageContent != null && pageContent.IsPublished)
  10:    {
  11:      PropertyBag["contentTitle"] = pageContent.Title;
  12:      PropertyBag["contentDescription"] = pageContent.Description;
  13:      PropertyBag["content"] = pageContent.Content;
  14:      RenderView("../shared/contentview");
  15:      return true;
  16:    }
  17:    return false;
  18:  }
 

   1:  public void Index()
   2:  {
   3:    //show dynamic content if available, defaults to view file content if not
   4:    ShowDynamicContent();
   5:  }

 

Good to know

Clouddb data is described with Entity objects representing the table, Column objects describing the columns for data, and Row objects containing the data. Think of it a little like a DataSet in .Net. You’ll need to know a little about the columns in the data, and then read the values from the Rows array. Also, you’'ll need to know the application name, which is the specific clouddb database in your account.

That’s a simple overview. Hopefully it helps. There is more to it, but that should get you started.

kick it on DotNetKicks.com

 
December 10, 2009 07:00 by josh
E-mail | Permalink
blog comments powered by Disqus

CloudDB and other goings on

I’m continuing to play with CloudDB as the data store for the computerist solutions site. Currently the sidebar links are stored in clouddb, as well as optionally storing most page content in it.  Currently, only the home page has its content in clouddb.  It’s built so most pages check on first load if content is available in clouddb, otherwise render the normal view.

So all this makes me think.. why not add a users table and go full on CMS with it. I think it would work. So why not also build our own blog engine too.  Again, it might just work but it becomes a question of size restrictions.  I just don’t know what clouddb will allow/handle. I’ll have to ask the team about it.

Speaking of features, CloudDB is working on the next version. It may get released by the time this gets published. I’m waiting to see what changes there are.  There will be JSON support I’m told, which will make be wonder whether to stick with the current webservice method of calling it or move to the JSON method.

Overall, I like clouddb. It’s perfect for the csinc site. It maintains the portability directive because we can host anywhere and still fetch data from clouddb.  Plus we have some nice flexibility with the content. It really is an enticing solutions. It took some thinking to centralize the data access and caching, but worked out. Now I’m just waiting to see what clouddb v3 brings.

I’ll probably post again on CloudDB when the next version comes out. I’ll do some code samples at that time. Maybe a working sample project for people to try.

Other Goings On

In other news, I recently found myself considering buying a new vacuum. It was a good vacuum when we bought it but it had lost its power over the last year. Thanks to some random review, I rechecked the filter I thought I cleaned and found that it was actually just the housing for the actual filer. After cleaning it, the power is back! How many times have you felt you code base is old and worn out? Maybe you just need clean it out a bit instead of throwing it away.  Add some tests, maybe use clouddb, or refactor some common code. Having made the clouddb changes to csinc, it feels refreshed and not so stale. I still want some more clean up and better testing but I like where its going. ..just a little life lesson applied to work.

 
November 24, 2009 07:00 by josh
E-mail | Permalink
blog comments powered by Disqus

Considering Cloud DB

CloudDb is a web based data store, and it’s pretty cool. I got an invite a while ago from my friend Scott Cate (mykb), but didn’t really dig too much into it. Now if you follow this blog, you’d now we’ve been looking at different data storage options for various things such as content for this site. Most embedded db’s aren’t an option because it’s currently hosted in a Medium Trust environment which doesn’t allow native calls (all the embedded db’s I know require this). That pretty much killed it. We have the option of using mysql or 1 sql server database but we’d like to keep this as portable as possible. Also, there are other plans for that.

But Hey! Why not use a cloud or web based service? We want to be able to manage some content without re-deploying, and a cloud service would allow that. Yes, most of the current content are just stored in view files, but what’s the fun in that?

I’ll probably post more info when I get something together. In the meantime, click the link and watch the videos.

 
November 18, 2009 07:00 by josh
E-mail | Permalink
blog comments powered by Disqus

Runtime error of precompiled spark view

I’ve been working on overcoming my own ignorance in using precompiled views with Spark view engine. Making progress, but it’s not been straight forward. It’s not really a problem with Spark, which is why I’m still trying to make it work. It’s just that errors encountered during the post build step to precompile the views aren’t clear. It required using System.Diagnostics.Debugger.Launch() to figure out the problem. Which of course was something stupid I did; put a namespace in the assemblies config section for spark.

So figured that out, and it compiled. Yay! Then I ran it..

ViewError

It’s probably something else I forgot to do or whatever. Maybe I need to register routes so it knows which views to render. This is why I haven’t yet posted another Spark article. It’s suppose to cover lessons learned with precompiling view. So I should have plenty to cover.

 
November 13, 2009 23:57 by josh
E-mail | Permalink
blog comments powered by Disqus


about josh

another programmer blogging about his misadventures in writing code.

Contact

contact us for website & software consulting

Decide

decide on pragmatic solutions

Develop

develop your product together

Succeed

achieve your goals with our services