Questions

How does the SQL injection from the "Bobby Tables" XKCD comic work?

Just looking at: ![XKCD Strip](https://i.stack.imgur.com/G0ifh.png) [https://xkcd.com/327/](https://xkcd.com/327/) What does this SQL do: ``` Robert'); DROP TABLE STUDENTS; -- ``` I know both `'`...

21 Mar at 21:26

In Typescript, what is the ! (exclamation mark / bang) operator when dereferencing a member?

When looking at the sourcecode for a tslint rule, I came across the following statement: ``` if (node.parent!.kind === ts.SyntaxKind.ObjectLiteralExpression) { return; } ``` Notice the `!` oper...

10 May at 11:21

What do "branch", "tag" and "trunk" mean in Subversion repositories?

I've seen these words a lot around Subversion (and I guess general repository) discussions. I have been using for my projects for the last few years, but I've never grasped the complete concept of th...

6 Jan at 08:26

What is the difference between a Docker image and a container?

When using Docker, we start with a base image. We boot it up, create changes and those changes are saved in layers forming another image. So eventually I have an image for my PostgreSQL instance and ...

11 Nov at 14:17

Returning IEnumerable<T> vs. IQueryable<T>

What is the difference between returning `IQueryable<T>` vs. `IEnumerable<T>`, when should one be preferred over the other? ``` IQueryable<Customer> custs = from c in db.Customers where c.City == "<Ci...

How do I kill the process currently using a port on localhost in Windows?

How can I remove the current process/application which is already assigned to a port? For example: `localhost:8080`

How do I turn a C# object into a JSON string in .NET?

I have classes like these: ``` class MyDate { int year, month, day; } class Lad { string firstName; string lastName; MyDate dateOfBirth; } ``` And I would like to turn a `Lad` object...

10 May at 17:22

How to effectively work with multiple files in Vim

I've started using Vim to develop Perl scripts and am starting to find it very powerful. One thing I like is to be able to open multiple files at once with: ``` vi main.pl maintenance.pl ``` and ...

13 Dec at 05:53

What is the best way to conditionally apply a class?

Lets say you have an array that is rendered in a `ul` with an `li` for each element and a property on the controller called `selectedIndex`. What would be the best way to add a class to the `li` with ...

28 Jul at 10:1

Git: Create a branch from unstaged/uncommitted changes on master

Context: I'm working on master adding a simple feature. After a few minutes I realize it was not so simple and it should have been better to work into a new branch. This always happens to me and I ha...

9 Oct at 05:4

How do I display an alert dialog on Android?

I want to display a dialog/popup window with a message to the user that shows "Are you sure you want to delete this entry?" with one button that says 'Delete'. When `Delete` is touched, it should dele...

How to understand nil vs. empty vs. blank in Ruby

I find myself repeatedly looking for a clear definition of the differences of `nil?`, `blank?`, and `empty?` in Ruby on Rails. Here's the closest I've come: - `blank?` objects are false, empty, or a...

30 May at 00:15

Error message "error:0308010C:digital envelope routines::unsupported"

I created the default IntelliJ IDEA React project and got this: ``` Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:67:19) at Object.createH...

20 Nov at 19:58

How do I trim whitespace?

Is there a Python function that will trim whitespace (spaces and tabs) from a string? So that given input `" \t example string\t "` becomes `"example string"`.

21 May at 08:59

Fastest way to check if a value exists in a list

What is the fastest way to check if a value exists in a very large list?

6 Jun at 04:40

In Node.js, how do I "include" functions from my other files?

Let's say I have a file called app.js. Pretty simple: ``` var express = require('express'); var app = express.createServer(); app.set('views', __dirname + '/views'); app.set('view engine', 'ejs'); ap...

27 Apr at 00:9

Set select option 'selected', by value

I have a `select` field with some options in it. Now I need to select one of those `options` with jQuery. But how can I do that when I only know the `value` of the `option` that must be selected? I ha...

18 Sep at 15:40

How do I get a list of locally installed Python modules?

How do I get a list of Python modules installed on my computer?

9 Apr at 10:22

How can I pad an integer with zeros on the left?

How do you left pad an `int` with zeros when converting to a `String` in java? I'm basically looking to pad out integers up to `9999` with leading zeros (e.g. 1 = `0001`).

24 Jun at 14:53

What are POD types in C++?

I've come across this term POD-type a few times. What does it mean?

19 Apr at 13:44

You need to use a Theme.AppCompat theme (or descendant) with this activity

Android Studio 0.4.5 Android documentation for creating custom dialog boxes: [http://developer.android.com/guide/topics/ui/dialogs.html](http://developer.android.com/guide/topics/ui/dialogs.html) If...

20 Jan at 06:42

How do I get the value of text input field using JavaScript?

I am working on a search with JavaScript. I would use a form, but it messes up something else on my page. I have this input text field: ``` <input name="searchTxt" type="text" maxlength="512" id="sear...

19 Sep at 19:39

Check if a variable is of function type

Suppose I have any variable, which is defined as follows: ``` var a = function() {/* Statements */}; ``` I want a function which checks if the type of the variable is function-like. i.e. : ``` fun...

30 Jan at 21:4

What is an example of the Liskov Substitution Principle?

I have heard that the Liskov Substitution Principle (LSP) is a fundamental principle of object oriented design. What is it and what are some examples of its use?

How to resolve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException

I have some code that uses JAXB API classes which have been provided as a part of the JDK in Java 6/7/8. When I run the same code with Java 9, at runtime I get errors indicating that JAXB classes can...

1 Mar at 12:45