Tuesday, December 29, 2015

How do the real SEO professionals account for a delayed effect?

I've always approached SEO in a sloppy, unscientific way, but a true professional is going to measure changes in Excel sheets or in-house tools to hone in on exactly what works instead of just making things vaguely better cowboy-style. How can they tell their tweaks apart without making one per month and waiting a month to really be sure that the change that happens, or the lack there of, is bound to the most immediate tweak? That paradigm would make improvement too slow for my patience. Hmmm. I guess some changes are actually distinguishable from others that might get jammed into the same rollout such as referring links with appended GET variables. But, if you change the name of an image, for example, or add some copy, how do you ever know (qualify/quantify) what it gets you all and all?

Roy G. Biv

This came up in conversation at an event on Xmas Eve. It is an acronym to help you remember red, orange, yellow, green, blue, indigo and violet which are the colors of the rainbow in the order they appear. I suppose there is also infrared before red and ultraviolet after violet but human beings cannot see infrared or ultraviolet. I had a college class on color as a piece of my associates degree in multimedia, and I learned that in additive color's scope (light coming directly to the eye, as in computer monitors) the colors all have different wavelengths and the actors towards the front of the list I've just given come to the eye in a quicker, more direct path than the ones father down the list which wave back and forth more.

This allows a red shirt to look orange in low light. The orange is lingering over time more than the red. Well, actually that is an example of subtractive color honestly. Subtractive color as a paradigm has to do with light bouncing off of things back to your eye, such as the things printed on pieces of paper. Paints and inks really only have colors of their own insofar as they set rules as to how light bounces off of them and back to your eye to convey color. That silly high school art class you had where you made a color wheel and they told you that the primary colors are "Red" and "Yellow" and "Blue" should be taken with a grain of salt as these more appropriately correspond to the Magenta, Yellow, and Cyan in the CMYK of subtractive colors respectively. (The K is for blacK.) The subtractive colors to some degree cover white paper to make white paper something other than white. Mixing different things makes for different colors. To get an eggshell off-white you are not applying any one of the colors 100%. Also:

  • Sound waves wave back and forth even more than ultraviolet light, making sound travel considerably slower than light.
  • The four CMYK colors of the subtractive paradigm are replaced with RGB colors in the additive paradigm. The colors are Red, Green, and Blue and if you crank them all up to full blast and put all three together they mix to make white. Turn them all down to nothing and you get to black of a monitor that is powered off. Different levels and different combinations make different colors.

Monday, December 28, 2015

PATCH http verb for restful routing?

This suggests it's for idempotent updates like PUT only you don't have to send the whole object across the wire. A minimized object with just the data points needed for the updates will do.

Sunday, December 27, 2015

You'll need a SIM card in an iPhone 4S to get Verizon Wireless to work in Sweden.

You may already have it. They found an ICCID number for my phone at Verizon's store and concluded that I had it. Without it you can only hit the default CDMA network for Verizon. That might be spotty in Stockholm. I'm not certain as I haven't been yet. A better thing might be to use other networks and for that you'll really need the SIM (subscriber identity module) card. In advance of a trip, you'll tell Verizon to turn on the roaming capability for a month-long window. Turn the phone off or put it on Airplane mode (kinda the same thing) on the flight over and then go back to using it on the other side of the Atlantic.

Friday, December 25, 2015

merry Xmas everyone!

Yesterday, for Christmas Eve, I went on an outing with my mother's boyfriend in his Toyota Prius, which is a hybrid run by both a gas engine and electric power, and he showed me some of the digital displays. I tried to take some photos.

Above the car is coasting and the act of the wheels turning is putting energy back into the car and charging the battery. Below, in contrast, the car is doing some real work.

Tuesday, December 22, 2015

happy Winter Solstice everyone!

I guess today's the solstice for most everyone. I got together with my mother and sister to play cards yesterday and my Mother mentioned that at 10 something PM on the 21st is when the solstice technically happens in Texas (that's hill country Texas folks, not El Paso), so we celebrated last night. Anyways, my sister gave me a USB drive as a Xmas gift and on it were a bunch of old games that she bought for me at old-games.com. Classic 1980s PC Junior games Below the Root, King's Quest, Lode Runner, and Microsoft Adventure were given to me and while I've even proactively tried to find some of this stuff on my own before, I've never been successful in getting old stuff to actually run on my laptop, but old-games.com explicitly packages stuff that is just easy to run in modern Windowsland without a painful (impossible) install. old-games.com seems like a good place to buy old games. I for one am impressed. I was able to get all four of the titles I've mentioned up and running quickly! Yay!

Monday, December 21, 2015

When sending an email from C#, how may I tell if the email bounces?

It looks like you can't. A bounce message really takes the shape of an email coming back to your inbox and some mail servers may not necessarily even send the bounce messages. There will not be a common expected format if messages do make it to you. You would have to set up email bounce messages at your mail server, determine a format to predict, and write something to crawl your inbox for these messages. This has some code on looking through folders in Outlook. Outlook.MailItem appears to be the object for an email at that thread. Whatever. It's too much work. There is a reason that no one does this.

Sunday, December 20, 2015

register.com's whois lookup is still the one I use.

It's at this spot. A whois lookup for a domain name should give you some data about who owns the domain name and, in a pinch, I've used this to find a way to get ahold of someone at a web site by way of phone number or email address. The domain name will point at nameservers and the primary nameserver (the others are failovers for the first) will route traffic based on DNS records. The gunk that comes back from register.com for register.com itself is:

Domain Name: register.com
Registry Domain ID: 3441369_DOMAIN_COM-VRSN
Registrar WHOIS Server: whois.register.com
Registrar URL: http://www.register.com
Updated Date: 2009-08-26T04:00:00Z
Creation Date: 1994-11-01T05:00:00Z
Registrar Registration Expiration Date: 2019-08-04T04:00:00Z
Registrar: Register.com, Inc.
Registrar IANA ID: 9
Registrar Abuse Contact Email: abuse@web.com
Registrar Abuse Contact Phone: +1.8773812449
Reseller:
Domain Status: clientTransferProhibited http://icann.org/epp#clientTransferProhibited
Domain Status: clientUpdateProhibited http://icann.org/epp#clientUpdateProhibited
Domain Status: clientRenewProhibited http://icann.org/epp#clientRenewProhibited
Domain Status: clientDeleteProhibited http://icann.org/epp#clientDeleteProhibited
Registry Registrant ID:
Registrant Name: Domain Registrar
Registrant Organization: Register.Com, Inc.
Registrant Street: 575 8th Avenue
Registrant City: New York
Registrant State/Province: NY
Registrant Postal Code: 10018
Registrant Country: US
Registrant Phone: +1.9027492701
Registrant Phone Ext.:
Registrant Fax:
Registrant Fax Ext.:
Registrant Email: domainregistrar@register.com
Registry Admin ID:
Admin Name: Domain Registrar
Admin Organization: Register.Com, Inc.
Admin Street: 575 8th Avenue
Admin City: New York
Admin State/Province: NY
Admin Postal Code: 10018
Admin Country: US
Admin Phone: +1.9027492701
Admin Phone Ext.:
Admin Fax:
Admin Fax Ext.:
Admin Email: domainregistrar@register.com
Registry Tech ID:
Tech Name: Domain Registrar
Tech Organization: Register.Com, Inc.
Tech Street: 575 8th Avenue
Tech City: New York
Tech State/Province: NY
Tech Postal Code: 10018
Tech Country: US
Tech Phone: +1.9027492701
Tech Phone Ext.:
Tech Fax:
Tech Fax Ext.:
Tech Email: domainregistrar@register.com
Name Server: ns2.register.com
Name Server: ns3.register.com
Name Server: ns4.register.com
Name Server: ns1.register.com
DNSSEC: Unsigned
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
>>> Last update of WHOIS database: 2009-08-26T04:00:00Z <<<

Saturday, December 19, 2015

Amazon now asks me what card-on-file I want to use.

...instead of assuming. While I like this, this does add another step to check out and thus another opportunity for a sale to drop off. It kind of surprised me given what I learned here, and yet... I like it! There was also a page in the checkout wizard that was just an ad for an upsell that I clicked through and this too surprised me. That change has to be a negative however. I can see how you can argue a case for reminding someone to explicitly pick the card with which to pay, but bombarding people with ads is another thing.

Friday, December 18, 2015

Alipay may offer a StatusCode of P for Pending instead of the usual all-is-well Y.

When the ambiguity is resolved, Alipay will then send on an affirmation of as much asynchronously and after a while, but in order for this to be caught the listening party has to have an endpoint that Alipay may speak to.

Thursday, December 17, 2015

Zoom display size in and out at Google Chrome.

Hold Ctrl and then either use the wheel in the middle of the mouse or press the + and - keys.

Split a string on spaces in C#.

I'm doing it like this...

char space = ' ';
string[] words = poem.Split(space).ToArray();

 
 

...but, this thinks I should do this..

char[] space = new char[] { ' ', '\t' };

 
 

...as the \t will address "whitespace"

Catch a variable posted to an .ashx Generic Handler that is appended as a URL line variable.

<%@ WebHandler Language="C#" Class="Endpoint" %>
using System.Web;
public class Endpoint : IHttpHandler {
   public void ProcessRequest (HttpContext context)
   {
      var whatever = context.Request["Whatever"];
   }
   
   public bool IsReusable {
      get {
         return false;
      }
   }
}

When you kick back changes to be made in SmartBear's Collaborator...

...and they come back to you fixed, you have to open each of your defects and click "Mark as Fixed" for each before you may set the review to a "Complete" state.

Tuesday, December 15, 2015

Lithium

...could be defined as "a full-stack web application framework" per Wikipedia. It's canned PHP gunk. It provides an MVC pattern.

Monday, December 14, 2015

The distinction between .MapRoute for MVC controllers and .MapHttpRoute for Web API controllers is crucial to understand.

I added the content in white to RouteConfig.cs:

using System.Web.Mvc;
using System.Web.Routing;
using System.Web.Http;
namespace SomethingSimple
{
   public class RouteConfig
   {
      public static void RegisterRoutes(RouteCollection routes)
      {
         routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
         
routes.MapRoute(
            name: "Foo",
            url: "Foo/{id}",
            defaults: new { controller = "Foo", action = "Index", id = UrlParameter.Optional }
         );
         routes.MapHttpRoute(
            name: "Bar",
            routeTemplate: "Bar/{id}",
            defaults: new { controller = "Bar", id = UrlParameter.Optional }
         );

         routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "Home", action = "Index",
                  id = UrlParameter.Optional }
         );
      }
   }
}

When you can't reach a JavaScript file at a web app and the error thrown up to you has to do with Global.asax.cs...

Well maybe the application just can't compile, you know?

Sunday, December 13, 2015

some random notes

Things discussed at work on Tuesday:

  • SAP Biller Direct is a canned way to show people bills and let them opt in to pay the bills in the SAP space.
  • PPS stands for Practical Project Steering perhaps?
  • SAP S/4HANA looks to be something new from SAP. The ERP, as an ERP, lets you do a great swath of things in the name of ostensibly managing all concerns of an enterprise from paying bills to inventory and it looks like SAP S/4HANA is a bunch of modernizations and optimizations and greasing of the wheels to make this all more efficient.
  • FatWire is some sort of CMS that Oracle owns.
  • POS stands for point of sale. Duh.
  • There is such a thing as a Cerberus FTP way to do FTP, and that's Cerberus not Kerberos, an authentication protocol, a means of security.
  • AQtime is software to judge the performance of other bits of software, your software.
  • lynda.com has tech training classes online stuff. think: pluralsight

 
 

These are some more notes from this tech talk that I've decided I care enough about to type up:

  • Nessus will determine where vulnerabilities are in your software and OpenVAS is basically the free version.
  • QualysGuard, Nexpose Rapid7 (which plays nicely with metasploit), SAINT, and GFI LanGuard are other vulnerability scanners.
  • Core Impact was put up on a pedestal as the very best pen testing tool at the tech talk. Others include: CANVAS, the Social Engineering Toolkit (SET), and SAINTexploit.
  • Metasploitable is a VM full of security holes that you can break into to try to educate yourself in how to attack and how to defend.
  • WebGoat is an OWASP application full of security holes along the same lines as Metasploitable.

Saturday, December 12, 2015

When the Zoom Tool starts zooming out instead of zooming in at Adobe Photoshop...

Well, it should work the other way around right? It should zoom in by default and only zoom out when you are holding the Alt key, correct? Well, as it turns out this behavior is now an option on the tool that you may toggle allowing for you to reverse the behavior if you wish (i.e. only zoom in when holding Alt and otherwise zoom out). When you are suddenly plagued by the reverse behavior it means that you've managed to toggle the toggle without realizing it, and believe me, I don't know how I did it. Undo the wackiness by selecting the tool and changing the setting at the top nav where the settings for the currently selected tool, whatever it may be (in this case the Zoom Tool), lay.

Spec an extra chunk of a route when hitting the Web API!

Alright, open Visual Studio 2015 and make a generic application which mixes MVC and the Web API. Quickly, set up the CORS stuff as suggested here and then rewrite the default "home page" view to look like this:

@{
   string fullLocation = HttpContext.Current.Request.Url.ToString();
   ViewBag.LocaleParts = fullLocation.Split("/".ToCharArray());
}
<script src="/Scripts/jquery-1.10.2.js" type="text/javascript"></script>
<script type="text/javascript">
   $(function () {
      var url = "http://";
      url = url + "@ViewBag.LocaleParts[2]";
      url = url + "/Api/Whatever/Foo";
      $.ajax({
         type: "POST",
         url: url,
         dataType: 'json',
         data: {Bar:'Baz'},
         success: function () {
            console.log('yay :)');
         },
         error: function () {
            console.log('nay :(');
         }
      });
   });
</script>

 
 

Clearly, we are trying to hand an API endpoint at "Whatever" two bits of data in two different ways. We are trying to pass in "Foo" as a chunk of the URL and we are trying to pass "Baz" as a setting on a JSON object. This is all doable. The "Whatever" Web API controller looks like this:

using System.Web.Http;
using System.Web.Http.Cors;
using SomethingSimple.Models;
namespace SomethingSimple.Controllers
{
   [EnableCors(origins: "*", headers: "*", methods: "*")]
   public class WhateverController : ApiController
   {
      public void Post(string id, Qux qux)
      {
         var breakpoint = "OK";
      }
   }
}

 
 

If we set a breakpoint at the line of code in the controller which has "OK" in it (and which does nothing whatsoever in and of itself) and we debug the application with the debugger, we ought to be able to hit the breakpoint and inspect both the "id" and "qux" variables. The first variable holds "Foo" and the second holds an instance of Qux with the Bar property set to "Baz" as desired. My Qux class looks like this:

namespace SomethingSimple.Models
{
   public class Qux
   {
      public string Bar { get; set; }
   }
}

Set up CORS in a modern Visual Studio 2015 MVC5 application which mixes MVC and the Web API.

  1. Go to: Tools > NuGet Package Manager > Package Manager Console
  2. Change the "Package source:" dropdown to be "nuget.org"
  3. Type in: Install-Package Microsoft.AspNet.Cors
  4. Put config.EnableCors(); in WebApiConfig which is a class found in the App_Start folder.
  5. Now slap [EnableCors(origins: "*", headers: "*", methods: "*")] on a Web API controller. It should work!

 
 

Addendum 12/20/2019: In modern times Install-Package Microsoft.AspNet.WebApi.Cors is probably the thing to use in step three above.

What's vbscript?

I don't know. I know what it's not however. This suggests that vbscript and VB.NET are super different to the point at which the difference is as extreme as Java and JavaScript which have nothing to do with each other. I guess I've never used vbscript and when I've said that I have I've mispoken.

Friday, December 11, 2015

pre-commit processes exist in Smart Bear Collaborator

In addition to code review codes of post-commits, there is also a way to generate code reviews off of Subversion Diffs and even tie in Collaborator to Subversion hooks so that one may not commit without a code review being done first. There is an actually desktop client for (at least) Windows beyond the web site for Collaborator and you have to use the client to do the pre-commits. A post-commit may be done with the client too even though I have been using the web site myself.

Thursday, December 10, 2015

You can't start a class name with a digit in C#.

This may lead to some stupid names like: ThreeDMovie

The zh-CN resources may be thought of as in Mandarin Chinese.

This says...

  • Mandarin and Cantonese are actually dialects
  • If something is written in simplified, it is most probably Mandarin, and most probably Mandarin as spoken in mainland China

Also, the Traditional and the Taiwan flavors of Chinese are BOTH of: zh-TW

Wednesday, December 9, 2015

Explicitly keep a button from submitting a form.

There are a couple of ways to do this:

  1. <button id="button" onclick="return false;">Go</button>
  2. <button id="button" type="button">Go</button>

 
 

I found the second approach of explicitly denoting a button type of "button" to be a little alarming. Here I had to explicitly go in another direction (there is also type="reset" which keeps the form from posting while clearing values out of form fields) and that begs the question: What is the default button type? This suggests a discrepancy between IE and other browsers and buttons in forms and those that are not so, and also suggests that one should always explicitly specify a button type at a button.

Fusebox

...is a set of standards for Cold Fusion.

if (!e.Expanded) return;

Put this in a DetailRowExpandedChanged event at a DevExpress ASPxGridView to prevent the code ahead from happening if you are closing the row again instead of opening it.

It's really better to use the HtmlRowCreated event instead of the DetailRowExpandedChanged event at a DevExpress ASPxGridView to push content to a DetailRow.

private void X_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e)
{
   if (e.RowType == GridViewRowType.Detail)
   {
      
//whatever
   }
}

There is a "Clutter" folder in Outlook which is not the "Junk Email" folder.

Yes, spam gets routed here too. Look here for that thing you can't find when you can't find it.

Tuesday, December 8, 2015

AllowFocusedRow in SettingsBehavior at a DevExpress ASPxGridView

...will allow for the rows you click upon to be highlighted and stay highlighted (until another is picked). Set the setting to True. Fun.

This parallelogram will open a new tab.

What is in the new tab and how it behaves seems to vary, probably driven by settings at Google Chrome.

Monday, December 7, 2015

Cherry pick stuff out of XML with an XmlReader in C#.

byte[] bytesData = Encoding.Default.GetBytes(_myXmlInStringFormat);
MemoryStream memoryStream = new MemoryStream(bytesData);
using (XmlReader xmlReader = XmlReader.Create(memoryStream))
{
   xmlReader.ReadToFollowing("Foo");
   _foo = xmlReader.ReadElementContentAsString("Foo", "");
   if (xmlReader.ReadToFollowing("Bar"))
   {
      _bar = xmlReader.ReadElementContentAsString("Bar", "");
   }
}

Use ReSharper to cast auto-properties to traditional getsetters.

  1. Click on the auto-property.
  2. At the hammer icon which appears at the left of the line of code pick: "To property with backing field"

If the code inside of percent signs inside of angle brackets in a web form refuses to compile in Visual Studio 2015 when you've changed nothing...

Close the file and try rebuilding. I'm serious.

Saturday, December 5, 2015

Today makes ten years since Adobe bought Macromedia.

I think the best slide in any tech talk I've ever seen was in a talk at the first of the two HTML5.tx conventions in 2011. I don't remember who the speaker was. He spoke on video in HTML5. He said "This used to be a solved problem." and had a slide of Flash Gordon looking heroic with the iconic lowercase f of Adobe Flash on his chest the way Superman might wear the S. The audience laughed. Of course it stopped being a solved problem once Mr. Jobs decided he did not want to allow Flash at the iPhone and that begged the question of what to do next. Per this we now have this:

<video width="320" height="240" controls>
   <source src="http://www.w3schools.com/html/movie.mp4" type="video/mp4">
   <source src="http://www.w3schools.com/html/movie.ogg" type="video/ogg">
   Your browser does not support the video tag.
</video>

 
 

The .ogg and "browser does not support" items are failovers should their friend(s) upstream not be interpretable at a browser, though in 2015, in contrast to 2011, the .mp4 format seems golden to me and largely works everywhere. I never host video myself. If I want to use a video clip I loop in Vine or YouTube. Whatever. I digress. Anyhow, after Adobe took control of Flash, then, yes, it became to the de facto standard for web video and then it wasn't that anymore soon again after. Of course Macromedia had bought Allaire and so it had Cold Fusion when Adobe took over and so now Adobe has Cold Fusion. The day for that is perhaps done too. Fireworks is absolutely at the end of its run. At a glance it may just seem now like Macromedia was a bad purchase for Adobe as the most impressive products it offers (Photoshop, Illustrator, Acrobat) where products it just had to begin with while the Macromedia products have all aged badly comparatively. Don't be too quick to judge. There is something to be said for slaying a competitor and from the outside looking in I don't know how much of a thorn-in-the-side was alleviated from Adobe or how lucrative it may have been in the short term for them to milk the Macromedia acquisition (though I know the surprise with the iPhone's shutout of Flash had to hurt and could not have been in their projections). With regards to slaying a competitor, Macromedia was a thorn-in-the-side to some extent for sure, in direct competition with Adobe. I don't have a formal background in computer science. The only education I have beyond high school is an Associates in Multimedia from a technical college in Waco and one day while I is college, I, and some peers, went to a tech talk in Dallas somewhere which Macromedia was putting on on xRes, its would-be rival to Photoshop which looked like a plagiarized Photoshop with some optimizations. (Things that were floating above the background layer were kept in "objects" instead of "layers" making the app snappier.) Macromedia Freehand was a comparable rip-off of Abode Illustrator and these knockoffs (I don't know how Macromedia got away with it) had to be hurting Adobe's sales. Could their you-rent-Photoshop-monthly-from-us model of today even exist if they still had Macromedia offering to just sell you the same thing directly? At the event I attended in either 1995 or 1996 Adobe set up a booth outside of the space Macromedia rented to hand out swag to try to do damage control as a counterweight to all the badmouthing Macromedia was doing of them. I bet Adobe doesn't miss that!

I only offer this video clip as an example of embedding a video clip as I was talking about such stuff above. I found it online at w3schools' web site. I don't know how to tie it into my topic. Perhaps Adobe is the bear fishing for fish (customers) and Macromedia is the seagull fishing for fish (customers) which flies away at the very end, chased off by the bear. I guess a better analogy would be if the bear ate the seagull so it could turn its attention back to fish. Whatever. Are those birds "sea" gulls if they are at a river? (dunno)

Friday, December 4, 2015

"Professional Human Resources" certification

There is now a certification Human Resources people at it is the PHR cert.

word-wrap: break-word;

This CSS style will make a big unbroken string of text with no spaces in it, such as the guts of a certificate, wrap to a second line!

When making a script to alter an existing stored procedure, first check into source control a version of the script with no changes.

This will help in illuminating what changed later on.

When making expandable rows in a DevExpress grid you may need to decorate the type you bind in a list with a fake ID.

If you don't make the KeyFieldName setting here I think you'll find that trouble may arise. In the background, it feels like an ID is being picked for you somehow if you don't set one yourself and this allows for circumstances in which two rows may have the same ID and two rows may expand open when one is clicked. In the absence of having an applicable ID, why don't you just make one? Put a getsetter on your POCO. Before handing back a list of Foo just set the fake IDs like so:

var counter = 0;
for (int index = 0; index < foos.Count; index++)
{
   var foo = foos[index];
   counter++;
   foo.PseudoId = counter;
}
return foos;

 
 

You cannot just make a setterless getsetter that just hands back a random Guid. I tried that.

Thursday, December 3, 2015

Am I the only one who sees this?

When returning a column from a sproc and when you wish to cast varchar data to a bit shape...

Just do something like this:

alter procedure SQL is followed with...
SELECT
x.Foo AS [MyFoo],
CASE WHEN x.Bar IS NULL THEN 'False' ELSE 'True' END AS [MyBar],
x.Baz AS [MyBaz],
y.Qux AS [MyQux],

...then yet more SQL follows

 
 

When you slurp a dataset into C# and then turn around and cast it to a POCO you will be able to map the 'False' and the 'True' to a bool type getsetter without issue.

goofiness in which a single mouse click is automatically selecting everything from the point where you clicked to either the beginning or the end of any file

I experienced this today and beat the problem by just pressing the Shift key a bunch of times.

Wednesday, December 2, 2015

PostSharp 3.1.49 may prevent you from debugging a library by way of not making a .pdb file next to a .dll file.

POSTSHARP_CONSTRAINTS;SkipPostSharp;POSTSHARP_CONSTRAINTS

...needs to go under the "Conditional compilation symbols:" under the "Build" tab of series of tabs one gets when right-clicking upon a project name in Visual Studio 2015 and picking "Properties" from the menu which appears. This will replace the .pssym file next to the .dll with a .pdb instead!

 
 

Addendum 5/11/2016: Please note that this will sabotage the ability to use aspects!

Tuesday, December 1, 2015

A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue.

This is a "very loud" in-your-face error which occurs just in Firefox. I don't yet know how to beat it. I found something online which suggested that if you pick "Restart with Add-ons Disabled..." under "Help" that it will run Firefox without any Add-ons so that you might rule out an Add-on as the culprit, but in my case I think the culprit is DXR.axd of DevExpress. Anyways, if you can't see the "Help" menu...

  1. go the hot dog menu at the upper right
  2. pick "Customize" at base of menu which flies out
  3. pick "Show / Hide Toolbars" at lower right
  4. pick "Menu Bar"

Save the copy in an HTML paragraph in one of the paragraph form fields in a story or defect in CA Agile Central to a template.

Click that blue-copy-on-white button at the upper right of the paragraph textarea to save what you have as a template or to recover the text from an existing template.

Adobe AIR

I've never used this. I thought of it recently. This suggests: "The Adobe AIR runtime enables developers to package the same code into native applications and games for Windows and Mac OS desktops as well as iOS and Android devices, reaching over a billion desktop systems and mobile app stores for over 500 million devices." AIR stood for Adobe Integrated Runtime but now it is just "air" standalone.

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.

Saturday, October 31, 2015

Netflix

I signed up for a Netflix account today for the first time in many years, not since Netflix was nothing more than that we-will-snail-mail-you-DVDs alternative to Blockbuster video. I have been under the impression that I needed a TV to watch Netflix and that the streaming service somehow jived exclusively with the modern TVs that I don't understand as I don't have a TV... but I don't! It works great on my laptop and costs very, very little to enjoy. I christened the account by watching "Circle" which is a fourth example of cheapo science fiction. Happy Halloween!

 
 

Addendum 10/31/2015: Alright, I want to write a second time. I am already frustrated with the limited selection. It's really not like going to a video store. I remember dropping the old school snail mail service I once had over this very reason.

The charm bar won't show up at the desktop anymore in Windows 8.1???

Well, a restart fixed the problem in my case.

Rally has a REST API.

You may talk into it and do things like communicate that a build number has been incremented. Enjoy.

Friday, October 30, 2015

Make ReSharper green!

Click on all of the yellow ticks at the right edge of a file's display in Visual Studio (at the vertical scrollbar) to address each one. When you visit each one there will be a tooltip icon of some fashion (perhaps a lightbulb) at the opposite side, the left edge. When you click there will be a menu which appears which gives you options for cleaning up the problem and, yes, there is an option to just ignore the problem. The last option will have a wrench icon and read: Inspection "Assignment is not used" or some similar error message and this will expand yet another menu with: Disable once with comment ...as an option. Hopefully you won't just comment out everything. Hopefully this keeps you out of trouble.

I really hate that ReSharper encourages you to use the var keyword, but I seem largely alone in my opinion. I guess this is just modern C#, huh? Nuts.

Make ReSharper wrap lines at 200 characters instead of 120.

RESHARPER > Options... > Code Editing > C# > Formatting Style > Line Breaks and Wrapping

plus equals string concatenation

Strings are immutable in C# and whenever you appear to be modifying one you are in fact just creating a new string and putting it on the heap.

string foo = "foo";
foo += "bar";

 
 

Using a StringBuilder takes away some of the overhead of constantly growing a string by making new objects (strings) and letting old ones be dealt with by garbage collection. This is a talking point that was the fodder for interview questions ten years ago. A bigger thing to worry about in terms of optimization however would be traffic to and from the database. Don't stress the string concatenation. It probably isn't the real source of your woes. Note that strings are immutable in a weird way. They aren't value types, they are reference types that live on the heap... and yet when you "change" one the pointer for the string changes to look to the new string that is placed on the heap. This unintuitive behavior is a must for this one type given how much you use it and some of the things it has to do. It's not realistic to make a string a value type and give it a fixed-sized of memory on the stack, not when a string could contain one letter or could contain the Magna Carta. The footprint would be huge and mostly largely wasted in most scenarios.

Restrain how long an input is at an XSD?

As given in my enum example here, you have to explicitly make a restriction to sanity check the length of a string or an integer in an XSD. I think that would look like so:

<xs:simpleType name="Email">
   <xs:restriction base="xs:string">
      <xs:minLength value="13"/>
      <xs:maxLength value="42"/>
   </xs:restriction>
</xs:simpleType>

 
 

I'm not positive because when this came up today we became hesitant to do the work given the nasty mess we'd have to make of an otherwise terse XSD file. We're shelving the to-do for now.

isCrazy versus hasCraziness

is and has are both good ways to start Boolean variable names in C#, not just is.

Proxies

As a concept, a "proxy" is a layer of obfuscation to mask your browsing history. The only one I have any experience with is Megaproxy which was used at this place I worked eleven years ago by people who hated their jobs and were always searching for jobs online. Those individuals didn't want the router recording monster.com, for example, so they went to Megaproxy to go to monster.com and the router would just see megaproxy.com in the history. Basically, and you can try for yourself, you go to Megaproxy and then it will ask you for a URL and it will reach out that URL and sort of display what is at that other site in its own site. (Some formatting gets lost.) It's like a browser nested in a web site. As you click on links you to do not navigate to other sites but instead what would be at the other locales is scrapped in too. I guess under the hood, Megaproxy is scrapping the other location and doctoring up the HTML to remove stuff it doesn't like and to rewrite hyperlinks appropriately. Of course, if the man is watching you with a keylogger he will still know that your darkest workplace secrets. You've been trolling for vaporwave haven't you? Naughty.

Thursday, October 29, 2015

Mishmash instance and static in C#? What happens?

First of all, this will not compile!

namespace Whatever.Models
{
   public static class Flapdoodle
   {
      public string Bar()
      {
         return "Bar";
      }
   }
}

 
 

Static classes must have to have static methods, but what if we have something like this instead for our Flapdoodle class?

namespace Whatever.Models
{
   public class Flapdoodle
   {
      public static string Foo()
      {
         return "Foo";
      }
      
      public string Bar()
      {
         return "Bar";
      }
   }
}

 
 

Some observations about this are...

  1. Alright, this cannot compile.
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using Whatever.Models;
    namespace Whatever.Tests
    {
       [TestClass]
       public class UnitTest
       {
          [TestMethod]
          public void Test()
          {
             Assert.AreEqual(Flapdoodle.Bar(), "Bar");
          }
       }
    }


     
  2. And, neither can this:
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using Whatever.Models;
    namespace Whatever.Tests
    {
       [TestClass]
       public class UnitTest
       {
          [TestMethod]
          public void Test()
          {
             Flapdoodle bosh = new Flapdoodle();
             Assert.AreEqual(bosh.Foo(), "Foo");
          }
       }
    }

     
  3. This compiles and the test passes too.
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using Whatever.Models;
    namespace Whatever.Tests
    {
       [TestClass]
       public class UnitTest
       {
          [TestMethod]
          public void Test()
          {
             Assert.AreEqual(Flapdoodle.Foo(), "Foo");
             Flapdoodle bosh = new Flapdoodle();
             Assert.AreEqual(bosh.Bar(), "Bar");
          }
       }
    }

     

By the way, you cannot have a static struct but you can put static methods in a struct that is not static. The behavior is the same as what is documented above for a similar situation with an instance class (Flapdoodle) which has a mix of static and instance methods.

When making a new file in Visual Studio 2013 an "XML Schema" file is the type to pick to make an XSD.

This was NOT intuitive for me. Therefore, it merits a blog post. I guess XSD stands for "XML Schema Definition" so maybe I "should have known better" huh?

SmartBear Collaborator‎

...is the name of the SmartBear code review tool. You can "poke" someone in their interface. The poke icon looks like an asterisk with the center missing where the lines are all to touch. I don't know what the "poke" does yet. You may pull in a list of subversion changes to this tool and it will allow an aggregate of the changes to be broken out into code blobs which may be marked up by a reviewer.

Wednesday, October 28, 2015

Get IntelliSense when crafting an XSD in Visual Studio 2013!

Go to "Schemas..." under the "XML" menu for this. You'll see a grid of potential XSDs to use and you will need to have a checkmark in the "Use" column to get the IntelliSense. The "Add..." button should help you find XSDs not in the list, but if you added an XSD to your solution yourself I think it should just be in the list. Anyways, on the other side of this stuff, make an new XML file and type an open angle bracket followed by the name of your XSD element. You should get IntelliSense help going forward.

Compare with base

When committing in TortoiseSVN, when you see a list of files to be committed, before you click "OK", right-click on each file and pick "Compare with base" to see highlights of your changes so that you may catch something obviously awful. This came up in the context of a conversation today in which it was asserted that the farther upstream a problem might be caught the less money it costs a business entity. I've heard this theory before and have seen data points to back it up before. It would cost my employer less for me to catch my own bug than for a code review to catch it which for cost less than the bug being found in production and then dealt with. They chain to production has more than these three steps in this model. I can't recall what all of the steps are in the example I saw. Whatever. Anyways, the cost to the business balloons exponentially the farther the bad is allowed to progress along the chain.

Everything goes into getsetters on the partial classes made with Xsd2Code++ as a string.

The "type" handling is done by way of attributes like so:

[System.Xml.Serialization.XmlElementAttribute(DataType = "integer")]
public string Item_Price_X
{
   get
   {
      return this._item_Price_X;
   }
   set
   {
      this._item_Price_X = value;
   }
}

 
 

The exception to this rule is other types in other elements such as in this enum example will end up as tucked away in the Designer.cs file that's rendered out and will be used in assignments when newing up the "greater" , main type in C# in lieu of just plain Jane strings.

Tuesday, October 27, 2015

The formal way of doing code reviews per IEEE ten years ago...

...required that the code reviewer be able to explain the code reviewed to other out-of-the-loop devs.

PMD, Checkstyle, and FindBugs are audit-as-you-go ReSharperesque tools for the Java space that check code quality.

I think they will squawk if you nest switch/case statements eight levels deep inside of each other and that sort of thing. I'm not sure what PMD stands for. Links:

Corel Paradox

...was a rival to Microsoft Access back in the 1990s. Once Microsoft starting bundling Access as part of Office it could not complete and it died by way of being undercut. You could make corny forms and reports with it just like Access. It was awful. I think it was Borland Paradox for a while too. I don't know who owned it first or last. Corel Draw, an Adobe Illustrator rival, was really the thing Corel got right, but you don't hear about it anymore either. Whatever. Corel Paradox came up in a conversation today so I thought of it anew.

make an enum in an XSD?

I think it goes something like this:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
      xmlns:xs="http://www.w3.org/2001/XMLSchema">
   <xs:element name="Whatever">
      <xs:complexType>
         <xs:sequence>
            <xs:element name="Name" type="xs:string" />
            <xs:element name="Animal" type="WhateverAnimal" />
            <xs:element name="Age" type="xs:integer" />
            <xs:element name="Price" type="xs:decimal" />
         </xs:sequence>
      </xs:complexType>
   </xs:element>
   <xs:simpleType name="WhateverAnimal">
      <xs:restriction base="xs:string">
         <xs:enumeration value="bat" />
         <xs:enumeration value="cat" />
         <xs:enumeration value="rat" />
      </xs:restriction>
   </xs:simpleType>
</xs:schema>

 
 

I got the idea from this.