Questions

Difference between maven scope compile and provided for JAR packaging

What is the difference between the maven scope `compile` and `provided` when artifact is built as a JAR? If it was WAR, I'd understand - the artifact would be included or not in WEB-INF/lib. But in ca...

27 Apr at 03:47

how to get 2 digits after decimal point in tsql?

I am having problem to format digits in my select column.I used FORMAT but it doesn't work. Here is my column: ``` sum(cast(datediff(second, IEC.CREATE_DATE, IEC.STATUS_DATE) as float) / 60) TotalSen...

7 May at 06:9

Service vs IntentService in the Android platform

I am seeking an example of something that can be done with an `IntentService` that cannot be done with a `Service` (and vice-versa)? I also believe that an `IntentService` runs in a different thread ...

Bytes of a string in Java

In Java, if I have a String `x`, how can I calculate the number of bytes in that string?

7 Feb at 17:7

Multiple plots in one figure in Python

I am new to python and am trying to plot multiple lines in the same figure using matplotlib. The value of my Y-axis is stored in a dictionary and I make corresponding values in X-axis in the following...

25 Jan at 20:0

How do you reverse a string in place in C or C++?

How do you reverse a string in C or C++ without requiring a separate buffer to hold the reversed string?

24 Nov at 03:35

How to send email from HTML Form

I know there are a lot of examples using the mailto: post action to send emails using just html forms. But using this will actually popup the send email dialog box e.g. outlook dialog box. And it actu...

20 May at 11:13

PHP calculate age

I'm looking for a way to calculate the age of a person, given their DOB in the format dd/mm/yyyy. I was using the following function which worked fine for several months until some kind of glitch ca...

23 Sep at 08:49

jQuery UI dialog positioning

I am trying to use the [jQuery dialog UI](http://docs.jquery.com/UI/Dialog) library in order to position a dialog next to some text when it is hovered over. The jQuery dialog takes a position paramet...

13 Apr at 16:50

Capturing multiple line output into a Bash variable

I've got a script 'myscript' that outputs the following: ``` abc def ghi ``` in another script, I call: ``` declare RESULT=$(./myscript) ``` and `$RESULT` gets the value ``` abc def ghi ``` I...

18 Feb at 05:18

I just assigned a variable, but echo $variable shows something else

Here are a series of cases where `echo $var` can show a different value than what was just assigned. This happens regardless of whether the assigned value was "double quoted", 'single quoted' or unquo...

25 Sep at 17:41

How to save an image locally using Python whose URL address I already know?

I know the URL of an image on Internet. e.g. [http://www.digimouth.com/news/media/2011/09/google-logo.jpg](http://www.digimouth.com/news/media/2011/09/google-logo.jpg), which contains the logo of Goo...

3 Nov at 21:21

Get the correct week number of a given date

I have Googled a lot and found a lot of solutions, but none of them give me the correct week number for the 2012-12-31. Even the example on MSDN ([link](http://msdn.microsoft.com/en-us/library/system....

13 Mar at 14:46

How to change owner of PostgreSql database?

I need to change the owner of PostgreSql database. How to change owner of PostgreSql database in phppgadmin?

15 May at 15:34

Android Emulator issues in new versions - The emulator process has terminated

After updating to Android Studio 2020.3.1 canary 15, when I try to run an emulator, it gets killed with this error: > The emulator process for AVD Pixel_4_API_30 has terminated. It was working correct...

Is there a way to get the git root directory in one command?

Mercurial has a way of printing the root directory (that contains .hg) via ``` hg root ``` Is there something equivalent in git to get the directory that contains the .git directory?

9 Apr at 18:10

Call int() function on every list element?

I have a list with numeric strings, like so: ``` numbers = ['1', '5', '10', '8']; ``` I would like to convert every list element to integer, so it would look like this: ``` numbers = [1, 5, 10, 8]...

12 Jan at 13:1

How to round a floating point number up to a certain decimal place?

Suppose I have `8.8333333333333339`, and I want to convert it to `8.84`. How can I accomplish this in Python? `round(8.8333333333333339, 2)` gives `8.83` and not `8.84`. I am new to Python or program...

13 Jul at 17:34

How do I get the first n characters of a string without checking the size or going out of bounds?

How do I get up to the first `n` characters of a string in Java without doing a size check first (inline is acceptable) or risking an `IndexOutOfBoundsException`?

Function in JavaScript that can be called only once

I need to create a function which can be executed only once, in each time after the first it won't be executed. I know from C++ and Java about static variables that can do the work but I would like to...

23 Sep at 19:50

Node.js: what is ENOSPC error and how to solve?

I have a problem with Node.js and uploading files to server. For uploading files to server I use this [plugin](https://github.com/Valums-File-Uploader/file-uploader). When starting file upload to the ...

10 Oct at 14:48

postgres default timezone

I installed `PostgreSQL 9` and the time it is showing is 1 hour behind the server time. Running `Select NOW()` shows: `2011-07-12 11:51:50.453842+00` The server date shows: `Tue Jul 12 12:51:40 BST ...

4 Oct at 15:30

Working with time DURATION, not time of day

I'm doing some benchmarking, and I want to use Excel to produce graphs of the results. I've got a simple but annoying problem which is baking my noodle. The problem is that Excel that "time" means a...

4 Jun at 07:56

Get Hours and Minutes (HH:MM) from date

I want to get only `hh:mm` from date. How I can get this? I have tried this : ``` CONVERT(VARCHAR(8), getdate(), 108) ```

20 Jun at 15:21

A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution

All of sudden I start getting this error, and I am not getting idea why if anyone just let me know where this error is, will be enough helpful. As much I am able to get is this because of new update o...

9 Oct at 11:38