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

Wednesday, December 31, 2014

From Learn VImscript the hard way

:set hlsearch incsearch
hlsearch tells Vim to highlight all matches in a file when you perform a search, and incsearch tells Vim to highlight the next match while you're still typing out your search pattern.

Yes, please. Mucho gusto.

Sometimes it surprises me how much of VIm I don't [know to] use, but still believe VIm's my best text editing option. Though, honestly, I think we could argue those two options should be on by default at this point.

This post brought to you by my forgetting again that you have to escape the plus sign to use it in a regexp in VIm.

/sigh

Labels: ,


posted by ruffin at 12/31/2014 03:05:00 PM
0 comments

Had some trouble viewing executables (listed in a dark blue) in my PuTTY sessions after calling ye olde "list Alf" (ls -alF) because of the black background, and did some hunting. The first link, below, had one alternative, but it was the comment below that really hit the goldmine.

Site: http://arcanesanctum.net/2012/11/17/a-better-terminal-color-theme-for-putty/
Comment: http://arcanesanctum.net/2012/11/17/a-better-terminal-color-theme-for-putty/#comment-42807

The site linked from the comment was in Russian, but colors know no language (or something linke that). And Google translated what was there, which wasn't too earth-shattering.

Anyhow, those are some nice themes:
http://putty.org.ru/themes/index.html

I ended up going with Desert, at least for now, as it's something completely different. Actually, the background is just a lightened up black (from pitch in the default to a very dark grey) and the standard text is still white (perhaps even brighter than stock), but executables are now bright green, and extremely easy to read. ;^)

http://putty.org.ru/themes/desert.html

Edit 20161107: And just in case that site goes down, here are the values:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Desert]
"Colour0"="255,255,255"
"Colour1"="255,215,0"
"Colour2"="51,51,51"
"Colour3"="51,51,51"
"Colour4"="0,255,0"
"Colour5"="255,255,255"
"Colour6"="77,77,77"
"Colour7"="85,85,85"
"Colour8"="255,43,43"
"Colour9"="255,85,85"
"Colour10"="152,251,152"
"Colour11"="85,255,85"
"Colour12"="240,230,140"
"Colour13"="255,255,85"
"Colour14"="205,133,63"
"Colour15"="135,206,255"
"Colour16"="255,222,173"
"Colour17"="255,85,255"
"Colour18"="255,160,160"
"Colour19"="255,215,0"
"Colour20"="245,222,179"
"Colour21"="255,255,255"

You put all of that information into a .reg file, double-click, accept the warning, and you have a Session type in PuTTY for "Desert".

putty desert session listed

So note that you'll have to push over any info you want there. That is, this is a new session with only the colors set. Everything else is blank/new.

Or, if you want to be brave and change an existing session, you change the last value in the first line. That is, from ...Desert to...

[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Default%20Settings]

Now your defaults are Desert. That's a little more adventurous, but I just tried it, and my Default Settings have that beautiful theme's values now. Thank heavens.

Neat!

Labels: ,


posted by ruffin at 12/31/2014 10:07:00 AM
0 comments
Tuesday, December 30, 2014

Somebody replied to ​a comment I made back in 2012, and I came back for a look. Forty-three upticks! Who knew? Probably my most up-something-ed contribution to StackOverflow, and, since they weren't upvotes that fire off a notification, I had no idea.

Quick rant: I do hate when people copy answers and comments exactly, however -- see the guy from this year saying essentially the same thing I did in his comment tacked onto the question itself. I mean, it's not a lost rep thing in this case, so I can't really complain, but when that happens with answers (not just my own), it drives me crazy. I think my flags are both for folks that are rep farming by copying [much] earlier answers.

Anyhow, glad to know I've helped 43+ people squish their git commits. That's kinda neat. ;^)

Labels: ,


posted by ruffin at 12/30/2014 03:30:00 PM
0 comments
Monday, December 29, 2014

​That's a lot of Power in this post's title.

Just so that I'll remember when setting up another box, it looks like you only need to include VMware.VimAutomation.Core in Snapins/Modules (File >>> PowerShell Libraries) to run PowerCLI commands in PowerGUI.

And that ends today's episode of "Notes to my Future Self."

Labels:


posted by ruffin at 12/29/2014 12:47:00 PM
0 comments
Wednesday, December 24, 2014

Why do folks come in to work on Christmas Eve if they're sick? I mean, I get it, but if there ever was a time you could duck out a little early, well... Three hours of slack production from you isn't worth killing our breaks (and workdays) by sharing the cold, you know? Leave. It's okay. Go. No, really. Go. Now. /{shoo-shoo motions} Thanks.

/rant ;^)


posted by ruffin at 12/24/2014 11:38:00 AM
0 comments

Somewhat painfully, Xamarin wouldn't connect to a POP3 server when I broke out some out email client code. After some trial and error, this appears to be because I didn't have the write certificates, which was fixed by using...

mozroots --import --ask-remove

That, I believe, imports everything that Mozilla would typically have handy. More here.

Easy enough fix, but how do I do the same for my clients if I push out an app? Sounds like I've got some extra overhead in front of me, and that I've made it much more difficult to handle thanks to my having run mozroots now.

Labels: ,


posted by ruffin at 12/24/2014 08:09:00 AM
0 comments
Saturday, December 20, 2014

I only "sit" on the JSLint tag at StackOverflow, and knew they were starting a Japanese site. I'm not sure everyone sitting on a tag on SO.com should be getting alerts like these...


I know the error, but it's hard to wade into the comments of conversation in the answer. And I'm not sure answering in English is helping anyone.

I'm not sure how I feel about the different language SO sites -- I do know, as a coder at heart, I wish there was a single language we could all use so that we didn't have to worry about staying DRY.  esperanto.stackoverflow.com?

Labels: ,


posted by ruffin at 12/20/2014 11:15:00 AM
0 comments
Friday, December 19, 2014

You remember how neat it was when you learned you could serialize .NET DataTables to xml files? Well, I do. Now you could create simplest-case tests for your controller logic against "real" data about as complex as you wanted, but without having to worry about your database's shifting state -- or even having a database installed on a workstation. Now you could send a limited set of clean data to a contractor and *know* (essentially) that what you got back was going to be pretty much plug and play. It was wonderful.

Well, TIL... You can do just as cool (probably cooler) a set of stuff with Powershell.

From often Googled "Hey, Scripting Guy!"

If I need to shut down Windows PowerShell or to reboot my computer, how can I continue to access the same process objects? I use the Export-Clixml cmdlet.
..
The command itself is simplicity and elegance personified. To obtain all the process information, I use the Get-Process cmdlet (gps is an alias), and I pipe the results to the Export-Clixml cmdlet. I provide the Export-Clixml cmdlet with a path to store the resultant XML file. This command is shown here:

gps | Export-Clixml c:\fso\gps.xml

The resultant XML file is an actual XML file and is therefore viewable in an XML viewer...

To import the XML for use on my computer, I use the Import-CliXML cmdlet. It only needs the path to the XML file. I can store the resultant process objects in a variable for ease of processing.

Man, that's easy.

$myObject | Export-CliXML MyObject.xml

... years later ;^) ...

$myObject = Import-CliXML MyObject.xml

You lose some functions, etc, if your object had them, but hello, quick state restore. Beautiful.

Labels: ,


posted by ruffin at 12/19/2014 02:24:00 PM
0 comments

From the Mule Design blog:
http://muledesign.com/2014/10/things-you-need-to-do-before-hiring-a-designer/

"Remember that nice young designer who worked at a big company — the one who wasn't invited to strategy meetings? By the time work got to him, the decisions were set down to the smallest details and all he did was execute. He wasn't designing. He was executing on someone else's design."

The company doesn't have to be big.​

I do like that the very next thing in the post is an admission that this designer needs to be more assertive, but assertive isn't always the best career move if you're not confident enough to move on after encountering deaf ears, so I usually understand when new hires don't rock the boat -- for a while. But the Mule blog is right -- you should move on if you're not allowed to do your job. And if you know of someone who isn't being allowed to work, you as a coworker should feel responsible for helping make the space for them to do it. Be active. Culture change starts with you, etc etc. And if it doesn't or can't, *you're* in the wrong spot too.

Anyhow, sidelined there. Designers do get dumped on. Researching what the customer says they want, even coming up with general concepts that could become great features, doesn't make you a designer.

Labels:


posted by ruffin at 12/19/2014 12:12:00 PM
0 comments
Thursday, December 18, 2014

Well, for some reason I'm unable to post a comment to the blog entry here:

http://blogs.vmware.com/PowerCLI/2011/09/list-and-disconnect-vcenter-sessions.html

... though it was still accepting comments, well, heck, three days ago. Must be work's network rules (though the error is coming from their server, so who knows??).

Anyhow, just for the sake of posterity, here's what I *would've* said about that not-quite-finished script...

<blockquote>$SessionMgr = Get-View $DefaultViserver.ExtensionData.Client.ServiceContent.SessionManager</blockquote>

This isn't great, as if your connection has dropped but $DefaultViserver hasn't cleared out, it'll throw an error. Or, probably more likely, if <q>$DefaultViserver -eq $null</q> because you <i>did</i> bother disconnecting, you'll get, "The property 'ExtensionData' cannot be found on this object. Verify that the property exists," from the same line.

So there's certainly an assumption in this function that you have an active connection when this function is called. Since we're implicitly encouraging folks not to leave connections open, that's not always even the preferred case.

Probably easy enough to handle with <q>$DefaultViserver -eq $null</q> and a throw-catch, as those are possibilities I'd expect this sort of function to catch. Right? ;^)

Labels:


posted by ruffin at 12/18/2014 09:19:00 AM
0 comments
Saturday, December 13, 2014

Joe's Blog:

I can’t help but think of something I said to my brother a few years ago: If you don’t own a piece of the company you work for, you’re always getting screwed. It doesn’t matter if you’re a senior VP making 30 Million a year. You’re still getting a sucker’s share of the overall take.

"Screwed" is too harsh. If you don't think you're getting a fair wage for your work, find a better job.

But do remember that even with every fair exchange, both sides should think the other side is getting the short end of the stick. That's why trade occurs, you know? You think it's worth more than $2.50 a gallon to go 30 miles, and the gas station believes it's worth less. If it was the other way around, you'd never buy gas.

But there's an inherent inefficiency in each trade, and that's what Joe is speaking to. If you were sitting in the trader's seat, you'd be getting your gas at wholesale prices. That's a nicer place to sit.

Labels: ,


posted by ruffin at 12/13/2014 08:50:00 PM
0 comments


What’s the issue with too much funding? Here are four key drawbacks:  
Pitfall 1: Solving every problem with non-scalable hacks

Shocking.  ;^)  I wonder if that's causal, though. It could be a start-up mentality (We've got to build features ASAP!) moreso than being flush with cash.

But then I suppose the point is that having too much cash from funding enables you to turn ye olde blind eye to hemorrhaging cash for overhead, kinda like when Sepia Labs over-funded Glassboard. Which makes you also wonder -- what does it mean when your start-up finally gets smart about overhead costs? What's driving the "maturity"? ;^)

Labels: ,


posted by ruffin at 12/13/2014 08:46:00 PM
0 comments
Friday, December 12, 2014

Sometimes, as Don Jones alludes to in this thread, Powershell gets a little too clever in its attempts to "coerce" variables. In this case, it's the battle between ValueFromPipelineByPropertyName and ValueFromPipeline on a (string?) parameter.

I think the quick upshot is that, if you want what's promised by ValueFromPipelineByPropertyName, you need to roll it on your own.

See this, from said Don Jones:

Another option is to add an -InputObject parameter that accepts, ByValue, the exact object type being output by your first cmdlet. That way, it should bind without coercion. You'd KNOW you were getting that whole object, so you could grab the appropriate property internally. Make that part of a separate parameter set so that folks can do one or the other, but not both.

This is essentially how a lot of built-in cmdlets, like Stop-Service and Stop-Process, work.

Interesting discussion at that thread over whether the coercion is a bug (apparently not) and if that intended behavior is a good idea (not necessarily).

Labels:


posted by ruffin at 12/12/2014 09:17:00 AM
0 comments
Wednesday, December 10, 2014


Just a quick blog-by to say I'm pretty disappointed with SourceForge's closed source installer, used by FileZilla, that at least tries to put adware, etc on your box. I hate these things, first because once you start putting adware (I'm looking at you, Oracle's Java installer) I can't tell how much trust I should lose. What else are you trying/actually installing? And second, in my case (see image), I couldn't run what was supposed to be an offline installer b/c it couldn't pick up SourceForge's ad-of-the-day feed.

ARGH.  I thought online disk space was getting cheaper. Is SourceForge really still growing so fast it needs not just misleading ads on its download pages, but trust-compromising installers as well?

Anyhow, at Jotti, two hits from the FileZilla server installer:

2014-12-10 PUA.Spyware.XPCSpyPro​
2014-12-10 Win32/InstallCore.TM potentially unwanted



Not sure how bad that is, but I'm looking for another installer at this point.

Labels: , ,


posted by ruffin at 12/10/2014 09:04:00 AM
0 comments
Wednesday, December 03, 2014

Blogger is going to mangle whitespace again, but here goes... Yes, you can set up multiple Tags in Pester Describe blocks by passing arrays.
I should probably submit a pull for the Pester Wiki, just for fun (though not with this incredibly helpful code snippet. That'd be overkill).
By the way, am I the only person who sees a line like `Passed: 3 Failed: 0 Skipped: 0 Pending: 0` and often scans too quickly, seeing `3 Failed`? Wonder if `Passed: 3 - Failed: 0 - Skipped: 0 - Pending: 0` would be better. Otherwise, I'm liking 1.) Pester far too much, 2.) the time to write my PowerShell code with tests. Too many bugs found now that I'm doing TDD (okay, admittedly, here that's probably "Test Driven Debugging"), which is both good and depressing. ;^)

Describe -Tag "spam","ham" "testMe" {
    It "spam and ham" {
        $true | Should Be $true;
    }
}
Describe -Tag "spam" "testMe" {
    It "spam only" {
        $true | Should Be $true;
    }
}
Describe -Tag "ham" "testMe" {
    It "ham only" {
        $true | Should Be $true;
    }
}
------------------------------
PS> Invoke-Pester
Executing all tests in 'C:\something'
Describing testMe
[+] spam and ham 93ms
Describing testMe
[+] spam only 90ms
Describing testMe
[+] ham only 65ms

Tests completed in 249ms
Passed: 3 Failed: 0 Skipped: 0 Pending: 0

PS> Invoke-Pester -Tag "ham"
Executing all tests in 'C:\something'
Describing testMe
[+] spam and ham 137ms
Describing testMe
[+] ham only 66ms

Tests completed in 203ms
Passed: 2 Failed: 0 Skipped: 0 Pending: 0

PS> Invoke-Pester -Tag "spam"
Executing all tests in 'C:\something'
Describing testMe
[+] spam and ham 71ms
Describing testMe
[+] spam only 61ms

Tests completed in 132ms
Passed: 2 Failed: 0 Skipped: 0 Pending: 0

Labels:


posted by ruffin at 12/03/2014 09:21:00 AM
0 comments
Monday, December 01, 2014

Pretty good answer from SO):
======================================
function A {    
    Param([scriptblock]$functionToCall)    
    Write-Host "I'm calling $($functionToCall.Invoke(4))"
}

function B($x) {
    Write-Output "Function B with $x"
}

function C {
    Param($x)
    write-Output "Function C with $x"
}

PS> A -functionToCall $function:B
I'm calling Function B with 4

Labels: ,


posted by ruffin at 12/01/2014 12:04:00 PM
0 comments

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.