Questions

What are file descriptors, explained in simple terms?

1. What would be a more simplified description of file descriptors compared to Wikipedia's? Why are they required? Say, take shell processes as an example and how does it apply for it? 2. Does a proc...

Allow multi-line in EditText view in Android?

How to allow multi-line in Android's `EditText` view?

24 Oct at 11:45

How can I explicitly free memory in Python?

I wrote a Python program that acts on a large input file to create a few million objects representing triangles. The algorithm is: 1. read an input file 2. process the file and create a list of tri...

25 Nov at 20:26

Multiple variables in a 'with' statement?

Is it possible to declare more than one variable using a `with` statement in Python? Something like: ``` from __future__ import with_statement with open("out.txt","wt"), open("in.txt") as file_out,...

14 Jan at 14:29

Command Line Tools not working - OS X El Capitan, Sierra, High Sierra, Mojave

I just upgraded from Yosemite to El Capitan (and replicated the problem upgrading from El Capitan to Sierra), and when I try to type for example `git status` inside a terminal, I get the following err...

Eclipse: Set maximum line length for auto formatting?

I am working with Java. If I hit ++ in Eclipse Helios, it will auto format my code. At a certain point, it wraps lines. I would like to increase the maximum line length. How can I do this?

3 Feb at 16:52

Regex to match only letters

How can I write a regex that matches only letters?

20 Jan at 05:19

Install a Python package into a different directory using pip?

I know the obvious answer is to use virtualenv and virtualenvwrapper, but for various reasons I can't/don't want to do that. So how do I modify the command ``` pip install package_name ``` to make...

8 Dec at 20:51

Maximum length of HTTP GET request

What's the maximum length of an HTTP [GET](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods) request? Is there a response error defined that the server can/should return if i...

22 Jan at 23:34

Cannot truncate table because it is being referenced by a FOREIGN KEY constraint?

Using MSSQL2005, can I truncate a table with a foreign key constraint if I first truncate the child table (the table with the primary key of the FK relationship)? I know that I can either - `DELETE`...

How can I remove an entry in global configuration with git config?

I ran a global configuration command in to exclude certain files using a `.gitignore_global` file: ``` git config --global core.excludesfile ~/.gitignore_global ``` Is there a way to undo the creati...

7 Oct at 06:47

`require': no such file to load -- mkmf (LoadError)

I was trying to install rails on Ubuntu Natty Narwhal 11.04, using ruby1.9.1. I installed ruby using `apt-get install ruby1.9.1-full` which contains the dev package. I googled the error and all have ...

23 Jan at 00:15

Get the short Git version hash

Is there a cleaner way to get the short version hash of `HEAD` from Git? I want to see the same output as I get from: ``` git log -n 1 | head -n 1 | sed -e 's/^commit //' | head -c 8 ``` --- I...

1 Apr at 08:9

JSON Naming Convention (snake_case, camelCase or PascalCase)

Is there a standard on JSON naming?I see most examples using all lower case separated by underscore, aka `snake_case`, but can it be used `PascalCase` or `camelCase` as well?

Git add and commit in one command

Is there any way I can do ``` git add -A git commit -m "commit message" ``` in one command? I seem to be doing those two commands a lot, and if Git had an option like `git commit -Am "commit mess...

25 Sep at 20:21

Logout: GET or POST?

it is about which is the recommended one for handling logging out of a web application. I have found plenty of information on the differences between GET and POST in the general sense, but I did not ...

19 Aug at 13:2

How to load an ImageView by URL in Android?

How do you use an image referenced by URL in an `ImageView`?

28 Jan at 16:49

Is there a way to collapse all code blocks in Eclipse?

Eclipse has that "+/-" on the left to expand and collapse blocks of code. I've got tens of thousands of lines to go through and would really like to just collapse everything, and selectively expand b...

20 Dec at 19:16

How to import existing Git repository into another?

I have a Git repository in a folder called , and I have second Git repository called . I want to import the repository into the repository as a subdirectory named and add all 's change history to ...

23 Nov at 07:39

Linux: copy and create destination dir if it does not exist

I want a command (or probably an option to cp) that creates the destination directory if it does not exist. Example: ``` cp -? file /path/to/copy/file/to/is/very/deep/there ```

15 Sep at 23:13

How to call a SOAP web service on Android

I am having a lot of trouble finding good information on how to call a standard SOAP/WSDL web service with Android. All I've been able to find are either very convoluted documents and references to "k...

29 Nov at 00:13

React Native android build failed. SDK location not found

I have error when i start running android ``` What went wrong: A problem occurred evaluating project ':app'. > SDK location not found. Define location with sdk.dir in the local.properties file or w...

21 Nov at 00:12

How do I set the value property in AngularJS' ng-options?

Here is what seems to be bothering a lot of people (including me). When using the `ng-options` directive in AngularJS to fill in the options for a `<select>` tag, I cannot figure out how to set the v...

7 Jan at 13:2

How to zero pad a sequence of integers in bash so that all have the same width?

I need to loop some values, ``` for i in $(seq $first $last) do does something here done ``` For `$first` and `$last`, I need it to be of fixed length 5. So if the input is `1`, I need to add zer...

20 Jan at 22:2