configSource only works on sections, not sectionGroups

I have an app.config with some custom sectionGroups:

<configSections>
	<sectionGroup name="MyApp">
		<section name="foo" type="System.Configuration.NameValueSectionHandler, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
	</sectionGroup>
</configSections>
<myApp>
	<foo>
		<add key="MySetting" value="14"></add>
	</foo>
</myApp>

I wanted to externalize that:
<MyApp configSource="myapp.config">

This yields an error:

System.Configuration.ConfigurationErrorsException: The attribute 'configSource' cannot be specified because its name starts with the reserved prefix 'config' or 'lock'.

Long story short: configSource only works on <section> elements, not on <sectionGroup>.

Self-driving cars, Uber, and the public transportation revolution

Everyone expects self-driving cars to be the next world-changing revolution, and it is easy to see why. Image recognition has made insane improvements in the last decade – Facebook’s face detection is sometimes uncanny in its ability to differentiate people from objects. Google Maps routing features have improved leaps and bounds since the first release, and with cellphone connectivity becoming more and more ubiquous, it’s feasible to monitor traffic in real time.

We have electric cars that aren’t complete crap anymore. Hybrids like the Prius have been pretty normal for years now, and both BMWs i3 and eventually Tesla’s Model 3 are fully electric cars set to break the price barrier, making them more than a gimmick for the hipster crowd.

These cars don’t have to be electric, but it will be an important factor in the actual revolution. I grew up in Europe, lived in Paris, France for a few years. I’ve seen what public transportation can do – buses, trains, subways – to reduce the need for a car. In the US, public transportation is mostly shit, except in some cities (never been to New York, but Los Angeles has somewhat functional public transport).

Self-driving cars will be the public transportation revolution that America needed, the biggest push since building the train system in the 1800s. Right now, car ownership is the norm for people in America. A lot of families own a car per adult family member. The belief is that those families will buy self-driving cars in the same manner, essentially keeping the car market as-is and just remove the need to personally drive.

I think that people aren’t going to buy as many cars in the long run. Self-driving cars are essentially like trains, except that their “tracks” are ubiquous. Companies like Uber (or maybe Lyft or maybe some new company that hasn’t been founded yet) will go after Amtrack and similar companies with the same force as they are going after the taxi business.

Why own your own car if you can just call one? Right now, even the cheap Uber option costs enough money to not be a serious primary means of transportation for most people. But imagine if Uber no longer has to pay the driver of the car. At that point, they basically pay for repairs, fuel, and insurance, plus their profit margin. Instead of being a company that subcontracts thousands of drivers, they would be a company that buys tens of thousands of self-driving cars.

This is where the fact that they are electric cars is important – apart from having charging stations all over the place, we should look at upgrading busy streets to help charging the cars. Solar Roadways is an early attempt at converting streets into huge solar panels, and if someone comes up with a way to charge a car from the street (metal contact plates in the tires?), the range of electric cars could increase a lot. And since it’s solar power, there is potential to really bring the prices down after the initial investment.

Of course, there is a lot of Utopia in this – Electric Self-Driving Cars, charged in part with free, unlimited energy through Solar Roadways, available for hire at a price that makes car ownership a status symbol instead of a neccessity.

Undoubtly, lobbying will be severe, from car makers in Detroit to unions of drivers that are facing unemployment, People will claim that owning a car is owning the freedom to go wherever, whenever, and that a gas guzzling V8 truck is patriotic.

But in the end, I see the end of car ownership for millions of people. The “freedom” argument won’t hold much once you can call a car to be with you in five minutes, at any time of the night. Self-Driving Cars don’t need to sleep, they don’t fear driving into shady areas and they won’t complain if you need a fifty mile ride at 3 a.m. Especially not if it will be significantly cheaper than owning one. We might even seen more carpooling since an intelligent routing system can just pick up a bunch of people on the way.

This will happen in my lifetime.

Being financially honest

A lot of us know that feeling: We work hard, we make a salary that should be plenty, but somehow the balance on our savings never get really high. Or you’re interested in buying a home and need to save up at least 3.5% for an FHA loan, plus the money you need to move and install a secret door.

I’ve never done any budgeting, and the amount of financial planning I did was mostly “Make sure the checking account has always enough balance for the next rent, and that the credit card never exceeds what I can pay back at the end of the month”. After all, finance is booooooring. For me, there was an extra difficulty as I’m an immigrant to the USA and just didn’t know much about money in this country. The 2008 crash didn’t help spark my interest either (my #1 priority: Make sure the money is FDIC insured).

Boy, if I could go back to when I first arrived here and I could only tell my past self one thing, then it’s to be a bit more financially honest and save money. Oh, and pick up a copy of Get a Financial Life, it’s an awesome, not dry overview of the stuff that matters. And for god’s sake, don’t wait four years to setup a 401(k).

For the past few months, I’ve been using You Need A Budget (YNAB) to get an overview about where my money goes. They have a Four-Rule-Methodology, which is useful if you need to control your spending and want to make a household budget, but I’ve been using it as a reporting tool to get a feel for it. The general idea is that you add your accounts (Checkings, Savings, Credit Cards, Loans, …) and assign each transaction a category of your choice.

This takes a few hours when you’re just starting out – most banks and credit cards should offer a Quicken (.qfx) or CSV Export, which you can mass-import into YNAB. You’ll be creating and tweaking categories (e.g., I have categories based on different hobbies) and assign all your transactions to it. I recommend starting small, with just the info from last month and then adding more and more to it if you want. The more data you have, the better reporting is, but the longer it takes to setup.

Once your transactions are in and categorized, you can report on it. This is where we’re getting serious because now you’re really seeing how much all these little $4.99 purchases add up to.

Clicking on a category allows you to dig in or see which transactions are part of this.

This is pretty eye-opening, but if you need some more motivation there is a handy Income v. Expense report. If you manage to have an entire year of transactions, this report can be pretty disturbing – it’s an honest, no-BS assessment of your financial discipline.

YNAB also supports Debt-Accounts, like Credit Cards or Loans, and a Net Worth graph.

I’m not going much into the Budgeting features of YNAB – it’s arguably the feature it advertises the most, but it’s also the thing that takes effort. If you don’t have anything right now, then just going in and using it for reporting will be a huge eye-opener already.

When it comes to money, it is important to be honest to yourself – it’s okay to spend thousands of dollars on your hobby, as long as you know that’s where the money goes and don’t end up at the end of the year looking at a zero-sum game and an emergency fund that is still empty.

OS X Screen Recording and Converting to GIFs with free tools

One of the unknown features of newer versions of QuickTime (at least on OS X) is the ability to record videos (Arguably, QuickTime Player is misleading as a name), either from a connected camera or from the screen. Click File > New Screen Recording to bring up the recorder. If you want, select “Show Mouse Clicks in Recording”.

After you’re done recording, you can do some trimming right in QuickTime as well – Edit > Trim.
Now you have a QuickTime file – great, but the point is to create an animated GIF from it. For that, we’ll use two free tools: ffmpeg and gifsicle. Since we’re on OS X, homebrew will do the heavy lifting for us.

brew install ffmpeg
brew install gifsicle

With both installed, we can now convert the video:
ffmpeg -i MyRecording.mov -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > MyRecording.gif
Since I want to do this often, I’ve added a shell command to my .zshrc:

function movtogif {  if [[ $# = 0 ]]
  then 
    echo "USAGE: movtogif filename.mov"
  else 
    ffmpeg -i bash -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > bash:r.gif 
  fi 
}

For reference, the :r means to take the file path without extension. See the manpages of ffmpeg and gifsicle for more information about the parameters.

Thanks to Alex Dergachev for the original idea.

Using Joe’s Own Editor for writing

George R.R. Martin went on record saying he still uses Wordstar 4.0 on an old DOS Machine to write his epic 1000 page A Song of Ice and Fire novels. This seems to baffle some people – after all, the only people that don’t trust modern technology are people that don’t understand it. But often, we overlook that keyboard-driven interfaces are extremely productive once you’re over the initial learning curve. I’m still convinced that data entry jobs were at peak productivity when they were terminals talking to mainframes, and that web- or mobile-based software will never, ever reach the productivity levels of those.

Robert J. Sawyer wrote an essay about Wordstar, helpfully subtitled “A Writer’s Word Processor”. In there he goes into some detail why it is so beloved among it’s users:

But touch-typists find that using the WordStar Control-key commands is much more efficient, because they can be typed from the home row without hunting for special keys elsewhere on the keyboard.

To go to the end of the line, you press Control-Q and then D. This seems so much harder and arcane that just pressing the END key on your keyboard, but it can be done without moving your hands – you don’t have to take your mind off writing. There is another really important feature that I’ll go into details about: blocks.

WordStar, with its long-hand-page metaphor, says, hey, do whatever you want whenever you want to. This is a good spot to mark the beginning of a block? Fine. What would you like to do next? Deal with the block? Continue writing? Use the thesaurus?

After another half hour of writing, I can say, ah hah!, this is where I want to end that block. And two hours later I can say, and this is where that block should go.

Now, Wordstar 4.0 has a bunch of issues these days. One, it’s somewhat hard to actually (legally) get it. Then, you need a way to run it on a modern system, e.g., though DOSBox. After you got it running, you know have to figure out how to get your files in and out of your DOSBox. And if you do, you might find that your files show up as gibberish because Wordstar uses 7-Bit encoding for the chars and the 8th (msb) bit as a control char – there are ways around it, but in the end, Wordstar is just too much of a pain these days.

Which leads me to the subject of todays posting: What would a “modern” alternative to Wordstar look like? There are plenty of powerful word processors out there, and there are plenty of distraction-free writers out there. I used iA Writer for most of my writing, especially since it’s available on both iOS and Mac OS X. Then again, with my new Macbook I no longer carry my iPad around.

I eventually landed on one of the staples of *NIX systems: joe’s own editor, or joe. It’s that editor that seems to be mostly forgotten in a world divided between vim and emacs, but I found it to be an awesome writing tool. I use Version 4.0 (UTF-8), installed through homebrew (brew install joe) It’s cross platform and also works on Windows.

It has a Wordstar mode, enabled by invoking it as jstar. When you press Control-J, the help opens on top, showing the most important keyboard shortcuts.

Deleting the current line from where the cursor is? Control-Q Y. That’s quicker than Shift+END DEL because your hands don’t move (even better if you’re on a laptop or another keyboard that doesn’t have dedicated DEL/END keys).

I’ve mentioned Blocks above. What’s so special about them, isn’t it just Cut/Copy/Paste? Yes and no. For one, you don’t have to do it all at once. You can mark the beginning of a block (Control-K B), then keep on writing and then mark the end (Control-K K). Go where you want to move it – now or much later, the selection isn’t lost if you move around or keep writing – and move it there (Control-K V). Or make a copy (Control-K C) Or delete it (Control-K Y), or undo (Control-U). You can write the block to a separate file (Control-K W), which is great if you want to do some reworking without losing what you had before.

One interesting feature is to filter the block through a Unix Command (Control-K /). If you have a list of words, you can filter it through tr "[:lower:]" "[:upper:]" to make it all-caps for example (the tr manpage shows some more examples). If you know your sed, you can do some real powerful text processing, right in the middle of your file without really having to leave your text editor.

This:

Becomes:

Overall, I think that joe is the editor of my choice for writing prose, because it combines distraction free writing with just enough editing capability to get the job done, all without having to think too much about the editor and moving my hands all over the keyboard to do stuff I have to do a lot. Toggling the help with Control-J allows me to quickly glance at a command while I’m still learning, but because the help isn’t modal I’m not losing focus from my text.