Saturday, November 28, 2015

two thoughts on patterns that came to me during a Black Friday car trip

The "Repository" pattern for which a name could not be suggested here is really just an example of the Factory pattern as best as I can tell. This serves as ammunition to boost my assertion methinks. Also, this problem of not wanting to have testers retest working code could perhaps be alleviated in the OCP purist paradigm that few of us really wrap our ways around.

Perhaps this isn't that clear. I write for a second time today, having slept on what I wrote above. This suggests that Eric Evans thinks that there is a difference between factories and repositories in that repositories get the data and then the factories compose the data downstream in a second step. I guess if I were not using NHibernate and I were using a stored procedure to grab data in a repository, the dataset would then be run through a factory to cast it to a domain object. Moreover, I began feeling self-doubt about what I wrote above out of realizing that saves and updates to objects don't necessarily return much from repositories and thus might break with the whole factory notion. Hmmm... you are still going to a repository to get an object that you should not just new up cowboy-style outside of the repository so it really feels like this is functionally a variant of the factory pattern with the fact that you can hand stuff back in really just meaning that the "factory" itself may be tweaked. Assuming an onion architecture, you ought to be able to pull all database interactions out of your repositories and replace them with POCOs stored in session or static state or the cache or something and have all the unit tests still pass, and then the only differentiation from a purist factory pattern would be that the underlying state may be tweaked. We are not supposed to care from the outside looking in how this external dependency does what it does, we just call methods on it. As suggested here, we are asking for objects we dare not instantiate and thus the similarity is strong, repository pattern to factory pattern that is, even if repository and factory mean two different things to Mr. Evans as standalone terms not leading the word "pattern."

YUI

The Yahoo! User Interface Library is yet another JavaScript toolkit. It is discontinued. I think it is a would-be rival to jQuery and Dojo.

Friday, November 27, 2015

double pipe symbol operator in JavaScript

Not unlike the null coalescing operator in C# this gives a failover for an assignment should the thing being assigned be null. For example, while this code will throw up a 4 in an alert it would give a 5 if the contents of the "four" variable were falsey instead of 4...

var four = 4;
var five = 5;
var whatever = four || five;
alert(whatever);

 
 

It's like the wacky double ampersand operator in JavaScript only much less wacky. This thing actually makes sense when you read the code.

Thursday, November 26, 2015

the product company versus the consultancy

A successful SaaS model product company will have high margin profits from recurring revenue and this more than anything else will make it a good place to work. The day to day slog at a successful tech consultancy will be a lot tougher but will attract top talent and ultimately provide more opportunities to learn and a greater diversity of things to learn. The diversity comes from a greater number of greenfield applications (in lieu of extending what already exists) and this is the thing that draws in the heavy-hitters too. And yet, if you ever want to get past the flashing lights and inadequacy of upkeep to really work on a business problem and understand a domain, it will happen at the product company.

Wednesday, November 25, 2015

background-size: cover; causes the "Aw, Snap!" Google Chrome error when colliding with the "All" button in ASPxGridView grids for DevExpress.

Stretch a background image across the background of your web site with the "cover" trick. Then, go to one of your paginated lists. Now, scale the list up to show ten thousand records. Watch Chrome start to whimper. Fail!

 
 

Addendum 11/30/2015: max-height: 3000px;

...is the solution for this problem. The number doesn't have to be 3000 exactly. You get the idea, right?

 
 

Addendum 12/1/2015: Honestly, a better way to approach this is to have a setting like so in DevExpress' paradigm...

VerticalScrollBarMode="Visible" VerticalScrollableHeight="600"

 
 

The problem with the CSS height setting is that if you apply it to a body tag, then the ASPxGridView will expand over or, more likely, under your footer. You may hack around this by trying to put a div inside of the body tag that holds the background image, but that's really "rolling your sleeves up" work that might just be "too much" you know? Move the VerticalScrollBarMode setting to the C# code behind to make it condition! Observe:

private void ToggleVerticalScrollbarVisibility()
{
   var count = ReportGrid.GetCurrentPageRowValues().Count;
   if (count > 21)
   {
      ReportGrid.Settings.VerticalScrollBarMode =
            DevExpress.Web.ScrollBarMode.Visible;
   }
   else
   {
      ReportGrid.Settings.VerticalScrollBarMode =
            DevExpress.Web.ScrollBarMode.Hidden;
   }
}

 
 

I called out this at the ReportGrid_CustomSummaryCalculate and ReportGrid_CustomSummaryCalculate events which were assigned like so on the C# side:

ReportGrid.CustomSummaryCalculate += ReportGrid_CustomSummaryCalculate;
ReportGrid.PageIndexChanged += ReportGrid_PageIndexChanged;

temporary session states

These are rows in a database table somewhere which are the authentication standard for an application where traditional sessions cannot exist, i.e. ASP.NET Web API-driven applications. When attempting to do anything the user must hand in the guid for a row and the row must be found. This, yes, means that the rows must be cleaned away periodically (in short periods) by a background process least they linger for too long and that it is probably wise to hand in a second guid for a user's ID also so that attackers cannot easily play guess-the-guid. Perhaps the two guids are just a part of a greater packet for communication wherever applicable. Such packets would take different shapes for differing functional roles in different API calls. The initial log in of a user would have to create a record and hand back to the user the id for the session.

Tuesday, November 24, 2015

An .ics file seems to be the extension for an Outlook calendar invite.

I had an HTML-formatted email offer a link online to a place where I could go get an Outlook calendar entry and the way that was ultimately facilitated was by way of the browser (at the URL offered) coughing up an .ics.

Could not find server 'YOURNAMEHERE' in sys.servers.

You may see this error when looping a linked server at a database table name or with a USE statement even and the solution seems to be sp_addlinkedserver which I suspect is used like so:

EXEC sp_addlinkedserver @server='YOURNAMEHERE'

 
 

I cannot tell for certain however as when I attempt to use it at my work I get a different error telling me:

User does not have permission to perform this action.

 
 

...even though I have the sysadmin server role. Huh? A powwow with the powers-that-be reveals that this is just not the sort of security hole that should be opened up to begin with. I guess that makes sense. :P

Monday, November 23, 2015

examples of explicitly using not-a-number as a setting in C#

  1. Assert.AreEqual(Math.Sqrt(-49), Double.NaN);
  2. double squareRootOfNegativeFortyNine = Double.NaN;

How do I get rid of the "Save changes to the following items?" alert when I first open an .sln in Visual Studio 2013?

This thing acts like it has something to do with "devenv.sln" and per this it may be fixed like so:

  1. Go to: C:\Program Files (x86)\Common Files\microsoft shared\MSEnv
  2. Find: VSLauncher.exe
  3. Right-click upon it and pick: "Properties"
  4. At the "Compatibility" tab of the dialog box which appears check the checkbox for: "Run the program as an administrator"
  5. Finally, click: "Apply"

Visual Studio Express

It still exists and it is still free. I guess you may get it here. It is a lightweight, watered-down Visual Studio. It comes in a few shapes. With one you may only make web apps and with one you may only make desktop apps, and so on.

How do I make a stylesheet class behave just a little bit differently only in Firefox alone?

Today I had the challenge of making an image with a line of text within it line up with some actual text in HTML while sitting side-by-side with it on the same line of copy. I ended up wrapping the image in a div which sat inline and then making the image break the rules of where it was positioned with absolute positioning as, honestly, the div was already doing the positioning. Here are some of my CSS classes:

.NoteRowImage
{
   margin-top: -3px;
   position: absolute;
}
@-moz-document url-prefix() {
   .NoteRowImage
   {
      margin-top: -2px;
      position: absolute;
   }
}
.NoteRowImageWrapper
{
   display: inline;
   width: 150px;
   height: 5px;
}

 
 

You can probably tell which one adorned the image and which one adorned the div. I found this trick for the Firefox tweak at StackOverflow though I cannot remember where. The thread suggested it will only work if JavaScript is working too.

PsExec

...lets you run executables in other environments. It's a part of PsTools.

OneNote versus Evernote

They are rival apps for keeping digital, searchable notes:

Shrew Soft, Inc. has a VPN client that will allow you to connect to Cisco's stuff without messing things up in Windows 8 and Windows 10.

Get it here and avoid this problem. (Er, I haven't tried it myself. Be careful.)

When you can't find something at Google, should you just ask on Twitter?

I'm learning that the #sqlhelp hashtag is a pretty good Twitter forum for asking SQL questions to the public at large. Someone will likely write you back. There must be other resources like this on Twitter too.

Friday, November 20, 2015

Math.Sqrt in C#!

This means of getting a square root looks the same as it does in JavaScript as suggested here in terms of syntax, but you have to hand in a double as the type. You'll also get a double back. Er, well I guess it is Math.Sqrt(whatever) in C# and not Math.sqrt(whatever) as it is in JavaScript.

To disable OWIN startup discovery, add the appSetting owin:AutomaticAppStartup with a value of "false" in your web.config.

I made a dummy ASP.NET web forms app in Visual Studio 2013 and stripped everything out it but one web form and then I got this error. As suggested, the solution is to put the following the Web.config's appSettings:

<appSettings>
   <add key="owin:AutomaticAppStartup" value="false" />
</appSettings>

Why is TeamCity better than CruiseControl?

Well, I'm learning today that TeamCity has a UI for spinning up new build projects (not unlike Jenkins) whereas with CruiseControl one must craft a new XML file for each new project and this is a separate configuration file beyond the NAnt script the build might run. I also learned that "artifacts" in build terminology refer to packages such a .zip files that get made in the build process for rollouts/deployments.

Thursday, November 19, 2015

Do NOT expect the culture on your thread to be communicated up to the Web API.

The ASP.NET Web API will not have this context. If you need it to speak you as you "think" you are speaking to it, I guess you'll either have to hand in an encoding for a culture or get back codes for messages which have to be combined with the current culture to do some fashion of message lookup. Some notes on this are:

In C#, how may I read from a resource by way of fishing with a magic string for the key.

If the project were called "MyResources" and we wish to read the line item for "Whatever" from "Errors.resx" both of these lines of code would be successful in doing so and their variables would match in an equality comparison.

string foo = MyResources.Errors.Whatever;
string bar = MyResources.Errors.ResourceManager.GetString("Whatever");

Load one of the projects in your ASP.NET solution as an Assembly type in C#.

Assembly assembly = System.Reflection.Assembly.Load("Whatever.Resources");

The modern iOS will let you take a panoramic picture with your iPhone.

I have version 9.1 (13B143) and when I go to take a photo, above the button to click in yellow lettering are five options for:

  • TIME-LAPSE
  • VIDEO
  • PHOTO
  • SQUARE
  • PANO

 
 

The PANO option allows for the panoramic pictures!

Which abbreviation for the Norwegian language at a resource, no or nb?

This suggests both are legitimate, but leans towards no being a bit better than nb.

Wednesday, November 18, 2015

Quick Language Switcher

As a Google Chrome extension, this allows you to toggle between languages quickly at the upper right corner of the browser. Right-click it's icon by the hotdog icon and pick "Options" to check checkboxes for languages to use. You may force the browser to other languages and then yet right-click in the whitespace within a page and pick an option to translate back to English still to see how copy out of resource files carries back over into English.

.OrderByDescending in C#

I wondered today how to reverse an .OrderBy and it turns out there is an .OrderByDescending too.

What's the difference between "WinDiff" and "Compare It!" eh?

You may download WinDiff here and you end up with Compare It!. I can't tell if this software is sinster yet, but the switcheroo at the product name scared me. It does what Beyond Compare does and I stumbled upon it. It has a good rating a ScamAnalyze but then I've never heard of ScamAnalyze, either?

culture-specific .resx files

What if you want to have exceptions for some common cultures with your default resources for a language in an ASP.NET resource project? Well, this sort of suggests that you may just sit Whatever.fr-ca.resx next to Whatever.fr.resx and the French Canadians will get the first resource while all other French peeps will fall through to the later (assuming there are no other french .resx files). I have not tried it yet as of this writing. Also, I guess es-la is a legitimate resource for a Spanish variation with the la standing for Latin America I suppose.

 
 

Addendum 11/19/2015: Why can't I set CultureInfo("es-la") in C# and then find the appropriate resources? Is this illegitimate? Well, it's not on the list of supported country codes here.

Tuesday, November 17, 2015

Diners Club credit card numbers may be either 14 digits or 16 digits in length.

http://www.getcreditcardnumbers.com/ will give you examples of the 14 digit numbers.

See which CA a web site uses!

If you click on the icon to the left of the https:// at the URL line in Google Chrome...

You may next go to the "Connection" tab of the thing that unfolds and therein click on: "Certificate information"

Up comes a dialog box with three tabs and at the "Certificate Path" tab you may see the CA. It is "GeoTrust Global CA" for Google for example. And, if you go to...

Console Root > Certificates - Current User > Trusted Root Certification Authorities > Certificates

 
 

...from Console 1 as described here, you should be able to find "GeoTrust Global CA" as a trusted CA.

Console Root > Certificates - Current User > Personal > Certificates has your own certs and if you right-click on a entry, somewhere beneath "All Tasks" lies a way to add the user associated with an AppPool in IIS to a certificate to make sure it has permissions.

Monday, November 16, 2015

Ultrapico Expresso 3.0

...is a tool for authoring regular expressions. It's free and runs on Windows, etc.

Review Assistant by Devart

...is yet another code review tool. This one integrates with Visual Studio.

watermark as a UX term

An example: MM sits in a form field wherein one is to enter a two digit month and when one actually enters the field by way of mouse click or tabbing the MM disappears.

Saturday, November 14, 2015

OLOO (objects linked to other objects)

This is what Kyle Simpson suggests you do instead of faking JavaScript classes in his book this & OBJECT PROTOTYPES and you'll notice he keeps the Pascal case convention for "classes" in his better way of doing things:

var Animal = {
   setSpeak: function(noise) { this.vocal = noise },
   outputSpeak: function() {
      if (this.vocal) {
         alert (this.vocal);
      } else {
         alert ("Hiss!");
      }
   }
};
 
var Bat = Object.create(Animal);
Bat.setSpeak("ping");
 
var Rat = Object.create(Animal);
Rat.setSpeak("squeak");
 
var Cat = Object.create(Animal);
Cat.actConflictedAndCrazy = function() {
   this.outputSpeak();
   alert("purr");
}
 
var myBat = Object.create(Bat);
myBat.outputSpeak();
 
var myRat = Object.create(Rat);
myRat.outputSpeak();
 
var myCat = Object.create(Cat);
myCat.actConflictedAndCrazy();

 
 

This example spits out four alerts containing...

  1. ping
  2. squeak
  3. Hiss!
  4. purr

Friday, November 13, 2015

I find myself questioning the performance gain of minified JS files.

I screwed up recently in rolling back changes to a JS file at source control in that I did not give its uglier sister the same attention and I created a bug. Do we need this overhead? How much of a boost is the minification really buying us? I can't believe that it makes anything twice as fast. All that can come out is whitespace and what you might think of as "privately scoped" variable names in a C# parallel, right? (The later get renamed to something more terse, like "x" or so.) Is that going to decrease load times a by a mere 25%? Is there some way to check?

Thursday, November 12, 2015

When one https site calls out to another and they both live on the same server there may be a gremlin.

I'm not sure how to beat this problem just yet. If you have a web site that is a "client" that reaches out the "core" web site at an https address and the client is hosted locally at your laptop or whatever, you may experience trouble if you just set up the client at the server holding the core site and expect the two to cross talk there, and really that is true even if the client isn't https. Without any variables seeming to change, the client just won't be able to talk to the https address and the https address must become an http address to counter the problem. If you're hitting the client via https in this scenario the client will then start throwing JavaScript errors which complain of the mishmash of http and https and you'll end up dropping the https for the client too. I'm not sure what to do about this yet. It is one-off wackiness as far as configurations go so maybe I don't have to think about it too hard. Whatever. If the two things were meant to live in the same environment you'd probably just have one web site.

Just about everything on my iPad shakes!

I ran into this problem today on an iPad running iOS version 7.0.4 (11B554a). The desktop icons would spaz out and that box that appears for username/password at "Mail" would too. Both of these things should move a little bit when you tilt the iPad. That's just part of the "effects" but in my case they went ape as if the iPad was fighting against being suffocated by a would-be murderer. The fix is a restart.

InstallShield

...is used for making installation routines for Windows operating systems. I've not myself used this stuff since around the turn of the millennium, but I believe it is still legit.

Wednesday, November 11, 2015

At Windows 7's start bar type two backslashes followed by the name you might otherwise remote desktop to and press Enter to see the shared folders for the machine!

neat trick, eh?

Tabular Data Stream is a way to transfer data, not unlike XML or JSON, from point-to-point.

FreeTDS is a set of libraries for working with TDS in Unix/Linux.

braces in a case

This blob of C# can't compile! There is a conflict between the two variables named: "thirteen"

using System.Web.Mvc;
namespace WebApplication.Controllers
{
   public class HomeController : Controller
   {
      public ActionResult Index(string id)
      {
         int model = 0;
         switch (id)
         {
            case "foo":
               int thirteen = 13;
               model = thirteen * 42;
               break;
            case "bar":
               string thirteen = "thirteen";
               model = thirteen.Length * 42;
               break;
         }
         return View(model);
      }
   }
}

 
 

Here is a way to solve the problem...

using System.Web.Mvc;
namespace WebApplication.Controllers
{
   public class HomeController : Controller
   {
      public ActionResult Index(string id)
      {
         int model = 0;
         switch (id)
         {
            case "foo":
            {
               int thirteen = 13;
               model = thirteen * 42;
            }
               break;
            case "bar":
            {
               string thirteen = "thirteen";
               model = thirteen.Length * 42;
            }
               break;
         }
         return View(model);
      }
   }
}

Tuesday, November 10, 2015

DNS resolution's time-to-live in ASP.NET

The default is two minutes. I don't really understand what DNS inside of ASP.NET is. It seems like if you were hitting a URL from ASP.NET that you'd just do the resolution at the time. Perhaps routes kept exclusively in C# may have where they resolve to cached in the name of speedy lookups... Yes! This has some C# DNS cache manipulation stuff example code.

Monday, November 9, 2015

The plugin for Alipay is not universally required.

Instead, Alipay requires it when it feels it should, probably in the case of sketchy users.

Sunday, November 8, 2015

Why should I care about the sealed keyword in C#?

Let's say I own a pair of scissors and I only ever use the scissors when they are closed as either a letter opener or an icepick. Then one day it occurs to me that I could just put a padlock on the scissors so that anyone else who stumbles upon them cannot accidental cut themselves with them when they really never need to be opened. Why would I be so paranoid and take the time to do this when I have to do so explicitly? (I didn't buy the scissors with a padlock on them to begin with after all.) Why wouldn't I leave open the potential for another function? Similarly, I don't see why I should live in fear of someone extending something I've made and creating a Liskov violation.

Shouldn't I just assume my teammates aren't going to do something stupid?

Saturday, November 7, 2015

Fake Fitbit!

I got this piece of swag at this tech talk and it has replaced this other piece of swag which I had used to the point on an inability to plug it in. (It got bent up over time.)

I like it. As you can see it is a plastic bracelet which reveals a USB drive when opened up. Cool stuff.

Friday, November 6, 2015

The DRY principal collides with a traditional testing team?

What if you have a working, tested production application that allows you to wring orange juice from an orange like so...

public OrangeJuice MakeOrangeJuice(ref Orange orange)
{
   orange.Clean();
   OrangeJuice orangeJuice = Wring(orange);
   UpdateInventory();
   return orangeJuice;
}

 
 

...and you want to add new code for squeezing an apple in a similar manner? Maybe apples aren't just like oranges either in terms of workflow. Maybe you should remove the core of an apple before squeezing it to keep the seeds out of the apple juice. (The squeezed apple is gonna break after all. Have you ever seen or used one of those apple core removers?) Would you refactor the existing code like this?

public FruitJuice MakeFruitJuice(bool isToDeseed, ref Fruit fruit)
{
   fruit.Clean();
   if (isToDeseed)
   {
      fruit.Deseed();
   }
   FruitJuice fruitJuice = Wring(fruit);
   UpdateInventory();
   return fruitJuice;
}

 
 

...or, instead of passing in a flag to tweak things in the case of an apple, would you just duplicate the existing logic and then rewrite it for the apple scenario like this?

public OrangeJuice MakeOrangeJuice(ref Orange orange)
{
   orange.Clean();
   OrangeJuice orangeJuice = Wring(orange);
   UpdateInventory();
   return orangeJuice;
}
 
public AppleJuice MakeAppleJuice(ref Apple apple)
{
   apple.Clean();
   apple.Deseed();
   AppleJuice appleJuice = Wring(apple);
   UpdateInventory();
   return appleJuice;
}

 
 

Well, the first approach sure seems better because in the second we repeat ourselves, right?

Maybe not. One reason to break the rules is to not break what works. For a team that heavily relieves on unit testing and Selenium tests this wouldn't be a concern, but a traditional testing team would have to test the orange logic that it already blessed as, now, the orange logic has changed. Again, think before you refactor. The testing team can't just test the apple stuff and call it good. Without the Q half of QA you just have "assurance" after all.

I believe you may use Hybris with Oracle eBusiness Suite too.

It doesn't have to be tied to SAP's ERP.

I don't know Chinese.

It has been interesting working with Alipay, which is sort of the PayPal of China. First of all, when you submit a bad packet to them you just get an opaque unhelpful error message. I was leaving out "OrderDescription" to get this error, but nothing lets you know "OrderDescription" is the pain point.

When things go right you see this instead:

If you're like me in that you don't read Chinese, and I couldn't tell you if this is even Cantonese versus Mandarin, then it may help you to know that the page above is prompting you to log in with your username and password at the left. (The username at the top left field and the password below it in the field just above the blue button.) You theoretically get routed here when making a payment online and picking a "Pay with Alipay" option. On the other side of the log in, all you have to do is reenter your password in the six slots at the lower left of the next web page that appears as seen below. Perhaps the password is always six characters long. I don't know. The next thing you will see is some fashion of confirmation page at Alipay and then, without you taking any action, a second later you will be redirected back to the site you left where I suppose that site will give you some manner of confirmation that you paid with Alipay.

https://110.alipay.com/sc/aliedit/intro.htm allows you to download a plugin that I think you have to have running in the environment where you use browsers to pay with Alipay. Because I was using a test account, I didn't strictly have to use the plugin in my testing.

Addendum 11/12/2015: The "second" password (payment password) is not necessarily the same as the first (login password). The second password is not always going to be 6 characters.

Very few of us have worked with the first two versions of HTML.

These were what they were when CERN controlled it before it open sourced it. Version 3 was what was given to us, the public, in 1994. Version 4 is the DHTML, HTML-should-be-XML-too stuff, and of course HTML5 is the modern gunk.

Thursday, November 5, 2015

Extended Properties

...in SQL Server allow you to attach metadata notes to objects (tables, views, columns) in SQL.

Disconnect

...is new Log off. This is an option when you try to shut down Windows Server 2012 R2 from a remote desktop connection and this is the right thing to do. You don't really want to actually shut the machine down, right?

Wednesday, November 4, 2015

Do a code review in SmartBear Collaborator.

  1. log in
  2. click the "CREATE NEW REVIEW" button at the upper right
  3. fill out the form fields you'll see. Give the review a name, etc.
  4. in the "Participants" subsection list yourself as "Reviewer" and pick whoever made the story to be the role of "Author"
  5. click the "ADD" button at the right of the dropdown list for "Role" which you've set to "Author"
  6. find the revision numbers for the commits to oversee in the review in TortoiseSVN
  7. click the "Upload" button under the "Review Materials" accordion and then click the appropriate item for your source control under the submenu of options which appears
  8. enter the revision numbers, separated by spaces
  9. click "BEGIN REVIEW" at the very bottom of the form
  10. click on files listed in "Review Materials" to drill into them and use the back button at the browser to return to the list
  11. if everything is good, click the "SEND TO COMPLETED" button

Set up SpreadCOM for MVC in Visual Studio 2015.

I won a SpreadCOM license at MeasureUP in a raffle and I've finally figured out how to use it thanks to:

 
 

I don't really understand it all yet. It seems to allow to you to do Excelesque stuff in ASP.NET MVC. The happy pass set up is to...

  1. Install Spread Studio 8.
  2. Make a new MVC application that references in FarPoint.Mvc.Spread.dll and FarPoint.Web.Spread.dll which I found at C:\Program Files (x86)\GrapeCity\Spread Studio 8\ASP.NET\v8.40.20151.0\bin on the other side of the Spread Studio 8 installation.
  3. Manually make a licenses.licx file in your Properties folder by just making a .txt file, outside of Visual Studio 2015, and then renaming it. You will need to include this in your project and put these two lines in it:
    FarPoint.Web.Spread.FpSpread, FarPoint.Web.Spread, Version=8.40.20151.1,
          Culture=neutral, PublicKeyToken=327c3516b1b18457
    FarPoint.Mvc.Spread.FpSpread, FarPoint.Mvc.Spread, Version=8.40.20151.1,
          Culture=neutral, PublicKeyToken=327c3516b1b18457

    If you don't add this file you get an error about how the license can't be found.
  4. You need to add a line for FarPoint to Global.asax.cs too. My Global.asax.cs looks like this:
    using System.Web.Mvc;
    using System.Web.Optimization;
    using System.Web.Routing;
    namespace SpreadComExperiment
    {
       public class MvcApplication : System.Web.HttpApplication
       {
          protected void Application_Start()
          {
             FarPoint.Mvc.Spread.MvcSpreadVirtualPathProvider.AppInitialize();
             AreaRegistration.RegisterAllAreas();
             FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
             RouteConfig.RegisterRoutes(RouteTable.Routes);
             BundleConfig.RegisterBundles(BundleTable.Bundles);
          }
       }
    }

 
 

Alright, lets go through the M, the V, and the C in MVC in that order:

  • using System;
    namespace SpreadComExperiment.Views
    {
       [Serializable]
       public class Foo
       {
          public DateTime Bar { get; set; }
          public Boolean Baz { get; set; }
          public Int32 Qux { get; set; }
       }
    }

     
  • @model List<SpreadComExperiment.Views.Foo>
    @using FarPoint.Mvc.Spread
    @{
       Layout = null;
    }
    <html>
       <head>
          <title>Whatever</title>
       </head>
       <body>
          <h1>Whatever</h1>
          @Html.FpSpread("My SpreadCOM Thing", x =>
          {
             x.DataSource = Model;
             x.DataBind();
          })
       </body>
    </html>

     
  • using System;
    using System.Collections.Generic;
    using System.Web.Mvc;
    using SpreadComExperiment.Views;
    namespace SpreadComExperiment.Controllers
    {
       public class HomeController : Controller
       {
          public ActionResult Index()
          {
             return View(new List<Foo>()
             {
                new Foo()
                {
                   Bar = DateTime.Now,
                   Baz = true,
                   Qux = 13
                },
                new Foo()
                {
                   Bar = DateTime.UtcNow,
                   Baz = false,
                   Qux = 42
                }
             });
          }
       }
    }

 
 

We end up with something like so:

Two things about this: You have to slap that Serializable attribute on the model or SpreadCOM's stuff will throw a temper tantrum (error) and in this happy pass example I wasn't really impressed with the printer icon's ability to print. I ended up just printing a blank page. Hey, it's just a start, right?

Ecommerce Flag Values or ECI Flags

Are for categorizations like MOTO and eCommerce and Retail, i.e. How is this transaction happening?

Tuesday, November 3, 2015

Boot Camp

...allows you to run Windows on a Mac!

When Google Chrome fails to ask you if you want to translate a web page...

...right-click in the web page and pick "Translate to English" to force the effect.

savedeo.com allows one to save off a Vine to an .mp4

So, it's sort of the Zamzar of Vine I guess, or maybe just one of many such tools. Visit https://savedeo.com/en/sites/vine and give it a URL for a Vine. Get the URL by going to your Vines and then clicking "Share" at a Vine and then "Link" finally. Anyhow, let savedeo.com do its thing and suffer through looking at a bunch of advertisements. It's free ultimately and ultimately you'll get a URL in Google Chrome to an .mp4 file. I recommend that you copy the URL into Safari for the PC (It stopped getting new releases in 2012 and it's the new IE6 that we still have to support isn't it?) which will cause a "Downloads" dialog box to manifest where one may right-click on the line item for the download and pick "Show Containing Folder" to see the folder on your PC to get at it. Open the file with Windows Media Player to take a look!

Monday, November 2, 2015

Octopus Deploy

Some copy directly from https://octopus.com/why is...
Octopus is great at:

  • Distributing applications to all the remote machines, securely
  • Environment-specific configuration, like connection strings
  • Configuring IIS sites and installing Windows Services
  • Doing all of the above across many machines in parallel

SurveyMonkey

...is pretty good for simple surveys. It's a corny, straightforward thing one may manage online with ease. Participants take the surveys online too. You'll send them links in an email, etc.

Sunday, November 1, 2015

Don't go ape refactoring stuff.

You're gonna break something that works if you do. Clean when you have to clean, not all the time. When you break something that had been working out in production it's gonna be bad. :( There is going to be a feeling in your belly telling you "oh no, I should have known better" and now that you've read this you really should have known better.