Sequence contains no matching element

Well, I’d expect it’s this line that’s throwing the exception: First() will throw an exception if it can’t find any matching elements. Given that you’re testing for null immediately afterwards, it sounds like you want FirstOrDefault(), which returns the default value for the element type (which is null for reference types) if no matching items are found: … Read more

How to strip all whitespace from string

Taking advantage of str.split’s behavior with no sep parameter: If you just want to remove spaces instead of all whitespace: Premature optimization Even though efficiency isn’t the primary goal—writing clear code is—here are some initial timings: Note the regex is cached, so it’s not as slow as you’d imagine. Compiling it beforehand helps some, but … Read more

How to export a mysql database using Command Prompt?

First check if your command line recognizes mysql command. If not go to command & type in: Then use this command to export your database: You will then be prompted for the database password. This exports the database to the path you are currently in, while executing this command Note: Here are some detailed instructions regarding both import … Read more

“python” not recognized as a command

You need to add the python executable path to your Window’s PATH variable. From the desktop, right-click My Computer and click Properties. In the System Properties window, click on the Advanced tab. In the Advanced section, click the Environment Variables button. Highlight the Path variable in the Systems Variable section and click the Edit button. … Read more