Questions

If Python is interpreted, what are .pyc files?

Python is an interpreted language. But why does my source directory contain `.pyc` files, which are identified by Windows as "Compiled Python Files"?

Is there a way to include commas in CSV columns without breaking the formatting?

I've got a two column CSV with a name and a number. Some people's name use commas, for example `Joe Blow, CFA.` This comma breaks the CSV format, since it's interpreted as a new column. I've read up ...

17 Jan at 09:3

Why are #ifndef and #define used in C++ header files?

I have been seeing code like this usually in the start of header files: ``` #ifndef HEADERFILE_H #define HEADERFILE_H ``` And at the end of the file is ``` #endif ``` What is the purpose of this...

25 Jul at 01:41

How to run Selenium WebDriver test cases in Chrome

I tried this ``` WebDriver driver = new ChromeDriver(); ``` But I'm getting the error as > Failed tests: setUp(com.TEST): The path to the driver executable must be set by the webdriver.chrome.drive...

forEach is not a function error with JavaScript array

I'm trying to make a simple loop: ``` const parent = this.el.parentElement console.log(parent.children) parent.children.forEach(child => { console.log(child) }) ``` But I get the following error:...

13 Mar at 12:21

Java Byte Array to String to Byte Array

I'm trying to understand a byte[] to string, string representation of byte[] to byte[] conversion... I convert my byte[] to a string to send, I then expect my web service (written in python) to echo t...

13 Jul at 19:48

Android SDK location

I have Xamarin Studio, and I need to specify the Android SDK Location. I have previously had Xamarin Studio working on my pc, and for some reason, I need to enter this again. I have entered the follo...

6 Apr at 14:54

Inserting HTML into a div

I am trying to insert a chunk of HTML into a div. I want to see if plain JavaScript way is faster than using jQuery. Unfortunately, I forgot how to do it the 'old' way. :P ``` var test2 = function(){ ...

15 Apr at 10:22

Check substring exists in a string in C

I'm trying to check whether a string contains a substring in C like: ``` char *sent = "this is my sample example"; char *word = "sample"; if (/* sentence contains word */) { /* .. */ } ``` What...

2 Jun at 17:46

How to list npm user-installed packages

How do I list the user-installed / environment package in npm? When I do `npm -g list`, it outputs every package and their dependencies. Instead I'd like to see the packages installed in the working...

How to make an Android Spinner with initial text "Select One"?

I want to use a Spinner that initially (when the user has not made a selection yet) displays the text "Select One". When the user clicks the spinner, the list of items is displayed and the user select...

2 May at 06:48

ModuleNotFoundError: No module named 'sklearn'

I want to import sklearn but there is no module apparently: ``` ModuleNotFoundError: No module named 'sklearn' ``` I am using Anaconda and `Python 3.6.1`; I have checked everywhere but still can't ...

Oracle: If Table Exists

I'm writing some migration scripts for an Oracle database, and was hoping Oracle had something similar to MySQL's `IF EXISTS` construct. Specifically, whenever I want to drop a table in MySQL, I do s...

13 Dec at 12:59

What do two question marks together mean in C#?

Ran across this line of code: ``` FormsAuth = formsAuth ?? new FormsAuthenticationWrapper(); ``` What do the two question marks mean, is it some kind of ternary operator? It's hard to look up in Go...

3 Apr at 11:10

There is already an open DataReader associated with this Command which must be closed first

I have this query and I get the error in this function: ``` var accounts = from account in context.Accounts from guranteer in account.Gurantors select new AccountsReport...

Any shortcut to initialize all array elements to zero?

In `C/C++` I used to do ``` int arr[10] = {0}; ``` ...to initialize all my array elements to 0. Is there a similar shortcut in Java? I want to avoid using the loop, is it possible? ``` int arr[...

20 Dec at 18:38

What is %2C in a URL?

In a URL, what does the `%2C` encoding mean and what are its uses?

9 Jun at 06:43

How do I declare a namespace in JavaScript?

How do I create a namespace in JavaScript so that my objects and functions aren't overwritten by other same-named objects and functions? I've used the following: ``` if (Foo == null || typeof(Foo) !=...

What is the best project structure for a Python application?

Imagine that you want to develop a non-trivial end-user desktop (not web) application in Python. What is the best way to structure the project's folder hierarchy? Desirable features are ease of maint...

Difference between EXISTS and IN in SQL?

What is the difference between the `EXISTS` and `IN` clause in SQL? When should we use `EXISTS`, and when should we use `IN`?

5 Feb at 15:58

Check if multiple strings exist in another string

How can I check if any of the strings in an array exists in another string? For example: ``` a = ['a', 'b', 'c'] s = "a123" if a in s: print("some of the strings found in s") else: print("no s...

14 Jan at 09:55

Add image in title bar

How do I add image in title bar? I have title- "Webnet" Merging it with a FontAwesome Glyphicon's icon images as- ``` <title><i class="icon-user icon-black"></i>Webnet</title> ``` And I tried it...

How to enable PHP short tags?

I have a web application on a Linux server which starts with `<?` I needed to copy this application to a windows environment and everything is working fine except that an SQL statement is being rende...

12 May at 15:41

How to fix "Attempted relative import in non-package" even with __init__.py

I'm trying to follow [PEP 328](http://www.python.org/dev/peps/pep-0328/), with the following directory structure: ``` pkg/ __init__.py components/ core.py __init__.py tests/ core_te...

HTML - Display image after selecting filename

I have a form that allows me with ``` <input type="file" name="filename" accept="image/gif, image/jpeg, image/png"> ``` to browse and select a file. What I want to do is display that image immedi...

23 May at 12:2