Questions

CSS selector for text input fields?

How can I target input fields of type 'text' using CSS selectors?

How to iterate over associative arrays in Bash

Based on an associative array in a Bash script, I need to iterate over it to get the key and value. ``` #!/bin/bash declare -A array array[foo]=bar array[bar]=foo ``` I actually don't understand h...

What is meant by Resource Acquisition is Initialization (RAII)?

What is meant by Resource Acquisition is Initialization (RAII)?

6 Mar at 05:8

Reflecting parameter name: abuse of C# lambda expressions or syntax brilliance?

I am looking at the [MvcContrib](http://www.codeplex.com/MVCContrib) Grid component and I'm fascinated, yet at the same time repulsed, by a syntactic trick used in the [Grid syntax](http://www.jeremys...

15 Jun at 22:33

HTTP redirect: 301 (permanent) vs. 302 (temporary)

Is the client supposed to behave differently? How?

URL Encoding using C#

I have an application which sends a POST request to the VB forum software and logs someone in (without setting cookies or anything). Once the user is logged in I create a variable that creates a path...

17 Feb at 14:3

What's the difference between ISO 8601 and RFC 3339 Date Formats?

[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) and [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) seem to be two formats that are common the web. Should I use one over the other? Is one just a...

7 Oct at 07:34

How do you write a migration to rename an ActiveRecord model and its table in Rails?

I'm terrible at naming and realize that there are a better set of names for my models in my Rails app. Is there any way to use a migration to rename a model and its corresponding table?

Can I access constants in settings.py from templates in Django?

I have some stuff in settings.py that I'd like to be able to access from a template, but I can't figure out how to do it. I already tried ``` {{CONSTANT_NAME}} ``` but that doesn't seem to work. Is...

Table fixed header and scrollable body

I am trying to make a table with fixed header and a scrollable content using the bootstrap 3 table. Unfortunately the solutions I have found does not work with bootstrap or mess up the style. Here th...

19 Aug at 18:10

The property 'value' does not exist on value of type 'HTMLElement'

I am playing around with typescript and am trying to create a script that will update a p-element as text is inputted in a input box. The html looks as following: ``` <html> <head> </head> ...

2 Mar at 21:27

How to stop C# console applications from closing automatically?

My console applications on Visual Studio are closing automatically once the program finishes the execution. I'd like to "pause" the applications at the end of their execution so that I can easily chec...

18 Sep at 22:11

Why use ICollection and not IEnumerable or List<T> on many-many/one-many relationships?

I see this a lot in tutorials, with navigation properties as `ICollection<T>`. Is this a mandatory requirement for Entity Framework? Can I use `IEnumerable`? What's the main purpose of using `IColle...

An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode

I installed DotNetOpenAuth SDK-3.4.5.10201.vsix, and I can't get it working. It works locally (when I run as localhost), but when I try to publish it doesn't work. The IIS error message I get is: > Er...

30 Nov at 18:13

How to find out line-endings in a text file?

I'm trying to use something in bash to show me the line endings in a file printed rather than interpreted. The file is a dump from SSIS/SQL Server being read in by a Linux machine for processing. - A...

How to check if running in Cygwin, Mac or Linux?

I have a shell script that is used both on Windows/Cygwin and Mac and Linux. It needs slightly different variables for each versions. How can a shell/bash script detect whether it is running in Cygw...

12 Aug at 09:10

How to convert int to QString?

Is there a `QString` function which takes an and outputs it as a `QString`?

14 Sep at 03:32

PostgreSQL function for last inserted ID

In PostgreSQL, how do I get the last id inserted into a table? In MS SQL there is SCOPE_IDENTITY(). Please do not advise me to use something like this: ``` select max(id) from table ```

4 Jul at 08:33

What's the difference between VARCHAR and CHAR?

What's the difference between VARCHAR and CHAR in MySQL? I am trying to store MD5 hashes.

11 Dec at 03:36

How to discover number of *logical* cores on Mac OS X?

How can you tell, from the command line, how many cores are on the machine when you're running Mac OS X? On Linux, I use: ``` x=$(awk '/^processor/ {++n} END {print n+1}' /proc/cpuinfo) ``` It's n...

11 Jun at 21:41

Java Generics With a Class & an Interface - Together

I want to have a Class object, but I want to force whatever class it represents to extend class A and implement interface B. I can do: ``` Class<? extends ClassA> ``` Or: ``` Class<? extends Inte...

7 Jan at 07:11

Difference between abstraction and encapsulation?

What is the precise difference between encapsulation and abstraction?

18 Dec at 08:22

What is a Y-combinator?

A Y-combinator is a computer science concept from the “functional” side of things. Most programmers don't know much at all about combinators, if they've even heard about them. - - - -

What is the difference between np.array() and np.asarray()?

What is the difference between NumPy's [np.array](https://numpy.org/doc/stable/reference/generated/numpy.array.html#numpy.array) and [np.asarray](https://numpy.org/doc/stable/reference/generated/numpy...

30 Jul at 06:13

How do I use OpenFileDialog to select a folder?

I was going to use the following project: [https://github.com/scottwis/OpenFileOrFolderDialog](https://github.com/scottwis/OpenFileOrFolderDialog) However, there's a problem: it uses the `GetOpenFileN...