Showing posts with label Blogging. Show all posts
Showing posts with label Blogging. Show all posts

Wednesday, September 25, 2013

Things I'm playing with now

Wow, it's been a while since I've updated this blog. Looks like my code-formatting broke too.

Anyway, lots of things have changed, but here's what I am looking at recently:
  • Parse.com, a data backend with SDKs for all major platforms: JavaScript, iOS, Andriod, .NET as well as REST
  • LINQ, specifically PredicateBuilder that lets you build OR logic, as well as building expressions and having them translated into SQL calls
I'll see if I can post some tutorials on using Parse some time soon.

Wednesday, October 14, 2009

First week at a new job

Well I’ve started a new contract this week, but this time I’m not inflicted with draconian web filtering. Maybe now I’ll be able to do some more blogging, posting little tid-bits of information that seem interesting and get back in touch with some of my peers online.

I was with ABB Grain (now a yet-to-be-named part of Viterra, perhaps Viterra Australia?) for around 15 months, in that time I assembled a team of great developers and as a team we produced a great product that our users love. Thanks to everyone there that made those 15 months so memorable for me.

I’ve discovered that I can even run MSN Messenger now, but we’re under a pretty tight deadline so I doubt I’ll have time to chat or answer questions for the next couple of weeks, so I won’t bother signing in until things calm down a bit.

Oh, Ben Laan, this means you have to do your blog post now :P

Thursday, June 26, 2008

Code highlighting workflow, using free tools

This time I created the below by pasting my code into Notepad++, selected all text, and went to TextFX, TextFX Convert, Encode HTML. Lastly I added a <pre class="C#" name="code"> to the top and </pre> to the bottom and copied it all, then used Past Special in Live Writer so I could tell it to paste as HTML.

Here's the result:

		public CustomServerProvider()
{
var cnn = new SqlConnection( Properties.Settings.Default.ServerConnectionString );
Connection = cnn;

const string newAnchorVariable = "@" + SyncSession.SyncNewReceivedAnchor;
var selectNewAnchorCommand = new SqlCommand
{
CommandText =
string.Format( "SELECT {0} = min_active_rowversion() - 1",
newAnchorVariable ),
Connection = cnn
};
selectNewAnchorCommand.Parameters.Add( newAnchorVariable, SqlDbType.Timestamp ).Direction = ParameterDirection.Output;
this.SelectNewAnchorCommand = selectNewAnchorCommand;

var downloadOnlyTables = new Dictionary<string, string> { { "BillingInfo", "BillingInfoID" }, { "Employees", "EmployeeID" }, { "Projects", "ProjectID" } };


Much better in my opinion!

Testing SyntaxHighlighter

This post is to check that I've setup SyntaxHighlighter correctly.

	public class CustomServerProvider : DbServerSyncProvider
{
public CustomServerProvider()
{
var cnn = new SqlConnection( Properties.Settings.Default.ServerConnectionString );
Connection = cnn;

const string newAnchorVariable = "@" + SyncSession.SyncNewReceivedAnchor;
var selectNewAnchorCommand = new SqlCommand
{
CommandText =
string.Format( "SELECT {0} = min_active_rowversion() - 1",
newAnchorVariable ),
Connection = cnn
};
selectNewAnchorCommand.Parameters.Add( newAnchorVariable, SqlDbType.Timestamp ).Direction = ParameterDirection.Output;
this.SelectNewAnchorCommand = selectNewAnchorCommand;

var downloadOnlyTables = new Dictionary { { "BillingInfo", "BillingInfoID" }, { "Employees", "EmployeeID" }, { "Projects", "ProjectID" } };

foreach( var pair in downloadOnlyTables )
{
var tableName = pair.Key;
var primaryKey = pair.Value;

var builder = new SqlSyncAdapterBuilder( cnn )
{
TableName = tableName,
RowGuidColumn = primaryKey,
SyncDirection = SyncDirection.DownloadOnly,
CreationTrackingColumn = "CreateVersion",
CreationOriginatorIdColumn = "CreateID",
UpdateTrackingColumn = "UpdateVersion",
UpdateOriginatorIdColumn = "UpdateID"
};

SyncAdapter adapter = builder.ToSyncAdapter();
adapter.TableName = tableName;
this.SyncAdapters.Add( adapter );
}

this.SyncAdapters.Add( TimeEntriesAdapter.GetNew( cnn ) );
}


So, there's still some tweaking needed it seems, but it's looking good, perhaps I just need to create a tool to make the code HTML safe, and perhaps wrap it in the right PRE tag for me... something to think about for later



new Dictionary

vs

new Dictionary<string , string>