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!

Thursday, December 17, 2015

I keep losing this, even though it's one of my more enjoyable StackOverflow answers. So here it is.
Take in the number. Multiply by significant digits after the decimal so that you can truncate to zero places with ~~. Divide that multiplier back out. Profit.
function truncator(numToTruncate, intDecimalPlaces) {    
    var numPower = Math.pow(10, intDecimalPlaces);
    return ~~(numToTruncate * numPower)/numPower;
}
 Though there might be a better answer just south.

Labels: , ,


posted by ruffin at 12/17/2015 03:18:00 PM
Monday, December 14, 2015

Looks like many contribute to StackOverflow so that they can get a better job (via Michael Tsai):

After finding a new job, users contribute 25% less in reputation-generating activity on Stack Overflow. By contrast, they reduce their non-reputation-generating activity by only 8% after finding a new job. These findings suggest that users contribute to Stack Overflow in part because they perceive this as a way to improve future employment prospects.

Look, I don't think that's necessarily evil or anything, but it is a shame, if true. You should, I think, feel some sort of civic responsibility to give back to the site whose collective knowledge is very likely making you more successful in your job than you could have possibly been ten years ago. I mean, honestly, how many Jon Skeet answers have taught you something insanely arcane about .NET that you never would have stumbled into yourself (eg, if you're a .NET coder, etc)?

At the same time, I can think of a few reasons why this might happen that aren't as idealistically disappointing as feeling the site boils down to a giant portfolio for most people. When you take a new job, you obviously likely move away from a codebase, maybe even an entire stack, that you're familiar with, which often moves you from a position of knowledge mastery back to one of a beginner. I like to think I can get up to speed on most codebases in 2-3 months, and that's probably true-ish, but even then you've got those rare outliers (it was QueryOver in my last major new codebase) that you might not get to for a year or more.

Anyhow, I guess there are two takehomes for me. One: Come on, folks. You take; now give. Two: I need to read the study to see if a conclusion of "they perceive this as a way to improve future employment prospects" really is warranted.

Labels:


posted by ruffin at 12/14/2015 04:02:00 PM
Monday, December 07, 2015

Enough.

From the beginning, Relay FM has been a community for podcasters, listeners and follow-uppers to share their common interests and passions. Now, with a Relay FM membership, you can directly support the hosts of your favorite shows.
Each show has three options for membership:
  • Silver: $5/month
  • Gold: $10/month
  • Annual: $100/year
Oh my goodness. I get it. Stratechery ("business forward" enough I forgive him, and you actually get serious goods for the price), Gimlet (less goods), Overcast (zero goods), Six Colors (nearly zero goods), Bielefeld (aspires to have monkbent-like goods), now Relay FM.

It's cool to hold out the bum cup now. Who knew?!! There's money to be had.

(Aside: Actually, everyone knew. You know how there are people at the highway exit that look like they're eating well and could actually do some work to pay off their REI boots? They figured out $25 an hour to sit beside the road with a two minute cardboard cutout was a pretty good gig. (Obviously not all cup-holders are bogus. I'm just saying folks figured out even begging is exploitable.) How about the tip jars at Starbucks? It's a revenue stream, guys. If you're not using it, you're losing it.)

But I'm tired of it. Telling me you'll take my money for nothing is not informative. Please at least be understated about your begging. Affiliate link? Fine. A link in your About, even the home page? Okay. But enough already acting like asking for money is interesting. It's not.

So what's Relay FM giving? Let's see...
  • Bonus episodes of every show during Relayโ€™s anniversary week in August
  • Monthly behind-the-scenes newsletter
  • 15% off anything in our merchandise store
(We plan on adding new perks as we go, and we will keep you posted on that front as soon as we have news!)

One, if you don't have your business plan in place ("new perks as we go!"), stop it. Why rush to beg for cash?

Two, I think you have fund driving all wrong. You're supposed to post completely unlistenable shows for a week or more to force us to pay to make the screeching stop, not give those that pay more shows. Interesting. That said, I've got more podcasts than I can keep up with now, thanks. (I think Under the Radar is the only Relay FM show I listen to regularly now.) You may also keep your newsletter, I believe, though I admittedly really like it when Ben Thompson screws up and makes his weekly letter free via RSS.

Three, well, I guess a 15% discount is kinda like a t-shirt. Or a sixth of one. Or something. But even if I pay for a single month, I'm not saving anything serious. ($3.75 a shirt. Guess I need to buy in bulk.)

Why not keep it simple? Give me something I like (a shirt of a podcast I like, or an app with useful features) and I'll give you a fair amount over what that shirt costs ($15-20, maybe $22). So thanks, Gruber.

You know, if we all want to complain about Arment making Overcast free, creating a race to the bottom in the podcast app category, we should also complain, I suppose, about all the free podcasts, heck, even the broadcast model in general. It'll be hard for anyone to go behind a paywall when I've got days of podcasts to catch up on as it is. Maybe the podcast peeps should start a syndicate and collude like mad.

Gosh I hope he doesn't go patronaging soon.

Labels: ,


posted by ruffin at 12/07/2015 01:48:00 PM
Saturday, December 05, 2015

In my continuing trials with customizing the heck out of a Kendo UI Grid, let's look at how to get the data that's being displayed. There doesn't seem to be a way to intercept the data (filters, maybe? Remember that I'm still new to this thing) and push it into another object, but you can grab it from the grid like this (taken from this SO answer...)

var displayedData = $("#YourGrid").data().kendoGrid.dataSource.view();

And here's a description of the different objects the grid exposes (aka, there are alternatives to `view`):

_pristineData
Store your original data. This data is used in batch update. When we click on Cancel changes button at that time Grid will take original data from here.

_data
Displayed currently applied data. If you change data in the grid then it will applied into this data.

_view
Based on your pagesize and pageindex whatever databinded to your grid. Ex: If you [bound] 100 [records] to grid but your page size is 10 then it will return only 10 records based in your page-index

Labels: , ,


posted by ruffin at 12/05/2015 06:54:00 PM
Friday, December 04, 2015

This 2-3 minute tutorial steps you through uploading data to generate a map with placemarks in the new version of Fusion Tables.

This tutorial is fantastic. Take a csv of addresses, import into Fusion Tables as an address field, and poof, you've got a map of addresses with hover-over labels from whatever other field or fields you want.

Insanely easy.

Labels: , ,


posted by ruffin at 12/04/2015 09:57:00 AM
Tuesday, December 01, 2015

Clued in after reading this...

I've got a place where I want to return entities mixed in with folders in a grid, in this case a Kendo Grid. I want to have the two "types" of data mixed in display, however, which means this isn't as clean as it could be. I've got pretty typical fields for the first query, and then I'm kinda kludging the folders into the same object model, like so...

using (AssetRepository repo = new AssetRepository(AccessControlHelper.GetCurrentUserId()))
{
    var assets = repo.GetAllAssets().Select(a => new {
        id = "a" + a.AssetId,
        clientId = a.ClientId,
        name = a.AssetName,
        tags = a.Tags,
        folderId = a.AssetFolderId,
        thumbnail = "/AssetManager/ImageThumbnail/" + a.AssetId
    });

    var folders = repo.GetAssetFoldersForParentFolderId(null).Select(f => new
    {
        id = "f" + f.AssetFolderId,
        clientId = f.ClientId,
        name = f.FolderName,
        tags = "",
        folderId = f.ParentFolderId,
        thumbnail = ""
    });
    var both = assets.Union(folders);   // <<< NEAT-O, DADDY-O!

    return Json(assets);
}

I'm not absolutely sure how I feel about this as a production-worthy strategy... It's obviously taking a dog and making it quack like a duck, which is tres hipster. The problem is that Kendo Grid allows you to have hierarchies, but expects everything on the same hierarchical level to be of the same object type. (My vote is to write a custom table renderer that'd support the concept of folder levels mixed in with entities, but that's understandably not the route this contract is taking. Still, it's so often just as difficult to get a third-party library to work as you need it as it'd be to make your own widget that exactly covers your own use cases.)

Regardless, what's neat to me is that the compiler's smart enough to know these are the same anonymous types and allows you to Union them. That's cool.

(apologies for the Yoda'd blog title. SEO BABY! /sarcasmTinge)

Labels: , , ,


posted by ruffin at 12/01/2015 05:11:00 PM

<< 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.