Questions

Returning a C string from a function

I am trying to return a C string from a function, but it's not working. Here is my code. ``` char myFunction() { return "My String"; } ``` In `main` I am calling it like this: ``` int main() {...

30 Apr at 13:56

How to convert List to Json in Java

How to convert generic list to json in Java.I have class like this.. ``` public class Output { public int Keyname { get; set; } public Object outputvalue{ get; set; } //outvalue may be even...

9 Jan at 05:49

What are the various "Build action" settings in Visual Studio project properties and what do they do?

For the most part, you just take whatever Visual Studio sets it for you as a default... I'm referring to the [BuildAction](https://learn.microsoft.com/en-us/visualstudio/ide/build-actions?view=vs-2019...

Getting Http Status code number (200, 301, 404, etc.) from HttpWebRequest and HttpWebResponse

I am trying to get the HTTP status code number from the `HttpWebResponse` object returned from a `HttpWebRequest`. I was hoping to get the actual numbers (200, 301,302, 404, etc.) rather than the te...

15 Nov at 15:3

Set keyboard caret position in html textbox

Does anybody know how to move the keyboard caret in a textbox to a particular position? For example, if a text-box (e.g. input element, not text-area) has 50 characters in it and I want to position t...

23 May at 12:10

ERROR: Could not build wheels for scipy which use PEP 517 and cannot be installed directly

I'm trying to install scipy via pip on my 64 bit ARMV8 board. I have already installed openblas which is required by scipy. So, no issues with that. When i gave `pip3 install scipy --trusted-host pypi...

Spring get current ApplicationContext

I am using Spring MVC for my web application. My beans are written in "`spring-servlet.xml`" file Now I have a class `MyClass` and i want to access this class using spring bean In the `spring-servle...

17 Feb at 11:14

How to solve "Fatal error: Class 'MySQLi' not found"?

I am doing a tutorial and am getting this error: > Fatal error: Class 'MySQLi' not found (LONG URL) on line 8 The code on line 8 is: ``` $mysqli = new MySQLi($db_server, $db_user, $db_pass, $db_nam...

1 Feb at 20:41

In Angular, how do you determine the active route?

`[routerLinkActive]`[this answer](https://stackoverflow.com/a/37947435/1480995) In an Angular application (current in the 2.0.0-beta.0 release as I write this), how do you determine what the current...

How would one write object-oriented code in C?

What are some ways to write object-oriented code in C? Especially with regard to polymorphism. --- See also this Stack Overflow question [Object-orientation in C](https://stackoverflow.com/questi...

30 Dec at 23:15

How to convert a String to Bytearray

How can I convert a string in bytearray using JavaScript. Output should be equivalent of the below C# code. ``` UnicodeEncoding encoding = new UnicodeEncoding(); byte[] bytes = encoding.GetBytes(AnyS...

17 Feb at 00:6

Code for Greatest Common Divisor in Python

The greatest common divisor (GCD) of a and b is the largest number that divides both of them with no remainder. One way to find the GCD of two numbers is Euclid’s algorithm, which is based on the obs...

24 May at 11:40

What is the reason for having '//' in Python?

I saw this in someone's code: ``` y = img_index // num_images ``` where `img_index` is a running index and `num_images` is 3. When I mess around with `//` in [IPython](https://en.wikipedia.org/wiki/I...

1 Dec at 09:31

Bootstrap Element 100% Width

I want to create alternating 100% colored blocks. An "ideal" situation is illustrated as an attachment, as well as the current situation. Desired setup: ![http://i.imgur.com/aiEMJ.jpg](https://i.st...

18 Aug at 12:35

Android Open External Storage directory(sdcard) for storing file

I want to open external storage directory path for saving file programatically.I tried but not getting sdcard path. How can i do this?is there any solution for this?? ``` private File path = new File...

Javascript - get array of dates between 2 dates

``` var range = getDates(new Date(), new Date().addDays(7)); ``` I'd like "range" to be an array of date objects, one for each day between the two dates. The trick is that it should handle month an...

Doing HTTP requests FROM Laravel to an external API

What I want is get an object from an API with a HTTP (eg, jQuery's AJAX) request to an external api. How do I start? I did research on Mr Google but I can't find anything helping. Im starting to wond...

23 May at 11:33

Android: Rotate image in imageview by an angle

I am using the following code to rotate a image in ImageView by an angle. Is there any simpler and less complex method available. ``` ImageView iv = (ImageView)findViewById(imageviewid); TextView tv ...

3 Jul at 08:51

How can I decrypt MySQL passwords

The developer who created a platform my company uses is no longer working for us and I don't know how I can retrieve the passwords from a custom PHP application When I look in the PHPmyAdmin the pas...

13 Apr at 20:1

Fastest way to convert string to integer in PHP

Using PHP, what's the fastest way to convert a string like this: `"123"` to an integer? Why is that particular method the fastest? What happens if it gets unexpected input, such as `"hello"` or an ar...

27 Oct at 05:21

Rounded table corners CSS only

I have searched and searched, but haven't been able to find a solution for my requirement. I have a plain ol' HTML table. I want round corners for it, using images or JS, i.e. pure . Like this: ![T...

7 Dec at 20:47

CORS header 'Access-Control-Allow-Origin' missing

I'm calling this function from my asp.net form and getting following error on firebug console while calling ajax. > Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote r...

7 Jul at 18:9

How to convert a Kotlin source file to a Java source file

I have a Kotlin source file, but I want to translate it to Java. How can I convert Kotlin to Java source?

23 Apr at 05:36

How to set CATALINA_HOME variable in windows 7?

I have downloaded `apache-tomcat-7.0.35`. My JDK version is `jdk1.6.0_27`. How do I configure `CATALINA_HOME` as an environment variable and how do I run Tomcat server under Windows 7?

Can I use an image from my local file system as background in HTML?

I've got an HTML document hosted on a remote web server. I'm trying to have one of the elements on the web page use an image file from my local file system as its background image. No luck with Chrome...

25 Jan at 09:59