How do I run a localDB occasion in single-user mode?

I am trying to restore the master db of a localDB server instance in SQL Server 2016. I cannot seem to figure out how to run the server in single-user mode so I can restore the master in SSMS. I know I can run the db with SQLLocalDB.exe but this does not
specify a single-user argument option. When i run the following command:

C:Program FilesMicrosoft SQL Server130LocalDBBinn> .sqlservr.exe -c -m -S "(localdb)MSSQLLocalDB"

I get an error that the "parent instance name exceeds maximum length"

Does anyone know how to run this localdb instance in single-user mode, so I can restore the master db from a .bak file?


Java for All the pieces

I used to ask interviewees, “What’s your favorite programming
language?” The answer was nearly always, “I just choose the right language
for the job.” Duh. Does anyone ever deliberately pick the wrong language? This
was clearly a way to avoid actually naming a language for fear of picking one I
didn’t like.

If the interviewee gave an answer at all, it was, “I’m most familiar with
language X,” which didn’t answer my question either.

At the time I would myself have replied something like, “I like Python best
because it makes me happy to program in it, but I only use it in such-and-such
a situation. The rest of the time I use XYZ…”

About a year ago, though, I started to form a strange idea: That Java is the
right language for all jobs. (I pause here while you vomit in your
mouth.) This rests on the argument that what you perceive to be true does not
match reality, and that’s never a popular approach, but let me explain anyway.

Python really is my favorite language, and it truly makes me happy when I code
in it. It pushes the happy spot in my head. It matches pseudo-code so well that
it’s a genuine pleasure to work in it.

Years ago I read Bruce Eckel’s influential Strong Type vs. Strong
. In it he argued
that static typing (what he calls strong typing) is one of the many facets of
program correctness, and that if you’re going to check the other facets (such
as the algorithm and the logic) with unit tests, then the types will also get
checked, so you may as well go for dynamic typing and benefit from its

Bruce used Python to illustrate his code, and that clinched it: I decided that
I would from then on write everything in Python. Unfortunately I was half-way
through a large Java program at work, but my co-worker and I agreed that it
should have been written in Python, and perhaps one day we’d get a good excuse
to rewrite it all that way.

Several things changed my mind 180° in less than a year:

  • At one company I wrote a simulator that allowed me to run
    my Java services without a fully-functional site. In this
    simulator I ran scripts that tested various
    scenarios including failures. For these scripts
    I decided to use JavaScript,
    primarily because it’s included in Java 6 and secondarily
    because many people know it. I reasoned that a scripting
    language would allow us and Q/A to write tests easily.
    An intern, Justin Lebar, argued that we should simply
    use Java. The simulator is in Java, so why not write
    the scripts in it too? It’s sitting right there and
    we all know it. I went ahead with JavaScript, which forced
    me to write various code to bridge the two. It also
    meant that stack traces were much harder to read,
    since they didn’t point to the line in the script that
    was being executed. Q/A never wrote any tests.
    Overall we gained nothing from
    JavaScript and Justin had been right.

  • At the same company we stored our logs in JSON format
    (which is a great idea, by the way), and a co-worker
    wrote a Python program called logcat to parse the
    logs and generate the standard columnar output,
    with many nice features and flag (including a binary
    search for timestamp). On OurGroceries, my personal
    project, we needed something similar and I suggested
    again to use Python. My partner Dan Collens suggested
    Java, since it’s right there and we know it and
    it’s fast. He wrote it and he was right: it’s blazing
    fast. I’ve since compared the Python logcat to a Java one
    and the latter is about ten times faster. Whatever
    time was saved by the developer when writing the Python code (if any)
    were lost many times over as dozens of users had
    to wait ten times longer each time they fished
    through the logs.

  • And finally, I went to write a simple program
    that put up a web interface. I considered using
    Python, but this would have required me to figure
    out how to serve pages from its library. I had
    already done this in Java (with Jetty), so I could
    be up and running in Java in less time. I realized
    that as I accumulate knowledge about 3rd party Java
    libraries and grow my own utility library, it
    becomes increasingly expensive to use any other
    language. I have to figure those things out again
    and write them again, instead of copying and
    pasting the code from the previous project. Note
    that this doesn’t argue for Java, but it does argue
    for using a single language.

The big argument against Java is that it’s verbose. Perhaps, but so
what? I suppose the real argument is that it takes longer to write the code. I
doubt this is very much true after the first 10 minutes. Sure you have to
write public static void main, but how much time does that take? Sure you
have to write:

Map<String,User> userIdMap = new HashMap<String,User>();

instead of:

userIdMap = {}

but in the bigger scheme of things,
is that so long? How many total minutes out of a day
is that, two? And in Python the code more realistically
looks like this anyway:

# Map from user ID to User object.
userIdMap = {}

(If it doesn’t, then you have bigger problems. Undocumented Python programs are
horrendously difficult to maintain.) The problem is that programmers perceive
mindless work as painful and time-consuming, but the reality is never so bad.
Here’s a quote from a forum about language design:

It really sucks when you have to add type declarations
for blindingly obvious things, e.g. Foo x = new Foo().

No, actually, typing Foo one extra time does not “really suck”. It’s three
letters. The burden is massively overstated because the work is mindless, but
it’s really pretty trivial. Programmers will cringe at writing some kind of
command dispatch list:

if command = "up":
elif command = "status":
elif command = "revert":

so they’ll go off and write some introspecting auto-dispatch cleverness, but
that takes longer to write and will surely confuse future readers who’ll wonder
how the heck revert() ever gets called. Yet the programmer will incorrectly
feel as though he saved himself time. This is the trap of the dynamic language.
It feels like you’re being more productive, but aside from the first 10 minutes
of a new program, you’re not. Just write the stupid dispatch manually and get
on with the real work.

The General Problem

(Aside: I’m on the wrong side of a different decision, the one to use vim for
code editing. I feel very efficient when using vim, as code flies around the
terminal, and I feel sluggish using Eclipse, and justify my choice with this
efficiency argument. But surely all my gains are lost the first time I have to
look up who calls a particular function, or when I have to look up the methods
of an object manually. I recognize that I’m wrong on this one in the same way
that dynamic language apologists are about their choice.)

So why are dynamic languages ever chosen? If you and I have a contest to write
a simple blogging system and you’re using (say) Python, you’ll have something
interesting in 30 minutes using pickling and whatnot, and it’ll take me two
days to build something with MySQL. Many language choices are based on trivial
contests like these. But after two weeks of development, when we both have to
add a feature, mine will take at most as long as yours, and I won’t be spending
any time figuring out how to get my system to handle so many users, or tracking
down why some obscure if clause breaks because you misspelled the name of a
function, or figuring out what the heck this request parameter contains.

The classic hacker disdain for “bondage and discipline languages” is short
sighted; the needs of large, long-lived, multi-programmer projects are just
different than the quick work you do for yourself. –

And you don’t think you’ll struggle with scalability sooner than I? Every year
the NaNoWriMo website goes down on October 31st.
It’s unresponsive for days. About 60,000 people hit it over a period of several
hours, so maybe four requests per second. It’s written in PHP. The OurGroceries
backend is written in Java. It handles (currently) about 50 complex requests
per second and the CPU rarely goes above 1% for the Java process.

Twitter recently tripled their search

by switching their search engine from Ruby to Java.

A year earlier, Joel Spolsky tweeted:

The reply from @GregB was:

StackOverflow uses ASP.NET. So you can complain all day about public static
void main
, but have fun setting up 500 servers. The downsides of dynamic
languages are real, expensive, and permanent.

And what about the unit testing argument? If you have to unit test your code
anyway, what does static typing buy you? Well for one thing it buys you speed,
and lots of it. But also writing and maintaining unit tests takes time. Most
importantly, the kinds of bugs that people introduce most often aren’t the kind
of bugs that unit tests catch. With few exceptions (such as parsers), unit
tests are a waste of time. To quote a friend of mine, “They’re a tedious,
error-prone way of trying to recapture the lost value of static type
annotations, but in a bumbling way in a separate place from the code itself.”

So here’s my new approach: Do everything in Java. Don’t be tempted to write
some quick hack in Python because:

  • You can’t copy and paste code from other projects in
    your primary programming language.

  • It may feel faster to develop, but that’s an illusion.
    The actual time saved is small, though admittedly

  • It’s one more language, platform, and set of libraries
    that I and my co-workers have to learn and master.

  • And here’s the important one: Chances are good that
    this quick hack will grow and become an important
    tool, and I won’t have the bandwidth to rewrite it,
    yet I’ll suffer the performance and maintenance
    penalty every time I use it.

I agree it’s fun to develop in Python. I love it. When I’m writing a Sudoku
solver, I reach for Python. But it’s the wrong tool for anything larger, and
it’s the wrong tool for code of any size written for pay, because you’re doing
your employer a disservice.

I’m even taking this to an extreme and using Java for shell scripts. I’ve found
that anything other than a simple wrapper shell script eventually grows to the
point where I’m looking up the arcane syntax for removing some middle element
from an array in bash. What a crappy language! Wrong tool for the job! Write
it in Java to start with. If shelling out to run commands is clumsy, write a
utility function to make it easy.

I’ve also written a java_launcher
shell script that allows me to write this at the top of Java programs:

#!/usr/bin/env java_launcher
# vim:ft=java
# lib:/home/lk/lib/teamten.jar

I can make the Java programs executable and drop the .java extension. The
script strips the header, compiles and caches the class file, and runs the
result with the specified jars. It provides one of the big advantages of
Python: the lack of build scripts for simple one-off programs.

This focus on a single language has had an interesting effect: It has
encouraged me to improve my personal library of utility
(teamten.jar above), since my
efforts are no longer split across several languages. For example, I wrote a
library that contains image processing routines. They’re both faster and
higher quality than anything you can find in Java and Python. This took a
while, but I know it’s worth it because I won’t find myself writing some Python
script and wishing I could resize an image nicely. I can now confidently invest
in Java as an important part of my professional and personal technical future.

There remains the question of why choosing Java specifically, out of the set of
compiled statically-typed languages. The advantages of C and C++ (slight
performance gains, embeddability, graphics libraries) don’t apply to my work.
C# is nice but not cross-platform enough. Scala is too complex. And other
languages like D and Go are too new to bet my work on.

When I tell people that I now write everything in Java, they look horrified.
One friend had a visible look of disgust. But you know, Java’s a pretty nice
language, and when my code compiles, which is often the first time, it’ll
usually also run correctly. I don’t have that peace of mind with any other
language. Java just works like a horse and is useful across a very broad range
of applications.

официальное заявление

Вынужден сделать официальное заявление.
Я мудак.

И извиниться перед организаторами и посетителями конференции Whale Rider.
Я не успел подготовится и выступить. «Почти успел».
Гребанный перфекционист.

Такого факапа у меня не было давно, обычно все всегда успевал, это была моя фишка.
Впрочем, пару дней назад уже был первый факап (ребята, извините с олимпиадой).

Первый шаг к решению проблемы — это ее признание. Признаю, я перегружен и уже не управляю собой и своими обязательствами.

Эта неделя пройдет в духе аврала, а далее я займусь разгребанием долгов. Технических, организационных, семейных.

Я страшно зол, и хочу спать.

Ebook Evaluate | The Midnight Lullaby by Cheryl Low

The Midnight Lullaby is a horror novella by Cheryl Low.

Everybody has secrets…

For years, Benedict Lyon has been living a lie. Not even his family knows the truth he’s been keeping from the world. Only Emmeline knows his secret—and she’s dead.

…some are darker than others…

When the matriarch of the Lyon family passes away, Benedict is summoned home for the funeral. Emmeline urges Benedict not to go, certain that if he returns to that house, neither one of them will escape.

…but are they worth dying for?

Their presence in the family home causes the spirit of Gloria Lyon to become restless, and as the remaining members of the Lyon family attempt to put their mother to rest, long buried secrets, some deadlier than others, are unearthed. Who will survive…

The Midnight Lullaby.

Thank you to Tammy for putting this novella on my radar! (And thank you to Grinning Skull Press for sending me out a copy for review!)

Ghosts have always been my favorite horror element so I get really excited when I read a ghostly book that brings something new to the table. The Midnight Lullaby did just that! I don’t want to spoil anything for you, though. At 165 pages, The Midnight Lullaby escalates quickly!

This was my first book by Cheryl Low, but I’m definitely going to go back and pick up Infernal.

We are at the beginning of spooky season, and we are all going to be spending a lot more time at home this year. The Midnight Lullaby is on my list of books that I recommend you add to your horror pile this fall.

4.5/5 stars

The First Two-Million-Greenback Examine

A single drink perfectly captures the weirdness of raising money for the first time.

Photo courtesy of Dylan de Jonge
I found myself at a hotel with some friends. I was visiting Portland for a conference. Puppet’s first investment round — and mine! — was closing. The money was being deposited.

Have you seen a David Mamet movie, like The Spanish Prisoner? They’re fantastic. But eerie. Disquieting. They build up a story, brick by brick. Then they yank a few bricks away, exposing the whole story as a lie. Only a hollow truth remains, unrelated to your built up belief. It makes you question everything.

I’m waiting for the closing in this hotel, and I order a Macallan 18 to celebrate. This was back when it was only expensive, not egregious. I lift the glass, and I think:

The money is being deposited into my bank.

I think it’s a real bank.

I mean, they had, like, a website. And websites are pretty hard to… wait a minute.

Who introduced me to the bank?

The investors introduced me. They specifically wanted me to work with this bank. They’re the ones giving me the money. They wouldn’t say they’re giving me the money then give it to someone else. That’s a silly kind of fraud. I just have to trust them.

I sit there. Sipping my whiskey.

I think it’s a real bank.

I think I’m getting $2.25 million.

I had never seen a bank account with that many zeroes — and I still may not at that point! I have no idea what to do.

So I sit there. Savoring that delicious, delicious whiskey.

I didn’t mean to raise money. I was just focused on running the company. We had bootstrapped for almost four and a half years. I figured we were going it alone.

I had talked to people in the past about raising money. It was like Groucho Marx’s joke about clubs: I wouldn’t take money from the investors willing to give it to me. “Wow, I would love them as an investor,” you get nothing. Or, “I would happily give you money and ruin your life.” Hmm. Not really the deal I’m looking for.

One day at an event, an investor tracked me down. He said, I’d like to invest in your company. I said, That doesn’t sound right. A lot of investors say, We should talk. He said: We should talk on Monday. That specificity made all the difference.

He made a very confusing offer: We would like to write a $1.75 million check into a $2 million round. I said, how can you be that bad at math and work in finance. He said, Go find other, rich people that you know to give you the rest of the money. I said, you are, literally, the only rich person I know. He said, I just joined this firm. I am not rich. Then we’re stuck, I said.

I lived in Nashville at the time. There are a bunch of rich people there. But they’re all musicians. They don’t do technology. We most emphatically did not hang out. We weren’t going to fill this round through my network.

Eventually, by connecting me to their network of rich people, I was able to raise $2.25 million. Mostly through luck not skill. I didn’t build a deck. I didn’t run a formal process. I didn’t pitch multiple investors to get competitive term sheets. I pretty much did the exact opposite of the play book. The investor who filled out the round turned me down at first, but I heard his wife persuaded him. I don’t know if she liked me or was cursing him.

Once all of the investors are in place, you wait.

The things you learn in your first round.

Closing takes about thirty days. Five rounds later, I have no idea why. It takes thirty days, and it costs $30,000. One of the terms in the term sheet you get from your investors states that you pay for closing. “We’re going to give you this money, and then you’re going to give some of it to the lawyers.” Investors cap the fees, and the lawyers coincidentally hit that exact number every time.

I honestly don’t know what the lawyers do at closing. The documents are massively long, but they’re pretty much the same. At a late-stage company, I can understand: There is diligence to do (although not by the lawyers), financial data to look through (done by analysts, not lawyers), customers to talk to (by the investors, not the lawyers). At an early stage, though, there just isn’t much information. I don’t know what they do.

But it takes thirty days. And costs thirty grand. Says so on the term sheet.

So you wait.

But when that waiting stopped, boy howdy did things move.

The money did get deposited. It was a real bank after all.

Within a month I’d moved from Nashville to Portland. Within two months, I had my next three employees. And within six months I had a team of ten.

Raising money set us off like a rocket. Bootstrapping for more than four years provided a fantastic foundation for quick growth.

Looking back, I’m glad we raised money. I only wish we had done it earlier.

Lee’s Birthday twenty first August

It was Lee’s 38th birthday in August. When he and I first got together, he was about to celebrate his 18th birthday. His mam bought him a huge chocolate fudge cake and he ate three quarters of it, I swear. We’ve had loads of nice times on his birthday since. We often go away but we decided not to this year as we were going away the week after (which I’ll blog, obviously!). Lee only told me a few things to buy so I bought him those and then some aftershave and some chocolate too, which he always likes. The aftershave is Davidoff Cool Water, which I LOVE on him. 

Lee decided he would like to go swimming. We had been looking at going to Hathersage lido, but their swimming times go for sale at 6am each morning and are always sold out by the time I get to look! So we decided we would go to Barnsley Metrodome. It’s a big leisure pool and when we looked, you had to book an arrival time and then you got 90 minutes to swim, which seemed fine to us. So we booked for 10am, meaning we basically just got up, fed the cats, and went into town. You were supposed to arrive “beach ready” meaning with your costume on, so we just stripped and got into the pool.

It wasn’t too busy and it was SO LOVELY to be in a swimming pool. We hadn’t been since the end of February and MISS swimming so much. We usually go to the gym at least once a week and usually book holidays with pools, so we’ve really missed it. It was so lovely to launch myself into water. There’s a big leisure pool with a wave machine so we got to play in the waves a few times, and there’s a lane pool, so we went in there to swim down to the deep end a couple of times. They’re connected with a shallow area that has bubble jets in it, so we sat there for a bit too. It was SO much fun. But I knew that my body would really hurt afterwards and indeed it did.

We got into the car still wet, sitting on towels and plastic bags to stop the car from getting wet. We went home, where the cats wanted to eat us (what is it about chlorine), had showers, and headed back out again to the White Rose Centre where we were meeting my mum and stepdad for lunch.

They haven’t been inside a restaurant since before lockdown. My stepdad would probably get Covid really badly and as my mum has still been working 3 days a week, they’ve really limited their exposure by just staying at home even as lockdown has eased. We had talked about eating outside, but none of the restaurants in the White Rose were doing that (even though some of them in “The Village” have tabled outside? So they could!). But Wagamama wasn’t very busy and we were able to get a table by the door which my mum and stepdad were happy with. We were far away from others, so they were happy. 

My mum has been to Wagamama before, a couple of years ago with me, but my stepdad never had. I knew they would like some of it, though. I recommended they try the steamed buns and the gyoza, because they’re delicious and people tend to enjoy them. They went for other stuff too and they LOVED it. My stepdad got katsu curry and said it was really delicious, he was really happy to try it and said he wanted to go back and try some other things in there. 

I went for bang bang cauliflower (one of my favourite dishes ANYWHERE), the steamed vegan buns, and the avant gard’n which I’ve had before. It’s a vegan bowl with an “egg”, rice, sticky seitan, edamame beans and more. I thoroughly enjoyed it. My mum wanted to make a couple of alterations to her food and the staff were very willing to do that, which is good. 

We even had dessert! I wouldn’t normally in there but it was a special occasion after all. I had salted caramel ice cream which was really nice. We weren’t rushed out of the table and by the end there was only us and a couple of other tables in there, so it was lovely.

My mum bought Lee a new WOK! This is very exciting! We haven’t had one for ages and usually use a frying pan for everything, but since I went veggie I’ve been thinking we could do with a wok again. 

Lee and I had said we might go shopping after lunch, but it was after 3pm and we were both knackered, so we decided to just go home. The kittens were obviously happy to see us, and I had a little nap as I was very tired. I’d been going through some health stuff and not feeling well.

We watched a film together later and then Lee wanted to play one of his new video games, so that was fine! A low key birthday but still a nice one I hope.

I was wearing my Lindy Bop blue polka dotted dress which I love. My photo is featuring Jasmine! 

I took this just after swimming, to share on Instagram that I felt restored to life thanks to putting my body in water!

My nail polish was a Bourjois orangey neon one that I bought recently. It’s nice but not very long lasting

Avant Gard’n bowl 

And my mushroom and aubergine steamed buns. I love these!

Salted caramel ice cream! It was really nice

Blue Lindy Bop dress and gorgeous Jasmine

Rhetorical Query: 19 March 2010

Jill Stanton-Huxton asks:

Surely Mrs Hammerstein deserved a burial in the back garden rather than being thrown out with the rubbish (Tim Dowling, 12 March)?

To answer this question it’s important to remember that Mrs Hammerstein, despite her name, was a snake – and snakes in the wild have no tradition of burying their dead.

It’s true that  many snake-owners feel it appropriate to bury their snake upon its death; and that Dowling’s house has a garden, as revealed in previous columns, meaning this course of action would have been possible. Additionally, some councils request that people do not put their deceased pets in the rubbish (see for example Uttlesford council, which states that “pets are suitable for neither recycling nor landfill, and should not be left out for collection”).

With regard to Mrs Hammerstein’s specific expectations and the treatement she deserved, however, we can be relatively confident that she would not feel let down by the Dowling family’s treatment.