Questions

What's the fastest way to do a bulk insert into Postgres?

I need to programmatically insert tens of millions of records into a Postgres database. Presently, I'm executing thousands of insert statements in a single query. Is there a better way to do this, som...

Html.ActionLink as a button or an image, not a link

In the latest (RC1) release of ASP.NET MVC, how do I get Html.ActionLink to render as a button or an image instead of a link?

11 Oct at 00:24

What is the difference between private and protected members of C++ classes?

What is the difference between `private` and `protected` members in C++ classes? I understand from best practice conventions that variables and functions which are not called outside the class should ...

8 Dec at 09:51

How to get method parameter names?

Given that a function `a_method` has been defined like ``` def a_method(arg1, arg2): pass ``` Starting from `a_method` itself, how can I get the argument names - for example, as a tuple of string...

Why use the 'ref' keyword when passing an object?

If I am passing an object to a method, why should I use the ref keyword? Isn't this the default behaviour anyway? For example: ``` class Program { static void Main(string[] args) { T...

27 May at 17:9

What is C# analog of C++ std::pair?

I'm interested: What is C#'s analog of `std::pair` in C++? I found `System.Web.UI.Pair` class, but I'd prefer something template-based. Thank you!

Difference between textContent vs innerText

What is the difference between `textContent` and `innerText` in JavaScript? Can I use `textContent` as follows: ``` var logo$ = document.getElementsByClassName('logo')[0]; logo$.textContent = "Exam...

7 Sep at 00:34

How to change line width in IntelliJ (from 120 character)

I was wondering how I can change the line length in IntelliJ. Since I use a pretty high resolution, I get that line that shows 120 characters straight through the middle of the screen. Can I change ...

25 Nov at 18:23

Better way to sum a property value in an array

I have something like this: ``` $scope.traveler = [ { description: 'Senior', Amount: 50}, { description: 'Senior', Amount: 50}, { description: 'Adult', Amount: 7...

JavaScript click event listener on class

I'm currently trying to write some JavaScript to get the attribute of the class that has been clicked. I know that to do this the correct way, I should use an event listener. My code is as follows: ...

3 Sep at 08:32

Creating folders inside a GitHub repository without using Git

I want to add a new folder to my newly created GitHub repository without installing the Git setup for (Mac, Linux, and Windows). Is it possible to do so? I can't have Git all the time with me when I ...

6 Oct at 13:1

How do I find out which keystore was used to sign an app?

I have an app which is signed and several keystore files. I'd like to update the app, so I need to find out which one of keys was used. How can I match which keystore was used to originally sign my a...

How do I remove the default link color of the html hyperlink 'a' tag?

The default link color is blue. How do I remove the default link color of the html hyperlink tag `<a>`?

8 Dec at 01:34

Returning a file to View/Download in ASP.NET MVC

I'm encountering a problem sending files stored in a database back to the user in ASP.NET MVC. What I want is a view listing two links, one to view the file and let the mimetype sent to the browser de...

Where to put default parameter value in C++?

What's the place for the default parameter value? Just in function definition, or declaration, or both places?

10 May at 14:2

How to return a result from a VBA function

How do I return a result from a function? For example: ``` Public Function test() As Integer return 1 End Function ``` This gives a compile error. How do I make this function return an intege...

How to read the output from git diff?

The man page for `git-diff` is rather long, and explains many cases which don't seem to be necessary for a beginner. For example: ``` git diff origin/master ```

1 Sep at 05:6

Why doesn't Python have a sign function?

I can't understand why Python doesn't have a `sign` function. It has an `abs` builtin (which I consider `sign`'s sister), but no `sign`. In python 2.6 there is even a `copysign` function (in [math](h...

29 Jul at 17:2

Get img thumbnails from Vimeo?

I want to get a thumbnail image for videos from Vimeo. When getting images from Youtube I just do like this: ``` http://img.youtube.com/vi/HwP5NG-3e8I/2.jpg ``` Any idea how to do for Vimeo? [Her...

23 May at 12:26

Send HTML emails with Python

How to send HTML content in email using Python? I can send simple texts.

6 Apr at 00:50

NSString property: copy or retain?

Let's say I have a class called `SomeClass` with a `string` property name: ``` @interface SomeClass : NSObject { NSString* name; } @property (nonatomic, retain) NSString* name; @end ``` I und...

30 Sep at 09:25

Comparison of C++ unit test frameworks

I know there are already a few questions regarding recommendations for C++ unit test frameworks, but all the answers did not help as they just recommend one of the frameworks but do not provide any in...

Java and SQLite

I'm attracted to the neatness that a single file database provides. What driver/connector library is out there to connect and use SQLite with Java. I've discovered a wrapper library, [http://www.ch-w...

3 Sep at 14:56

Default interface methods are only supported starting with Android 7.0 (Nougat)

I upgraded to Android Studio 3.1 and I'm getting the following error: > Default interface methods are only supported starting with Android N (--min-api 24): void android.arch.lifecycle.DefaultLifecycl...

10 May at 14:53

Correct way to install psql without full Postgres on macOS?

[Official page](https://www.postgresql.org/download/macosx) do not mention such case. But many users need only `psql` without a local database (I have it on AWS). Brew do not have `psql`.

20 Jun at 13:18