Posts
1129
Comments
885
Trackbacks
1
Thursday, September 22, 2016
Rhetorical Question about God-Awful Radio Ads

Have there ever been as consistently awful radio ads as the ones by ESPN for Heisman House?

I think not.

posted @ Thursday, September 22, 2016 10:20 AM | Feedback (0)
Sunday, September 18, 2016
HP Elite X3 – Very Brief Review

I had ordered one from the Microsoft Store but when I saw that HP had them in stock, I cancelled the first order and made a second.  Apparently, I was one of the few to get one before they went out of stock, and got it right before a long weekend trip, and have had it for a week now.

I like it, quite a bit.  It isn’t perfect, but it’s definitely something I can see using as my primary driver unless/until the mythical Surface Phone is ever released.

The build reminds me of my old Lumia 1520, and the build quality is high.  I like the massive battery life again.  I always had to worry with the 950 and 950 XL of topping it off at some point during the day, but don’t have to worry so much with this one.

I don’t like the lack of a dedicated camera button,  it’s annoying to have to launch it from the live screen.   The screen quality is better than the Lumias indoors, though the Lumias really shine (so to speak) outdoors.

The fingerprint reader seems to work really well (I’m running Windows 10 Anniversary Mobile from Insider Preview, since it hasn’t been officially released yet for it) and the camera picture quality seems decent enough.

There’s still the app gap.  I need my Android Blu phone  (which I use for media, and not as a phone, though it is Go ready) for Xfinity, Amazon Video and SiriusXM on a daily basis, and a couple of other things.  It would be nice to have just one device in that form factor.  But to be honest, I don’t mind having, e.g., my Groove music collection on multiple devices, and having the ability to switch between devices for various reasons.

Overall, I like it.  Once the Asus ZenScreen comes out, I’ll really try out the Continuum features in earnest.

posted @ Sunday, September 18, 2016 8:30 PM | Feedback (0)
Thursday, August 25, 2016
About Stereotypes: Compare and Contrast

Compare this point of view, with this point of view.

There are deep lessons in there.

posted @ Thursday, August 25, 2016 9:52 AM | Feedback (0)
Wednesday, August 24, 2016
Stress Management for Snowflakes

If you feel guilt at your list of unwatched shows on your DVR, this is for you.

posted @ Wednesday, August 24, 2016 10:03 AM | Feedback (0)
Tuesday, August 23, 2016
Asp.NET Core + IIS + PEBKAC = WTF, Asp.NET Core + IIS – PEBKAC = Success

Thankfully, the issue, as it usually is, was with me.

At some point, the publishOptions section of project.json switched from having an exclude section and put in an include section instead (which makes sense enough).

Turns out if you don’t include, you know, all your content and views and whatnot, IIS doesn’t have anything to serve up.

BTW, logging helps.  Duh.

Once I figured out that it was serving static content (which a helpful doc tells you to do, which requires that you read the helpful doc), it became easy to track down.

It does publish an .exe instead of a .dll, and I haven’t figured out how to publish without manual steps yet, but that tooling is supposedly coming soon, and should be workable in the interim.

Whew.

posted @ Tuesday, August 23, 2016 4:08 PM | Feedback (0)
Saturday, August 20, 2016
Asp.NET Core + net461+ IIS = WTF

So, I have my nice port/re-write of an older MVC app to the new Asp.NET Core, which depends on some parts still written in net461 and so is configured for that, and I’ve reached the point I’ve ‘dreaded’ for quite some time.

I want to host this up in EC2, like a real app, which, of course, runs IIS.

The obvious question is:  how the hell do you do that?

I’ve read many things, and still, no work-y, as they all seem to depend on ‘pure’ Asp.NET core to work.  I can look in my stdout log location and see clearly:

Now listening on: http://localhost:25458
Application started. Press Ctrl+C to shut down.

And IIS is, maybe, fronting this.  Who the hell knows.  It doesn’t actually produce any output.  View source is blank.  Since it took a while to get it to not throw a 500 error, I actually do know it was/is fronting it (it wasn’t publishing the config.json and in the back, the kestrel piece of s^&t was complaining about it).

Of course, I can run it in Visual Studio under IIS Express.  Which is, of course, useless.  I want to be able to use https, real https, across the board.  I want to surf to the site under development from various mobile devices as I develop, real mobile devices, not emulators, so I can see how things will look in the real world.  I want to have some confidence that I will be able to deploy it to EC2 successfully.

You have a decade or two investment in IIS, you’d think you’d want this to work and make it a focus, not just “well, we’ll get it to work eventually, but look, you can develop on a MacBook!”  You’d think.

posted @ Saturday, August 20, 2016 1:55 PM | Feedback (0)
Monday, August 08, 2016
I probably could have written this code better

Long-ish project converting an app of mine from Asp.Net 3/4 to Asp.Net Core (half conversion, half rewrite kind of thing) and came across this gem:


public class AttemptToChangePasswordResult
{
    public bool Succeeded { get; set; }
}

At least it is fairly clear.

posted @ Monday, August 08, 2016 7:15 PM | Feedback (0)
Tuesday, August 02, 2016
MSDN Subscription People Finally Deliver

In a follow up to this, it took a while, but they finally updated my subscription end date to reflect the period of time that I didn’t have access.  Well, most of it, I think it was technically a few weeks short but fairly close anyway.

posted @ Tuesday, August 02, 2016 4:17 AM | Feedback (0)
New Trick for Old Dogs: Count number of files in directory from command prompt

DIR /A | FIND "File(s)"

posted @ Tuesday, August 02, 2016 4:13 AM | Feedback (0)
Wednesday, July 27, 2016
Fixing ImageLink code that Asp.NET Core broke

This code, prior to Asp.NET Core, worked to create an image link:

public static HtmlString ImageLink(this HtmlHelper htmlHelper, string imgSrc, string alt, string actionName, string controllerName, object routeValues, object htmlAttributes, object imgHtmlAttributes)
       {
           UrlHelper urlHelper = ((Controller)htmlHelper.ViewContext.Controller).Url;
           TagBuilder imgTag = new TagBuilder("img");
           imgTag.MergeAttribute("src", imgSrc);
           imgTag.MergeAttribute("alt", alt);
           imgTag.MergeAttributes((new RouteValueDictionary(imgHtmlAttributes)), true);
           string url = urlHelper.Action(actionName, controllerName, routeValues);

           TagBuilder imglink = new TagBuilder("a");
           imglink.MergeAttribute("href", url);
           imglink.InnerHtml = imgTag.ToString(TagRenderMode.SelfClosing);
           imglink.MergeAttributes((IDictionary<string, string>)htmlAttributes, true);

           return new HtmlString(imglink.ToString());
       }

 

It’s usage was:

@Html.ImageLink(Url.Content("~/content/images/product/4/" + Model.Image), Model.Name, “Detail”, “Product”, new { id = Model.ID }, null, null)

Now, given that Asp.NET Core is a huge re-write, one should expect the APIs to change.  What one might not expect is that:

imgTag.ToString()

Would return the fully qualified class name, as opposed to, you know, the string representation of the content of the TagBuilder.

Why did they choose to do something this stupid (and it was a choice, this is explicitly by design)?  Who knows?  After a long day dealing with deliberately obstinate people, I don’t care.

This fixes it:

public static HtmlString ImageLink(this IHtmlHelper htmlHelper, string imgSrc, string alt, string actionName, string controllerName, object routeValues, object htmlAttributes, object imgHtmlAttributes)
        {
            ActionContext ac = new ActionContext(htmlHelper.ViewContext.HttpContext, htmlHelper.ViewContext.RouteData, htmlHelper.ViewContext.ActionDescriptor);
            UrlHelper urlHelper = new UrlHelper(ac);
            TagBuilder imgTag = new TagBuilder("img");
            imgTag.TagRenderMode = TagRenderMode.SelfClosing;
            imgTag.MergeAttribute("src", imgSrc);
            imgTag.MergeAttribute("alt", alt);
            imgTag.MergeAttributes((new RouteValueDictionary(imgHtmlAttributes)), true);
            string url = urlHelper.Action(actionName, controllerName, routeValues);

            TagBuilder imglink = new TagBuilder("a");
            imglink.MergeAttribute("href", url);
            imglink.InnerHtml.Append(GetString(imgTag));
            imglink.MergeAttributes((IDictionary<string, string>)htmlAttributes, true);

            var imgLinkDecoded = System.Web.HttpUtility.HtmlDecode(GetString(imglink));

            return result = new HtmlString(imgLinkDecoded);        }

        public static string GetString(IHtmlContent content)
        {
            var writer = new System.IO.StringWriter();
            content.WriteTo(writer, HtmlEncoder.Default);
            return writer.ToString();
        }

Note the brilliant code that requires you to decode a string that was HtmlEncoded (since you cannot WriteTo() something that doesn’t HtmlEncode it).

Brilliant.

posted @ Wednesday, July 27, 2016 9:41 PM | Feedback (0)