Questions

Get difference between two lists with Unique Entries

I have two lists in Python: ``` temp1 = ['One', 'Two', 'Three', 'Four'] temp2 = ['One', 'Two'] ``` Assuming the elements in each list are unique, I want to create a third list with items from the fir...

Global Git ignore

I want to set up Git to globally ignore certain files. I have added a `.gitignore` file to my home directory (`/Users/me/`) and I have added the following line to it: ``` *.tmproj ``` But it is no...

3 Aug at 17:8

How to pass command line arguments to a rake task

I have a rake task that needs to insert a value into multiple databases. I'd like to pass this value into the rake task from the command line, or from rake task. How can I do this?

Can't create handler inside thread that has not called Looper.prepare()

What does the following exception mean; how can I fix it? This is the code: ``` Toast toast = Toast.makeText(mContext, "Something", Toast.LENGTH_SHORT); ``` This is the exception: ``` java.lang.R...

29 Jun at 15:37

What is the maximum length of a valid email address?

What is the maximum length of a valid email address? Is it defined by any standard?

7 Jan at 14:17

How can I do Base64 encoding in Node.js?

Does Node.js have built-in Base64 encoding yet? The reason why I ask this is that `final()` from `crypto` can only output hexadecimal, binary or ASCII data. For example: ``` var cipher = crypto.create...

1 Aug at 22:11

What is the difference between statically typed and dynamically typed languages?

What does it mean when we say a language is dynamically typed versus statically typed?

How to prevent buttons from submitting forms

In the following page, with Firefox the remove button submits the form, but the add button does not. How do I prevent the `remove` button from submitting the form? ``` function addItem() { var v = $...

24 Jul at 20:58

findViewById in Fragment

I am trying to create an ImageView in a Fragment which will refer to the ImageView element which I have created in the XML for the Fragment. However, the `findViewById` method only works if I extend a...

How to apply CSS to iframe?

I have a simple page that has some iframe sections (to display RSS links). How can I apply the same CSS format from the main page to the page displayed in the iframe?

16 Dec at 04:55

Propagate all arguments in a Bash shell script

I am writing a very simple script that calls another script, and I need to propagate the parameters from my current script to the script I am executing. For instance, my script name is `foo.sh` and ca...

17 Sep at 12:33

Selecting element by data attribute with jQuery

Is there an easy and straight-forward method to select elements based on their `data` attribute? For example, select all anchors that has data attribute named `customerID` which has value of `22`. ...

10 Feb at 14:36

How do I install a Python package with a .whl file?

I'm having trouble installing a Python package on my Windows machine, and would like to install it with Christoph Gohlke's Window binaries. (Which, to my experience, alleviated much of the fuss for ma...

15 Feb at 13:54

"Large data" workflows using pandas

I have tried to puzzle out an answer to this question for many months while learning pandas. I use SAS for my day-to-day work and it is great for it's out-of-core support. However, SAS is horrible a...

7 Dec at 19:53

React-router URLs don't work when refreshing or writing manually

I'm using React-router and it works fine while I'm clicking on link buttons, but when I refresh my webpage it does not load what I want. For instance, I am in `localhost/joblist` and everything is fin...

6 May at 13:49

Android "Only the original thread that created a view hierarchy can touch its views."

I've built a simple music player in Android. The view for each song contains a SeekBar, implemented like this: ``` public class Song extends Activity implements OnClickListener,Runnable { privat...

10 Dec at 17:10

What is the difference between --save and --save-dev?

What is the difference between: ``` npm install [package_name] ``` and: ``` npm install [package_name] --save ``` and: ``` npm install [package_name] --save-dev ``` What does this mean? And what is...

20 Sep at 06:45

How do I import other Python files?

How do I import files in Python? I want to import: 1. a file (e.g. file.py) 2. a folder 3. a file dynamically at runtime, based on user input 4. one specific part of a file (e.g. a single function) ...

Git replacing LF with CRLF

On a Windows machine, I added some files using `git add`. I got warnings saying: > LF will be replaced by CRLF What are the ramifications of this conversion?

Converting an object to a string

How can I convert a JavaScript object into a string? Example: ``` var o = {a:1, b:2} console.log(o) console.log('Item: ' + o) ``` Output: > Object { a=1, b=2} // very nice readable output :) It...

SQL Update from One Table to Another Based on a ID Match

I have a database with `account numbers` and `card numbers`. I match these to a file to `update` any card numbers to the account number so that I am only working with account numbers. I created a view...

23 May at 16:50

Create Git branch with current changes

I started working on my branch thinking that my task would be easy. After a while I realized it would take more work and I want to do all this work in a new branch. How can I create a new branch a...

11 Apr at 11:40

How to create a checkbox with a clickable label?

How can I create an HTML checkbox with a label that is clickable (this means that clicking on the label turns the checkbox on/off)?

11 Jun at 14:25

How to mock void methods with Mockito

How to mock methods with void return type? I implemented an observer pattern but I can't mock it with Mockito because I don't know how. And I tried to find an example on the Internet but didn't suc...

21 Oct at 10:41

Maximum request length exceeded.

I am getting the error when I am trying to upload a video in my site. How do I fix this?

20 Nov at 17:29