Questions

What are the rules for JavaScript's automatic semicolon insertion (ASI)?

Well, first I should probably ask if this is browser dependent. I've read that if an invalid token is found, but the section of code is valid until that invalid token, a semicolon is inserted before ...

When should space be encoded to plus (+) or %20?

Sometimes the spaces get URL encoded to the `+` sign, and some other times to `%20`. What is the difference and why should this happen?

19 Nov at 14:48

Find full path of the Python interpreter?

How do I find the full path of the currently running Python interpreter from within the currently executing Python script?

16 Oct at 08:58

How to handle command-line arguments in PowerShell

What is the "best" way to handle command-line arguments? It seems like there are several answers on what the "best" way is and as a result I am stuck on how to handle something as simple as: ``` scr...

29 Jun at 19:15

How do I escape ampersands in XML so they are rendered as entities in HTML?

I have some XML text that I wish to render in an HTML page. This text contains an ampersand, which I want to render in its entity representation: `&`. How do I escape this ampersand in the source...

6 Nov at 00:16

Best approach to remove time part of datetime in SQL Server

Which method provides the best performance when removing the time portion from a datetime field in SQL Server? ``` a) select DATEADD(dd, DATEDIFF(dd, 0, getdate()), 0) ``` or ``` b) select cast(co...

12 Jul at 06:51

How to filter empty or NULL names in a QuerySet?

I have `first_name`, `last_name` & `alias` (optional) which I need to search for. So, I need a query to give me all the names that have an alias set. Only if I could do: ``` Name.objects.filter(alia...

Is there a way to specify which pytest tests to run from a file?

Is there a way to select `pytest` tests to run from a file? For example, a file `foo.txt` containing a list of tests to be executed: ``` tests_directory/foo.py::test_001 tests_directory/bar.py::test_s...

8 Jul at 22:46

Unable to update the EntitySet - because it has a DefiningQuery and no <UpdateFunction> element exist

I am using Entity Framework 1 with .net 3.5. I am doing something simple like this: ``` var roomDetails = context.Rooms.ToList(); foreach (var room in roomDetails) { room.LastUpdated = D...

What's the difference between equal?, eql?, ===, and ==?

I am trying to understand the difference between these four methods. I know by default that `==` calls the method `equal?` which returns true when both operands refer to exactly the same object. `===...

8 Sep at 16:34

Error - trustAnchors parameter must be non-empty

I'm trying to configure my e-mail on Jenkins/Hudson, and I constantly receive the error: ``` java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty ``` I...

21 Jul at 18:39

Sort an array of associative arrays by column value

Given this array: ``` $inventory = array( array("type"=>"fruit", "price"=>3.50), array("type"=>"milk", "price"=>2.90), array("type"=>"pork", "price"=>5.43), ); ``` I would like to sort `...

Retrieving Property name from lambda expression

Is there a better way to get the Property name when passed in via a lambda expression? Here is what i currently have. eg. ``` GetSortingInfo<User>(u => u.UserId); ``` It worked by casting it as a...

5 Jan at 16:18

How to install the JDK on Ubuntu Linux

Note: This is an old question and the answers reflect the world as it was then. Modern Ubuntu distributions have OpenJDK available which can be installed with ``` sudo apt install default-jdk ``` ...

27 Mar at 22:11

Interface type check with Typescript

This question is the direct analogon to [Class type check with TypeScript](https://stackoverflow.com/questions/12789231/class-type-check-with-typescript) I need to find out at runtime if a variable o...

14 Dec at 22:10

logger configuration to log to file and print to stdout

I'm using Python's logging module to log some debug strings to a file which works pretty well. Now in addition, I'd like to use this module to also print the strings out to stdout. How do I do this? I...

7 Oct at 22:50

What is the difference between "screen" and "only screen" in media queries?

What is the difference between `screen` and `only screen` in media queries? ``` <link media="screen and (max-device-width: 480px)" rel="stylesheet" href="m.css" /> <link media="only screen and (max-d...

16 Apr at 22:39

"The breakpoint will not currently be hit. The source code is different from the original version." What does this mean?

When debugging in Visual Studio, sometimes I add a breakpoint but it's hollow and VS says "The breakpoint will not currently be hit. The source code is different from the original version." Obviously ...

10 Jun at 18:29

C# code to validate email address

What is the most elegant code to validate that a string is a valid email address?

10 Jul at 15:48

The resource could not be loaded because the App Transport Security policy requires the use of a secure connection

I am facing the Problem when I have updated my Xcode to 7.0 or iOS 9.0. Somehow it started giving me the Titled error > "The resource could not be loaded because the App Transport Security policy r...

How to retrieve the current version of a MySQL database management system (DBMS)?

What command returns the current version of a MySQL database?

23 Jan at 23:53

Simulator or Emulator? What is the difference?

While I understand what simulation and emulation mean in general, I almost always get confused about them. Assume that I create a piece of software that mimics existing hardware/software, what should ...

30 Dec at 18:0

How to run a shell script on a Unix console or Mac terminal?

I know it, forget it and relearn it again. Time to write it down.

11 Jan at 08:43

When to use reinterpret_cast?

I am little confused with the applicability of `reinterpret_cast` vs `static_cast`. From what I have read the general rules are to use static cast when the types can be interpreted at compile time hen...

3 Sep at 20:8

How do I find the location of Python module sources?

How do I learn where the source file for a given Python module is installed? Is the method different on Windows than on Linux? I'm trying to look for the source of the `datetime` module in particular...

24 Feb at 22:14