just one more geek in a sea of austin techies

April 21, 2018

Quick line count via Windows command line #DevGeek

Every so often I need to get a quick line count estimate across a collection of files. Line counts are helpful in broadly defining the scope of reviewing or updating existing code files.  In such cases I only need a ballpark estimate of total lines of code across multiple files.  It turns out that all we need is the Windows command prompt and a one-line command:

At first glance this solution isn't overly intuitive but it's actually quite simple.  The TYPE command parses each line in the specified file and pipes each line through the FIND command which searches for string values matching the specified string.

In this case, we extend the TYPE command's usefulness from parsing just one file to parsing collections of files by using a wildcard search for all files ending with ".log".

For the FIND command, we use the "/V" switch to invert behavior and have the command look for lines that *don't* have the specified string.  We use the "/C" switch to tell FIND to give us a count of matched (unmatched in this case) lines instead of the content of the lines.  Finally we specify any string value we can reasonably expect to *not* exist in our searched files.  I used "zzxxccvvbbnnmm" in my example.

Here's the result of the command on a directory where I placed two sample log files:

See?  Quick and simple as long as you can remember the "/V" and "/C" switches.

Counting lines of files across multiple file types
What if we need to count lines between files of differing file types?  For instance, if I'm counting lines in both ".log" files as well as ".xml" files?  Easy: just specify the additional file search as part of the TYPE portion of the command:

For your copy-and-paste convenience, here's some copy-ready text:

  TYPE c:\temp\*.log | FIND /V /C "zzxxccvvbbnnmm"


March 27, 2018

JBL Everest firmware update #SoundGeek

Owners of JBL's good-but-flawed Everest headphones have long-complained of the processing lag that prevents sound from being in synch with video when pairing with a TV or watching videos on a mobile device.  JBL previously addressed this with a firmware update (yea!) but then, without explanation, removed the update from various product support pages (boo!)

If you have "normal" (i.e., not "Elite") Everest 100, Everest 300, or Everest 700 headphones and have sound lagging behind video then you're in luck:  I have located the elusive firmware update over on JBL's Japanese site.  The site isn't in English but the firmware package itself is and includes English instructions.

Here's the link to the firmware: 
(updated link March, 2021 - thanks commenter rteng!)

 For a Google-translated-into-English version of the web page, click here.

I was able to upgrade a set of Everest 300 headphones from firmware v1.1 to v3.1 with no issues (via USB connection to a Windows 7 PC). The update fixed the audio lag issue for me but your mileage may vary.


February 14, 2018

Facebook's crippled "fake news" feature #SocialMediaGeek

This week Wired ran a very interesting story peeking behind the curtain of Facebook and Mark Zuckerberg.  The story tracks the past two years' turmoil of Facebook being increasingly leveraged as a tool to deliver intentionally-divisive content and how Russian agents garnered hundreds of millions of likes and shares for fake articles by simply using Facebook's standard advertising features.

One of Facebook's responses has been to partner with a number of fact-checking entities and provide users with a feature to flag Facebook posts as "fake news". The more times a post is flagged as "fake news", the more likely it will get reviewed by a fact-checking partner.

Unfortunately, the "report fake news" feature is a lot less useful than you might think.  Read on to see why...

January 23, 2018

Agents of S.H.I.E.L.D. tech #GearGeek

When I recognize an off-the-shelf electronic item in TV or film, I like to verify I'm seeing what I think I'm seeing. When I happen to be able to ID an item I feel like I've somehow validated myself in some small way though I know, in reality, it's all just more useless geeky knowledge crowding my brain.

Why keep that useless knowledge to myself?  Read on to crowd your own brain with some useless tech trivia...

January 12, 2018

WAVE Web Tool results vary by browser #WebDevGeek

One-line summary:  The WAVE tool from WebAIM is inconsistent across different web browsers.

My website work often depends on ensuring web accessibility requirements are met.  These were typically referred to as "508 requirements" but the US government has finally moved on from the old 508 rules and has now embraced the newer WCAG specifications.  Specifically, if you're earning money from the US government to provide any kind of web content, as of 1/18/2018 you're required to meet WCAG 2.0 "AA" web accessibility standards.

Recently I found an issue with one tool, WAVE, which is widely used by some federal government entities to scan websites for accessibility issues...