Questions

How do I add default parameters to functions when using type hinting?

If I have a function like this: ``` def foo(name, opts={}): pass ``` And I want to add type hints to the parameters, how do I do it? The way I assumed gives me a syntax error: ``` def foo(name: ...

6 Oct at 13:41

Update Eclipse with Android development tools v. 23

I updated Eclipse with the new SDK tools (rev. 23), but now when Eclipse starts I receive the error: > This Android SDK requires Android Developer Toolkit version 23.0.0 or above. Current version is ...

22 Jan at 19:55

CSS text-overflow: ellipsis; not working?

I don't know why this simple CSS isn't working... ``` .app a { height: 18px; width: 140px; padding: 0; overflow: hidden; position: relative; margin: 0 5px 0 5px; text-align: center; t...

7 Jan at 21:26

Disabling Chrome Autofill

I have been running into issues with the chrome autofill behavior on several forms. The fields in the form all have very common and accurate names, such as "email", "name", or "password", and they a...

CSS text-overflow in a table cell?

I want to use CSS `text-overflow` in a table cell, such that if the text is too long to fit on one line, it will clip with an ellipsis instead of wrapping to multiple lines. Is this possible? I tried...

7 Feb at 01:24

How do I make a splash screen?

I want my app to look more professional, so I decided to add a splash screen. How should I go about the implementation?

1 Apr at 10:10

Which characters make a URL invalid?

Which characters make a URL invalid? Are these valid URLs? - `example.com/file[/].html`- `http://example.com/file[/].html`

4 Apr at 19:25

CSS to make HTML page footer stay at bottom of the page with a minimum height, but not overlap the page

I have the following page (deadlink: `http://www.workingstorage.com/Sample.htm` ) that has a footer which I can't make sit at the bottom of the page. I want the footer to - - The CSS is inherited and...

7 Sep at 13:6

Update all objects in a collection using LINQ

Is there a way to do the following using LINQ? ``` foreach (var c in collection) { c.PropertyToSet = value; } ``` To clarify, I want to iterate through each object in a collection and then upda...

28 Apr at 11:30

What are CN, OU, DC in an LDAP search?

I have a search query in LDAP like this. What exactly does this query mean? ``` ("CN=Dev-India,OU=Distribution Groups,DC=gp,DC=gl,DC=google,DC=com"); ```

21 Feb at 12:8

SHA-1 fingerprint of keystore certificate

Is the method for getting an SHA-1 fingerprint the same as the method of getting the fingerprint? Previously, I was running this command: ![Windows Command Prompt running keytool.exe](https://i.stack....

How to replace NaN values by Zeroes in a column of a Pandas Dataframe?

I have a Pandas Dataframe as below: ``` itm Date Amount 67 420 2012-09-30 00:00:00 65211 68 421 2012-09-09 00:00:00 29424 69 421 2012-09-16 00:00:00 29877 70 421 20...

13 Jul at 16:44

Should composer.lock be committed to version control?

I'm a little confused with `composer.lock` used in an application with a repository. I saw many people saying that we should not `.gitignore` `composer.lock` from the repository. If I update my libr...

15 Dec at 08:10

Make iframe automatically adjust height according to the contents without using scrollbar?

For example: ``` <iframe name="Stack" src="http://stackoverflow.com/" width="740" frameborder="0" scrolling="no" id="iframe"> ... </iframe> ``` I want it to be able to adjust its height acc...

How to sum array of numbers in Ruby?

I have an array of integers. For example: ``` array = [123,321,12389] ``` Is there any nice way to get the sum of them? I know, that ``` sum = 0 array.each { |a| sum+=a } ``` would work.

22 Feb at 03:11

What issues should be considered when overriding equals and hashCode in Java?

What issues / pitfalls must be considered when overriding `equals` and `hashCode`?

11 Aug at 19:2

How to reset the state of a Redux store?

I am using Redux for state management. How do I reset the store to its initial state? For example, let’s say I have two user accounts (`u1` and `u2`). Imagine the following sequence of events: 1. U...

13 May at 03:30

Expansion of variables inside single quotes in a command in Bash

I want to run a command from a which has single quotes and some other commands inside the single quotes and a variable. e.g. `repo forall -c '....$variable'` In this format, `$` is escaped and the ...

16 Feb at 01:7

jQuery.click() vs onClick

I have a huge jQuery application, and I'm using the below two methods for click events. ### HTML ``` <div id="myDiv">Some Content</div> ``` ### jQuery ``` $('#myDiv').click(function(){ ...

SQLite - UPSERT *not* INSERT or REPLACE

[http://en.wikipedia.org/wiki/Upsert](http://en.wikipedia.org/wiki/Upsert) [Insert Update stored proc on SQL Server](https://stackoverflow.com/questions/13540/insert-update-stored-proc-on-sql-server) ...

16 Mar at 10:26

Proper way to make HTML nested list?

The W3 docs have a [nested list example](http://www.w3.org/TR/html401/struct/lists.html#h-10.2) prefixed by `DEPRECATED EXAMPLE:`, but they never corrected it with a non-deprecated example, nor explai...

16 Nov at 13:11

Should you commit .gitignore into the Git repos?

Do you think it is a good practice to commit `.gitignore` into a Git repo? Some people don't like it, but I think it is good as you can track the file's history. Isn't it?

1 Apr at 09:8

Insert new item in array on any position in PHP

How can I insert a new item into an array on any position, for example in the middle of array?

19 Feb at 12:27

Begin, Rescue and Ensure in Ruby?

I've recently started programming in Ruby, and I am looking at exception handling. I was wondering if `ensure` was the Ruby equivalent of `finally` in C#? Should I have: ``` file = File.open("myFile...

PHP, cURL, and HTTP POST example?

Can anyone show me how to do a PHP cURL with an HTTP POST? I want to send data like this: ``` username=user1, password=passuser1, gender=1 ``` To `www.example.com` I expect the cURL to return a respo...

16 Jan at 22:38