Ivan Krivyakov's Blog

Premature optimization is the root of all evil

August 29, 2011

Creating ASP.NET membership database: no funky passwords!

To simplify creating and managing users in ASP.NET Microsoft created a lot of infrastructure that takes care of this boilerplate task. Part of the infrastructure is

aspnet_regsql.exe

utility that is supposed to create relevant tables on an SQL server. The trouble is, if you use SQL server authentication, the utility does not like passwords with funky characters. It looks like they get added to the connection string verbatim, and thus you get

System.ArgumentException: Format of the initialization string does not conform to specification starting at index 31.

Looks like they just append the passwords to the connection string, verbatim without escaping. Way to go (not)!

August 9, 2011

JAX-WS and @XmlRootElement

Just finished a fight with JAX-WS. It turns out that if I have a method like this:

@WebService(targetNamespace=...)
@SOAPBinding(parameterStyle = SOAPBINDING.ParameterStyle.BARE /* don't ask */)
class MyWebService
{
    @WebMethod
    MyClass getMyStuff();
}

then generated WSDL depends on whether NyClass has @XmlRootElement annotation. If it does, you’re going to have a WSDL with empty input (client sends empty SOAP body with no indication of request kind whatsoever). If it does not, then everything is OK, request body is not empty.

I am sure there is a simple, logical explanation to all this…

August 8, 2011

It’s the solar flares, stupid

Three large explosions from the sun over the past few days have prompted U.S. government scientists to caution users of satellite, telecommunications and electric equipment to prepare for possible disruptions” (from Slashdot).

That’s it. That explains it. Everyone is just affected by the pesky magnetic fields. Why S&P should be any different? “Mommy, I lost $2 trillion, because the Sun flare burnt my homework” seems like a valid excuse now :)

Hosting your own e-mail sevrer: no longer an option

Somone on Slashdot asked what are possible “Self-Hosted Gmail Alternatives?“.

Unfortunately, it seems like in practice there are none. When I registered my domain, I used to run an e-mail server too, but eventually I had to turn it off. The main problem was, of course, spam. Lots of it. Then the outages. Whenever my server was down, I would not be able to get any e-mails. Then other servers started to blacklist me, because I was running off a residential IP. I was getting auto-responses politely advising me to use my ISP’s mail server. Finally, due to the spam pressure, the ISP closed port 25 for all communications except to their own SMTP server.

Thanks to human greed and ignorance that breed spam, something that used to be an open communication network of e-mail servers is now reduced to an elite club where only the big players can survive, and there is not solution in sight. Sigh.

Generally, these days I would think twice before hosting any kind of server at home. By doing so, you expose yourself to security risks, reliability issues (do you have a UPS? do you have reliable backup?), and other interesting things.

Having said that, I must confess I still run my web server from home: not on my main work PC, of course. I do have a backup, but I don’t have UPS. I don’t consider my web site mission critical :)