Getting "conflicting types for function" in C, why?
I'm using the below code: ``` char dest[5]; char src[5] = "test"; printf("String: %s\n", do_something(dest, src)); char *do_something(char *dest, const char *src) { return dest; } ``` The imp...
What is the difference between URI, URL and URN?
What's the difference between an URI, URL and URN? I have read a lot of sites (even Wikipedia) but I don't understand it. URI: [http://www.foo.com/bar.html](http://www.foo.com/bar.html) URL: [http://...
How to check if a string contains text from an array of substrings in JavaScript?
Pretty straight forward. In javascript, I need to check if a string contains any substrings held in an array.
- Modified
- 21 Sep at 07:0
Specifying Font and Size in HTML table
I am trying to specify the Font Face and Size for text in a table. It seems to respect the FACE= but ignores the SIZE=. For example, I have the HTML shown below. It correctly displays the text in Co...
Finding a substring within a list in Python
### Background: Example list: `mylist = ['abc123', 'def456', 'ghi789']` I want to retrieve an element if there's a match for a substring, like `abc` ### Code: ``` sub = 'abc' print any(sub in my...
Solution to "subquery returns more than 1 row" error
I have one query that returns multiple rows, and another query in which I want to set criteria to be either one of values from those multiple rows , so basicly I want the subquery to look something li...
- Modified
- 27 Jan at 13:17
Save results to csv file with Python
``` import csv with open('test.csv', 'rb') as f: data = list(csv.reader(f)) import collections counter = collections.defaultdict(int) for row in data: counter[row[1]] += 1 for row in data: ...
What is the correct syntax for 'else if'?
I'm a new Python programmer who is making the leap from 2.6.4 to 3.1.1. Everything has gone fine until I tried to use the 'else if' statement. The interpreter gives me a syntax error after the 'if' in...
- Modified
- 5 Mar at 15:3
Generate Java classes from .XSD files...?
I have a gigantic QuickBooks SDK .XSD schema file which defines XML requests/responses that I can send/receive from QuickBooks. I'd like to be able to easily generate Java classes from these .XSD fil...
android.view.InflateException: Binary XML file line #12: Error inflating class <unknown>
I am receiving many errors of kind displayed in the subj. These errors seems to be occasional and I cannot reproduce them. From stack I can learn that such error may occurs for my different layout res...
- Modified
- 16 Oct at 23:17
How do I increase the cell width of the Jupyter/ipython notebook in my browser?
I would like to increase the width of the ipython notebook in my browser. I have a high-resolution screen, and I would like to expand the cell width/size to make use of this extra space. Thanks! --- ...
- Modified
- 15 Nov at 14:22
The resource could not be loaded because the App Transport Security policy requires the use of a secure connection
I am facing the Problem when I have updated my Xcode to 7.0 or iOS 9.0. Somehow it started giving me the Titled error > "The resource could not be loaded because the App Transport Security policy r...
- Modified
- 23 May at 11:47
Get multiple elements by Id
I have a page with anchor tags throughout the body like this: ``` <a id="test" name="Name 1"></a> <a id="test" name="Name 2"></a> <a id="test" name="Name 3"></a> ``` The ID is always the same but t...
- Modified
- 14 Jun at 00:19
Negation in Python
I'm trying to create a directory if the path doesn't exist, but the ! (not) operator doesn't work. I'm not sure how to negate in Python... What's the correct way to do this? ``` if (!os.path.exists("...
Programmatically navigate using react router V4
I have just replaced `react-router` from v3 to v4. But I am not sure how to programmatically navigate in the member function of a `Component`. i.e in `handleClick()` function I want to navigate to `/p...
- Modified
- 2 Nov at 03:35
mongodb service is not starting up
I've installed the mongodb 2.0.3, using the mongodb-10gen debian package. Everything went well, except the service which is installed by default is not starting up when computer starts. The `mongod` i...
- Modified
- 27 Mar at 07:4
Declaring a boolean in JavaScript using just var
If I declare a JavaScript boolean variable like this: ``` var IsLoggedIn; ``` And then initialize it with either `true` or `1`, is that safe? Or will initializing it with `1` make the variable a n...
- Modified
- 12 Jan at 05:36
Center HTML Input Text Field Placeholder
How can I centre the input field's placeholder's alignment in a html form? I am using the following code, but it doesn't work: CSS -> ``` input.placeholder { text-align: center; } .emailField {...
Find p-value (significance) in scikit-learn LinearRegression
How can I find the p-value (significance) of each coefficient? ``` lm = sklearn.linear_model.LinearRegression() lm.fit(x,y) ```
- Modified
- 8 Sep at 06:49
Change line width of lines in matplotlib pyplot legend
I would like to change the thickness/width of the line samples featured in the pyplot legend. Line width of line samples within legend are the same as the lines they represent in the plot (so if line ...
- Modified
- 18 Jun at 09:6
Printf width specifier to maintain precision of floating-point value
Is there a `printf` width specifier which can be applied to a floating point specifier that would automatically format the output to the necessary number of such that when scanning the string back in...
- Modified
- 23 May at 12:2
what is right way to do API call in react js?
I have recently moved from Angular to ReactJs. I am using jQuery for API calls. I have an API which returns a random user list that is to be printed in a list. I am not sure how to write my API calls...
- Modified
- 12 May at 10:50
How do you use "git --bare init" repository?
I need to create a central Git repository but I'm a little confused... I have created a bare repository (in my git server, machine 2) with: ``` $ mkdir test_repo $ git --bare init ``` Now I need t...
- Modified
- 15 Nov at 20:3
Filtering collections in C#
I am looking for a very fast way to filter down a collection in C#. I am currently using generic `List<object>` collections, but am open to using other structures if they perform better. Currently, I...
- Modified
- 11 Jan at 12:55
Difference between jQuery’s .hide() and setting CSS to display: none
Which am I better off doing? `.hide()` is quicker than writing out `.css("display", "none")`, but what’s the difference and what are both of them actually doing to the HTML element?
- Modified
- 14 Aug at 14:2