Questions

What is AF_INET, and why do I need it?

I'm getting started on socket programming, and I keep seeing this `AF_INET`. Yet, I've never seen anything else used in its place. My lecturers are not that helpful and just say "You just need it". ...

13 Jul at 07:24

How does numpy.histogram() work?

While reading up on numpy, I encountered the function [numpy.histogram()](http://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram.html). What is it for and In the docs they mention : Wha...

29 Aug at 20:52

what do <form action="#"> and <form method="post" action="#"> do?

I'm reading a book on html development (which I'm fairly new at) and despite the fact that the book just had its 1st publishing one month ago (Nov. 2011), the author is an experienced coder and maybe ...

19 Sep at 11:49

How to Copy Text to Clip Board in Android?

Can anybody please tell me how to copy the text present in a particular textview to clipboard when a button is pressed? ``` @Override protected void onCreate(Bundle savedInstanceState) { super.onC...

Sql connection-string for localhost server

I am newbie in this .NET and please don't mind in answering my simple question. I am trying to write a windows application, where in I am using a localhost SQLserver for database. I need to know what...

27 Dec at 11:25

How to use PHP OPCache?

PHP 5.5 has been released and it features a new code caching module called OPCache, but there doesn't appear to be any documentation for it. So where is the documentation for it and how do I use OPc...

20 Jun at 22:31

Powershell: A positional parameter cannot be found that accepts argument "xxx"

I am trying to understand what this error actually means. So far a search of similar help requests for this error range from missing parameters, missing pipes, use of single or multi-lines, and also c...

16 Jan at 16:4

CSS to keep element at "fixed" position on screen

I'm looking for a trick to create a "fixed" HTML object on the browser screen using CSS. I want it to stay in the same position all the time, even when the user scrolls through the document. I'm not s...

27 Sep at 22:18

Is HTML considered a programming language?

I guess the question is self-explanatory, but I'm wondering whether HTML qualifies as a programming language (obviously the "L" stands for language). The reason for asking is more pragmatic—I'm put...

21 May at 18:42

How to resolve Unneccessary Stubbing exception

My Code is as below, ``` @RunWith(MockitoJUnitRunner.class) public class MyClass { private static final String code ="Test"; @Mock private MyClassDAO dao; @InjectMocks priva...

29 May at 23:32

Explicit casting from super-class to sub-class

``` public class Animal { public void eat() {} } public class Dog extends Animal { public void eat() {} public void main(String[] args) { Animal animal = new Animal(); Do...

5 Jan at 12:41

Convert unix time to readable date in pandas dataframe

I have a dataframe with unix times and prices in it. I want to convert the index column so that it shows in human readable dates. So for instance I have `date` as `1349633705` in the index column bu...

Error when creating a new text file with python?

This function doesn't work and raises an error. Do I need to change any arguments or parameters? ``` import sys def write(): print('Creating new text file') name = input('Enter name of t...

1 Jun at 15:4

Get host domain from URL?

how to get host domain from a string URL? GetDomain has 1 input "URL", 1 Output "Domain" Example1 ``` INPUT: http://support.domain.com/default.aspx?id=12345 OUTPUT: support.domain.com ``` Example...

8 Jan at 10:42

Android Studio: Where is the Compiler Error Output Window?

When I 'Run' my project in Android Studio, in the 'Messages' window, I get: ``` Gradle: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':play01:compileDebug'....

16 Dec at 05:22

Creating random colour in Java?

I want to draw random coloured points on a JPanel in a Java application. Is there any method to create random colours?

19 Jan at 17:59

How can I find the first occurrence of a sub-string in a python string?

Given the string "the dude is a cool dude", I'd like to find the first index of 'dude': ``` mystring.findfirstindex('dude') # should return 4 ``` What is the python command for this?

25 Feb at 21:42

Font awesome is not showing icon

I am using Font Awesome and do not wish to add CSS with HTTP. I downloaded Font Awesome and included it in my code, yet Font Awesome is showing a bordered square box instead of an icon. Here is my cod...

13 Dec at 17:24

How do I check if file exists in Makefile so I can delete it?

In the clean section of my `Makefile` I am trying to check if the file exists before deleting permanently. I use this code but I receive errors. What's wrong with it? ``` if [ -a myApp ] then rm...

29 Mar at 07:25

How can I deploy an iPhone application from Xcode to a real iPhone device?

How can I deploy an iPhone application from Xcode to real iPhone device without having a US$99 Apple certificate?

4 Jun at 00:56

JS file gets a net::ERR_ABORTED 404 (Not Found)

I am trying to create a simple Io-web-chat. I recently wanted to seperate my `<script>` inside my html file to an external js file. ``` Chat |-- index.html |-- index.js `-- server.js ``` ``` <...

13 Jan at 21:41

Docker error response from daemon: "Conflict ... already in use by container"

I've been using Docker on my PC to run Quantum GIS with the following instructions I've found here: [docker-qgis-desktop - A simple docker container that runs QGIS desktop](https://registry.hub.docker...

27 Dec at 14:36

How to use UTF-8 in resource properties with ResourceBundle

I need to use UTF-8 in my resource properties using Java's `ResourceBundle`. When I enter the text directly into the properties file, it displays as mojibake. My app runs on Google App Engine. Can a...

Reverse colormap in matplotlib

I would like to know how to simply reverse the color order of a given colormap in order to use it with plot_surface.

23 Jul at 14:31

How to loop through all but the last item of a list?

I would like to loop through a list checking each item against the one following it. Is there a way I can loop through all but the last item using for x in y? I would prefer to do it without using in...

23 Apr at 22:27