Questions

How can I save a screenshot directly to a file in Windows?

Is there a one button way to save a screenshot directly to a file in Windows? TheSoftwareJedi accurately answered above question for Windows 8 and 10. Below original extra material remains for poste...

26 Jan at 21:47

Passing multiple variables in @RequestBody to a Spring MVC controller using Ajax

Is it necessary to wrap in a backing object? I want to do this: ``` @RequestMapping(value = "/Test", method = RequestMethod.POST) @ResponseBody public boolean getTest(@RequestBody String str1, @Reque...

21 Mar at 20:5

Adding data attribute to DOM

``` $('div').data('info', 1); alert($('div').data('info')); //this works $('div[data-info="1"]').text('222'); //but this don't work ``` I'm creating element within jquery. After that, I want t...

20 Sep at 06:44

Gradle - Error Could not find method implementation() for arguments [com.android.support:appcompat-v7:26.0.0]

I am trying to open existing android project in android studio and it gradle cannot build the app without the error Error android studio keeps on throwing ``` Error:(74, 1) A problem occurred evalua...

What is the difference between declarative and imperative paradigm in programming?

I have been searching the web looking for a definition for and programming that would shed some light for me. However, the language used at some of the resources that I have found is daunting - for ...

Why do this() and super() have to be the first statement in a constructor?

Java requires that if you call `this()` or `super()` in a constructor, it must be the first statement. Why? For example: ``` public class MyClass { public MyClass(int x) {} } public class MySubCl...

23 Jun at 10:18

How do I embed PHP code in JavaScript?

How can we use PHP code in JavaScript? Like ``` function jst() { var i = 0; i = <?php echo 35; ?> alert(i); } ``` Please suggest a better way.

9 May at 06:47

Using python's mock patch.object to change the return value of a method called within another method

Is it possible to mock a return value of a function called within another function I am trying to test? I would like the mocked method (which will be called in many methods I'm testing) to returned my...

21 Nov at 08:57

Detect HTTP or HTTPS then force HTTPS in JavaScript

Is there any way to detect HTTP or HTTPS and then force usage of HTTPS with JavaScript? I have some codes for detecting the HTTP or HTTPS but I can't force it to use `https:` . I'm using the proper...

18 Nov at 15:53

What is the difference between \r and \n?

How are `\r` and `\n` different? I think it has something to do with Unix vs. Windows vs. Mac, but I'm not sure exactly how they're different, and which to search for/match in regexes.

14 Aug at 09:46

Create instance of generic type whose constructor requires a parameter?

If `BaseFruit` has a constructor that accepts an `int weight`, can I instantiate a piece of fruit in a generic method like this? ``` public void AddFruit<T>()where T: BaseFruit{ BaseFruit fruit =...

17 Mar at 00:44

"Data too long for column" - why?

I've written a MySQL script to create a database for hypothetical hospital records and populate it with data. One of the tables, Department, has a column named Description, which is declared as type v...

24 Mar at 07:37

Do you need to dispose of objects and set them to null?

Do you need to dispose of objects and set them to null, or will the garbage collector clean them up when they go out of scope?

29 Jul at 12:35

Compute list difference

In Python, what is the best way to compute the difference between two lists? example ``` A = [1,2,3,4] B = [2,5] A - B = [1,3,4] B - A = [5] ```

23 Jun at 00:20

file_put_contents - failed to open stream: Permission denied

I am trying to write a query to a file for debugging. The file is in `database/execute.php`. The file I want to write to is `database/queries.php`. I am trying to use `file_put_contents('queries.txt'...

28 Aug at 13:53

How can I prevent Google Colab from disconnecting?

Is there a way to programmatically prevent [Google Colab](https://colab.research.google.com/) from disconnecting on a timeout? [](https://i.stack.imgur.com/lkvoo.jpg) The following describes the condi...

What does "TypeError: 'float' object cannot be interpreted as an integer" mean when using range?

I don't understand why I can't use my variable `c`. code: ``` from turtle import * speed(0) hideturtle() c = 450 def grid(x,y,a): seth(0) pu() goto(x,y) pd() for i in range(4):...

15 Nov at 01:35

How to change users in TortoiseSVN

I was setting up another user to use our SVN repository. He didn't have a username/password, so I logged in with my credentials. We now have a username/password for him. How do I get TortoiseSVN t...

Is there a java setting for disabling certificate validation?

I received this error while trying to start up an application: ``` Sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: java.net.U...

11 Jan at 22:3

ActionBar text color

how can I change the text color of the ActionBar? I've inherited the Holo Light Theme, I'm able to change the background of the ActionBar but I don't find out what is the attribute to tweak to change ...

How do I get current URL in Selenium Webdriver 2 Python?

I'm trying to get the current url after a series of navigations in Selenium. I know there's a command called getLocation for ruby, but I can't find the syntax for Python.

13 Apr at 07:20

Hive insert query like SQL

I am new to hive, and want to know if there is anyway to insert data into Hive table like we do in SQL. I want to insert my data into hive like ``` INSERT INTO tablename VALUES (value1,value2..) ``` ...

18 Oct at 01:48

How to properly export an ES6 class in Node 4?

I defined a class in a module: ``` "use strict"; var AspectTypeModule = function() {}; module.exports = AspectTypeModule; var AspectType = class AspectType { // ... }; module.export.Aspect...

1 Dec at 02:6

how to sync windows time from a ntp time server in command

I am working on windows 7. I can sync time of win7 from a ntp linux server manually. How can I do that in command prompt. So I can run it on windows startup. And windows task plan not work for me. The...

4 Apr at 12:0

How to get a specific output iterating a hash in Ruby?

I want to get a specific output iterating a Ruby Hash. This is the Hash I want to iterate over: ``` hash = { 1 => ['a', 'b'], 2 => ['c'], 3 => ['d', 'e', 'f', 'g'], 4 => ['h'] } ``` Thi...

23 Mar at 17:53