MacBook, defective by design banner

title:
Put the knife down and take a green herb, dude.


descrip:

One feller's views on the state of everyday computer science & its application (and now, OTHER STUFF) who isn't rich enough to shell out for www.myfreakinfirst-andlast-name.com

Using 89% of the same design the blog had in 2001.

FOR ENTERTAINMENT PURPOSES ONLY!!!
Back-up your data and, when you bike, always wear white.

As an Amazon Associate, I earn from qualifying purchases. Affiliate links in green.

x

MarkUpDown is the best Markdown editor for professionals on Windows 10.

It includes two-pane live preview, in-app uploads to imgur for image hosting, and MultiMarkdown table support.

Features you won't find anywhere else include...

You've wasted more than $15 of your time looking for a great Markdown editor.

Stop looking. MarkUpDown is the app you're looking for.

Learn more or head over to the 'Store now!

Friday, January 24, 2020

Added Disqus comments to the blog today. I imagine they do all sorts of nasty things behind the scenes with cookies and JavaScript. I apologize for that in advance -- though see below. The way I've done it, you'll only get that nastiness if you go to a single-post page by permalink.

Note also that I use the really old version of Blogger where I have my own html theme with some Blogger variables (like <$BlogItemPermalinkURL$>) sprinkled within. Let's just say that the instructions to add Disqus to Blogger are out of date for dinosaurs like me.

Here's what I added to my template. Neat plus: It's not loaded at all on my front page, and since every post is listed in its entirety there, you shouldn't get any Disqus nastiness unless you go to a specific post. That said, I've always kinda liked Disqus as a comment manager, so I hope you'll find it useful.

<!-- Disqus comments -->
<div id="disqus_thread"></div>
<script>
var disqus_config = function () {
    this.page.url = "<$BlogItemPermalinkURL$>";  // Replace PAGE_URL with your page's canonical URL variable
    this.page.identifier = "<$BlogItemNumber$>"; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};

(function () { // DON'T EDIT BELOW THIS LINE <<< MUAHAHAHAHA!!! I did anyway. Because I needed to.
    if (
        "/" !== window.location.pathname                                // on the home page
        && "" !== window.location.pathname                              // on the home page with IE < 11, _mayhbe_
        && !window.location.pathname.match(/^\/*[0-9]+\/[0-9]+\/*$/)    // archive pages
        && window.location.pathname.indexOf("search") == -1             // tag search pages
    ) {
        var d = document, s = d.createElement('script');
        s.src = 'https://myfreakinname.disqus.com/embed.js';
        s.setAttribute('data-timestamp', +new Date());
        (d.head || d.body).appendChild(s);
    }
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<!-- eo Disqus comments -->

Key lines:

this.page.url = "<$BlogItemPermalinkURL$>";  // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = "<$BlogItemNumber$>"; // Replace PAGE_IDENTIFIER with your page's unique identifier variable

I'm pretty sure those are the Blogger variables you want to use for those two properties.

And then le piece de resistance. Or whatever.

    if (
        "/" !== window.location.pathname                                // on the home page
        && "" !== window.location.pathname                              // on the home page with IE < 11, _mayhbe_
        && !window.location.pathname.match(/^\/*[0-9]+\/[0-9]+\/*$/)    // archive pages
        && window.location.pathname.indexOf("search") == -1             // tag search pages
    ) {   

By adding that check in the shudder area Disqus says not to edit, you make it so that Disqus isn't loaded on your home page (or on archive review pages like this one), which is good, because who wants Disqus on every freaking post on your home page? That'd be lots of wasted space.

Taking the Disqus UI off of posts on the home page of the blog is also good because the UI will only pop up under the first post on the page. That's because Disqus doesn't honor multiple instances of its UI on the same URL. Which leads us into Good Thing #3: Those comments on the first page would forever be for the first post on the home page, which would change from day to day. So it's an important check.

Anyhow, with that info in hand, all you dinosaur Bloggers can add Disqus invasive nastiness to your posts too and enable comments in a manner that's much more mature than all the crap Google and Google+ has tried to pull (and then pull back!) over the years.

Labels: , ,


posted by ruffin at 1/24/2020 11:53:00 AM
Saturday, January 06, 2018

This is a test. Does the preview do live updating? Yes, yes it does.

Labels: ,


posted by ruffin at 1/06/2018 05:48:00 PM
Friday, July 11, 2014

I give up.  I was going to blog about brittle code in jslint.js, but instead I think I'm inching closer to leaving Blogger after almost 13 years.  In the last few years, the changes Google's made to the composition tools have made it excruciating difficult to write and edit (compose, right) blog posts.

How can Pyra have gotten this so much "righter" a decade ago?

Here's what I sent them that their robots will enjoy reading.  I don't normally like to complain in feedback, but this is a reasonably important service for me, and they're botching the crap out of it. The usability trendline should not be a consistent cliff.

Heavens only knows what's going to happen to the ampersands in this paste.  Hopefully just using the compose window works.
Good grief folks, can we roll back to the old pyra editor?  I've put the following text into the HTML pane:

filter.first.first.id === '.' &&
filter.first.first.first.first &&
filter.first.first.first.first.string === 'Object' &&

and when I look back in the Compose pane, the &'s from the html are turned into &.  Should the code be &?  Yes.  Should the HTML display in the Compose window be & (with code of &amp;)?  Good heavens no.

Look, I appreciate the work, but between the BlogThis formatting trouble and the "quirks" in the edit page, it's getting close to time to leave blogger (I've been blogging here since 2001).  I spend more time formatting than writing.

Labels: , ,


posted by ruffin at 7/11/2014 10:16:00 AM
Wednesday, May 30, 2012

Note that nothing said here should be taken as anything other than the ramblings of a madman.

From the apparently fairly seminal doc, Applications Programming in Smalltalk-80(TM): How to use Model-View-Controller (MVC) by Steve Burbeck, Ph.D.:

In the MVC paradigm the user input, the modeling of the external world, and the visual feedback to the user are explicitly separated and handled by three types of object, each specialized for its task. The view manages the graphical and/or textual output to the portion of the bitmapped display that is allocated to its application. The controller interprets the mouse and keyboard inputs from the user, commanding the model and/or the view to change as appropriate. Finally, the model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller). [emph mine]

I think that does it.  MVC means you've got a View (what the viewer sees), the Controller (controlling what happens to a user's input) and a Model (what encapsulates the data itself).  I'm going to try to go with that.

It's like 3-tier, but with two one-way roads going from your UI to your data management tier, one for what your app is showing the user, and another one-way road designed for what to do with your user's responses to what they see in the view.

That would make Fowler's image of MVC make more sense:

local copy of image


As well as his explanation of the "missing" line between View and Controller:

Essential dependencies between model, view, and controller. (I call this essential because in fact the view and controller do link to each other directly, but developers mostly don't use this fact.)

Note that the arrows are pointing the right way. The View does ask the Model for data to display. The Model does not push to the view.

That's the first time I've seen MVC described in a way that makes sense, so I'm latching on like a bit bull, right or not.

Ah, this makes more sense. It's one-way roads from the Model's point of view, but occasionally the Controller might yell at the View to save it a trip to the Model.

Communication Within The MVC Triad
...
The Passive Model

In the simplest case, it is not necessary for a model to make any provision whatever for participation in an MVC triad. A simple WYSIWYG text editor is a good example. The central property of such an editor is that you should always see the text as it would appear on paper. So the view clearly must be informed of each change to the text so that it can update its display. Yet the model (which we will assume is an instance of String) need not take responsibility for communicating the changes to the view because these changes occur only by requests from the user. The controller can assume responsibility for notifying the view of any changes because it interprets the user's requests. It could simply notify the view that something has changed -- the view could then request the current state of the string from its model -- or the controller could specify to the view what has changed. In either case, the string model is a completely passive holder of the string data manipulated by the view and the controller. [more mfn emph]


Though note that this only works on a locked resource in the Model, like the text editor hypothetical here. You can't do passive (well) in practice without very stringent locks, which is what the next section in the doc explains -- you need to have the View listening to the Model for changes, and event handling is born. Say someone else (an object other than its own Controller) changes the string that the text editor is editing -- the View needs to be alerted. And complex listening is born.

And since we can nest Views (a window holds multiple text boxes, eg, and both the Window and each text box has a View and a Controller) and since each needs to listen in on [different?] Models and Controllers in case of change (Controller says button for "Create new text doc" is pressed; wipe the View at the Window level and start over), what we've really got is an exceptionally finely channeled encapsulation for UI design that works well within, for instance, a 3-tiered setup. I think the bottom line is that MVC gets complicated quickly with a complicated UI, but to fully flesh it out causes some slick encapsulation and very easy maintenance. Afaict, IANAL, LMNOP.



In other vents, did I mention I hate the new Blogger interface? Hate it. It's so far from WYSIWYG that a 6 year-old could do better. What's wrong with the beautiful simplicity of the current Edit Html tab that I love, and that used to pop up with BlogThis? Seriously, I have to double check my View (har) every time I freakin post from BlogThis now. I HATE THE NEW BLOGGER INTERFACE. HATE HATE HATE HATE HATE. No kidding.

Labels: , , ,


posted by ruffin at 5/30/2012 10:03:00 AM
Tuesday, April 24, 2012

My latest complaint.
When I edited the post in BlogThis, those br tags with the close slash weren't there. I like the old style Blogger html edit where you were editing HTML directly *EXCEPT* for line breaks, which were inserted for each EOL. So if I hit return, a br was inserted. That's been very hit & miss with the new interface. And if you do insert br tags automatically, which I prefer but didn't expect here, I shouldn't be able to see them later, should I? What happens now? Will more br tags be inserted when I save for each EOL? If not, why not? etc etc
I've got a number of blogs, and the spacing has been especially wonky in each of them as Blogger/Google keeps tinkering. This stinks. See how this paragraph is smushed up against the blockquote above? The preview said this wouldn't happen.
This stinks. Beta level stuff, at best. Embarrassing for something with the backing of Google. I could write a blogger editor this crappy.

Labels: ,


posted by ruffin at 4/24/2012 09:39:00 AM

<< Older | Newer >>


Support freedom
All posts can be accessed here:


Just the last year o' posts:

URLs I want to remember:
* Atari 2600 programming on your Mac
* joel on software (tip pt)
* Professional links: resume, github, paltry StackOverflow * Regular Expression Introduction (copy)
* The hex editor whose name I forget
* JSONLint to pretty-ify JSON
* Using CommonDialog in VB 6 * Free zip utils
* git repo mapped drive setup * Regex Tester
* Read the bits about the zone * Find column in sql server db by name
* Giant ASCII Textifier in Stick Figures (in Ivrit) * Quick intro to Javascript
* Don't [over-]sweat "micro-optimization" * Parsing str's in VB6
* .ToString("yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture); (src) * Break on a Lenovo T430: Fn+Alt+B
email if ya gotta, RSS if ya wanna RSS, (?_?), ยข, & ? if you're keypadless


Powered by Blogger etree.org Curmudgeon Gamer badge
The postings on this site are [usually] my own and do not necessarily reflect the views of any employer, past or present, or other entity.