Questions

Find full path of the Python interpreter?

How do I find the full path of the currently running Python interpreter from within the currently executing Python script?

16 Oct at 08:58

Get an object's class name at runtime

Is it possible to get an object's class/type name at runtime using TypeScript? ``` class MyClass{} var instance = new MyClass(); console.log(instance.????); // Should output "MyClass" ```

6 Jun at 22:28

JavaScript replace/regex

Given this function: ``` function Repeater(template) { var repeater = { markup: template, replace: function(pattern, value) { this.markup = this.markup.replace(patt...

30 Jun at 15:58

Add number of days to a date

I want to add number of days to current date: I am using following code: ``` $i=30; echo $date = strtotime(date("Y-m-d", strtotime($date)) . " +".$i."days"); ``` But instead of getting proper date...

20 May at 10:38

How to save an HTML5 Canvas as an image on a server?

I'm working on a generative art project where I would like to allow users to save the resulting images from an algorithm. The general idea is: - - - However, I’m stuck on the second step. After som...

10 Aug at 22:8

How to completely uninstall Android Studio on Mac?

I recently downloaded Android Studio on my Macbook Pro and I messed up with it every time I open it. It gives me plugin errors and several other errors. I need to uninstall it completely from my mac. ...

22 Oct at 14:42

Pods stuck in Terminating status

I tried to delete a `ReplicationController` with 12 pods and I could see that some of the pods are stuck in `Terminating` status. My Kubernetes cluster consists of one control plane node and three w...

14 Feb at 23:8

How do I trim leading/trailing whitespace in a standard way?

Is there a clean, preferably standard method of trimming leading and trailing whitespace from a string in C? I'd roll my own, but I would think this is a common problem with an equally common solution...

23 Aug at 02:9

Interface defining a constructor signature?

It's weird that this is the first time I've bumped into this problem, but: How do you define a constructor in a C# interface? Some people wanted an example (it's a free time project, so yes, it's a...

14 Jul at 19:52

Visual Studio Code, #include <stdio.h> saying "Add include path to settings"

I'm trying to build C/C++ in Visual Studio Code. I installed C/C++ and all the relevant extensions. ``` #include <stdio.h> int main() { printf("Test C now\n"); return 0; } ``` But there's a...

25 Aug at 21:51

How to listen for a WebView finishing loading a URL?

I have a `WebView` that is loading a page from the Internet. I want to show a `ProgressBar` until the loading is complete. How do I listen for the completion of page loading of a [WebView](http://de...

3 Aug at 07:55

How to make MySQL table primary key auto increment with some prefix

I have table like this ``` table id Varchar(45) NOT NULL AUTO_INCREMENT PRIMARY KEY, name CHAR(30) NOT NULL, ``` I want to increment my id field like `'LHPL001','LHPL002','LHPL003'`... etc. What sh...

10 Jul at 21:51

How to reset (clear) form through JavaScript?

I have tried `$("#client.frm").reset();` but it is not working.So how to reset form via jQuery?

16 Jan at 11:58

How to determine CPU and memory consumption from inside a process

I once had the task of determining the following performance parameters from inside a running application: - - - --- - - - --- - - The code had to run on Windows and Linux. Even though this seems...

5 Jul at 11:49

How to read values from the querystring with ASP.NET Core?

I'm building one RESTful API using ASP.NET Core MVC and I want to use querystring parameters to specify filtering and paging on a resource that returns a collection. In that case, I need to read the ...

How do you sign a Certificate Signing Request with your Certification Authority?

During my search, I found several ways of signing a SSL Certificate Signing Request: 1. Using the x509 module: openssl x509 -req -days 360 -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -ou...

29 Dec at 16:2

Pandas: drop a level from a multi-level column index?

If I've got a multi-level column index: ``` >>> cols = pd.MultiIndex.from_tuples([("a", "b"), ("a", "c")]) >>> pd.DataFrame([[1,2], [3,4]], columns=cols) ``` How can I drop the "a" level of that ...

6 Mar at 18:58

Can I have multiple background images using CSS?

Is it possible to have two background images? For instance, I'd like to have one image repeat across the top (repeat-x), and another repeat across the entire page (repeat), where the one across the e...

26 Sep at 00:12

Module not found: Error: Can't resolve 'fs' in

Oke, I upgraded Angular from 6 to 8. But I stil get errors. I found on internet a solution that for a lot of users helped. But in this case it doesn't helped me. So my package.json file looks like thi...

26 Oct at 08:24

Read Numeric Data from a Text File in C++

For example, if data in an external text file is like this: ``` 45.78 67.90 87 34.89 346 0.98 ``` How can I read this text file and assign each number to a variable in c++? Using ifstream...

19 Jun at 11:46

Reordering Chart Data Series

How does one reorder series used to create a chart in Excel? For example, I go to the chart, right click > Select Data. In the left column I see series 1, series 2, to series n. Say, I want to move...

31 Dec at 04:59

Post parameter is always null

Since upgrading to RC for WebAPI I'm having some real odd issue when calling POST on my WebAPI. I've even gone back to the basic version generated on new project. So: ``` public void Post(string valu...

When to use "ON UPDATE CASCADE"

I use `ON DELETE CASCADE` regularly but I never use `ON UPDATE CASCADE` as I am not so sure in what situation it will be useful. For the sake of discussion let see some code. ``` CREATE TABLE parent (...

28 Dec at 16:52

Remote Debugging for Chrome iOS (and Safari)

With the recent release of Chrome for iOS, I was wondering how do you enable remote debugging for Chrome iOS? Update: With the release of iOS 6, remote debugging can now be done with .

How to place Text and an Image next to each other in HTML?

I want the text and the image to be next to each other but I want the image to be on the far left of the screen and I want the text to be on the far right of the screen. This is what I currently have....

20 Jun at 17:13