Questions

Importing a function from a class in another file?

I'm writing a Python program for fun but got stuck trying to import a function from a class in another file. Here is my code: ``` #jurassic park mainframe from random import randint from sys import ...

9 Nov at 21:13

css transition opacity fade background

I am doing a `transition` where it fades into transparent white, when a user is hovering an image. My problem is that I need to change the color, that it fades to, to black. I have tried just simply...

28 May at 21:22

javax.net.ssl.SSLException: Received fatal alert: protocol_version

Has anyone encountered this error before? I'm new to SSL, is there anything obviously wrong with my ClientHello that I'm missing? That exception is thrown with no ServerHello response. Any advice i...

5 May at 03:17

How to show a dialog to confirm that the user wishes to exit an Android Activity?

I've been trying to show a "Do you want to exit?" type of dialog when the user attempts to exit an Activity. However I can't find the appropriate API hooks. `Activity.onUserLeaveHint()` initially ...

Check an integer value is Null in c#

I have got an integer value and i need to check if it is NULL or not. I got it using a null-coalescing operator C#: ``` public int? Age; if ((Age ?? 0)==0) { // do somethig } ``` Now i have to...

7 Oct at 14:47

How can I pass a member function where a free function is expected?

The question is the following: consider this piece of code: ``` #include <iostream> class aClass { public: void aTest(int a, int b) { printf("%d + %d = %d", a, b, a + b); } }; v...

Referencing a string in a string array resource with xml

I have preferences where you can enable/disable what items will show up on the menu. There are 17 items. I made a string array in values/arrays.xml with titles for each of these 17 items. I have pr...

How do I import a CSV file in R?

I have a `.csv` file in my workstation. How can I open that file in R and do statistical calculation?

22 Dec at 06:58

How to remove symbols from a string with Python?

I'm a beginner with both Python and RegEx, and I would like to know how to make a string that takes symbols and replaces them with spaces. Any help is great. For example: ``` how much for the maple ...

18 May at 01:55

How do I get client IP address in ASP.NET Core?

Can you please let me know how to get client IP address in ASP.NET when using MVC 6. `Request.ServerVariables["REMOTE_ADDR"]` does not work.

17 Apr at 02:31

How to view the SQL queries issued by JPA?

When my code issues a call like this: ``` entityManager.find(Customer.class, customerID); ``` How can I see the SQL query for this call? Assuming I don't have access to database server to profile/...

26 Sep at 15:18

Using str_replace so that it only acts on the first match?

I want a version of `str_replace()` that only replaces the first occurrence of `$search` in the `$subject`. Is there an easy solution to this, or do I need a hacky solution?

7 May at 15:51

What is a monad?

Having briefly looked at Haskell recently, what would be a explanation as to what a monad essentially is? I have found most explanations I've come across to be fairly inaccessible and lacking in pra...

Java and SQLite

I'm attracted to the neatness that a single file database provides. What driver/connector library is out there to connect and use SQLite with Java. I've discovered a wrapper library, [http://www.ch-w...

3 Sep at 14:56

How to compare times of the day?

I see that date comparisons can be done and there's also `datetime.timedelta()`, but I'm struggling to find out how to check if the current time (`datetime.datetime.now()`) is earlier, later or the sa...

8 Mar at 19:44

Select multiple columns from a table, but group by one

The table name is "OrderDetails" and columns are given below: ``` OrderDetailID || ProductID || ProductName || OrderQuantity ``` I'm trying to select multiple columns and Group By ProductID while h...

6 Oct at 13:23

How to master AngularJS?

I'm pretty new to AngularJS and I find it a bit awkward. The easy stuff is very easy, but the advanced things are significantly harder (directives, provider / service / factory...) The [documentation...

11 Sep at 11:25

angular-cli server - how to proxy API requests to another server?

With the `angular-cli` `ng serve` local dev server, it's serving all the static files from my project directory. How can I proxy my AJAX calls to a different server?

26 Jul at 12:41

LEFT JOIN only first row

I read many threads about getting only the first row of a left join, but, for some reason, this does not work for me. Here is my structure (simplified of course) ``` id | title | content --------...

fatal: does not appear to be a git repository

Why am I getting this error when my Git repository URL is correct? ``` fatal: 'git@skarp.beanstalkapp.com/gittest.git' does not appear to be a git repository fatal: The remote end hung up unexpectedly...

24 Jan at 19:18

docker: Error response from daemon: Get https://registry-1.docker.io/v2/: Service Unavailable. IN DOCKER , MAC

I am having this issue ``` system3:postgres saurabh-gupta2$ docker build -t postgres . Sending build context to Docker daemon 38.91kB Step 1/51 : FROM registry.access.redhat.com/rhel7/rhel Get https:...

30 Jan at 04:16

How do I implement basic "Long Polling"?

I can find lots of information on how Long Polling works (For example, [this](http://jfarcand.wordpress.com/2007/05/15/new-adventures-in-comet-polling-long-polling-or-http-streaming-with-ajax-which-on...

25 Jan at 09:33

tar: add all files and directories in current directory INCLUDING .svn and so on

I try to tar.gz a directory and use ``` tar -czf workspace.tar.gz * ``` The resulting tar includes `.svn` directories in subdirs but NOT in the current directory (as `*` gets expanded to only 'visi...

6 Sep at 14:4

iPhone development on Windows

> [How can I develop for iPhone using a Windows development machine?](https://stackoverflow.com/questions/22358/how-can-i-develop-for-iphone-using-a-windows-development-machine) Is there a way...

23 May at 11:53

How to remove certain characters from a string in C++?

For example I have a user input a phone number. ``` cout << "Enter phone number: "; INPUT: (555) 555-5555 cin >> phone; ``` I want to remove the "(", ")", and "-" characters from the string. I've l...

3 Apr at 17:22