问:
Does bootstrap have builtin padding and margin classes?
Does Bootstrap have built-in padding and margin classes like pad-10, mar-left-10 or I have to add my own custom classes? For example, similar to the ones here at padding and margin tabs.

答:
Bootstrap has many facility of classes to easily style elements if HTML. It includes a various of padding and margin classes for modification of the appearance of the element.

```<code>.m-0 { margin:0!important; }
.m-1 { margin:.25rem!important; }
.m-2 { margin:.5rem!important; }
.m-3 { margin:1rem!important; }
.m-4 { margin:1.5rem!important; }
.m-5 { margin:3rem!important; }

.mt-0 { margin-top:0!important; }
.mr-0 { margin-right:0!important; }
.mb-0 { margin-bottom:0!important; }
.ml-0 { margin-left:0!important; }
.mx-0 { margin-left:0 !important;margin-right:0 !important; }
.my-0 { margin-top:0!important;margin-bottom:0!important; }

.mt-1 { margin-top:.25rem!important; }
.mr-1 { margin-right:.25rem!important; }
.mb-1 { margin-bottom:.25rem!important; }
.ml-1 { margin-left:.25rem!important; }
.mx-1 { margin-left:.25rem!important;margin-right:.25rem!important; }
.my-1 { margin-top:.25rem!important;margin-bottom:.25rem!important; }

.mt-2 { margin-top:.5rem!important; }
.mr-2 { margin-right:.5rem!important; }
.mb-2 { margin-bottom:.5rem!important; }
.ml-2 { margin-left:.5rem!important; }
.mx-2 { margin-right:.5rem!important;margin-left:.5rem!important; }
.my-2 { margin-top:.5rem!important;margin-bottom:.5rem!important; }

.mt-3 { margin-top:1rem!important; }
.mr-3 { margin-right:1rem!important; }
.mb-3 { margin-bottom:1rem!important; }
.ml-3 { margin-left:1rem!important; }
.mx-3 { margin-right:1rem!important;margin-left:1rem!important; }
.my-3 { margin-bottom:1rem!important;margin-top:1rem!important; }

.mt-4 { margin-top:1.5rem!important; }
.mr-4 { margin-right:1.5rem!important; }
.mb-4 { margin-bottom:1.5rem!important; }
.ml-4 { margin-left:1.5rem!important; }
.mx-4 { margin-right:1.5rem!important;margin-left:1.5rem!important; }
.my-4 { margin-top:1.5rem!important;margin-bottom:1.5rem!important; }

.mt-5 { margin-top:3rem!important; }
.mr-5 { margin-right:3rem!important; }
.mb-5 { margin-bottom:3rem!important; }
.ml-5 { margin-left:3rem!important; }
.mx-5 { margin-right:3rem!important;margin-left:3rem!important; }
.my-5 { margin-top:3rem!important;margin-bottom:3rem!important; }

.mt-auto { margin-top:auto!important; }
.mr-auto { margin-right:auto!important; }
.mb-auto { margin-bottom:auto!important; }
.ml-auto { margin-left:auto!important; }
.mx-auto { margin-right:auto!important;margin-left:auto!important; }
.my-auto { margin-bottom:auto!important;margin-top:auto!important; }

.p-0 { padding:0!important; }
.p-1 { padding:.25rem!important; }
.p-2 { padding:.5rem!important; }
.p-3 { padding:1rem!important; }
.p-4 { padding:1.5rem!important; }
.p-5 { padding:3rem!important; }

.pt-0 { padding-top:0!important; }
.pr-0 { padding-right:0!important; }
.pb-0 { padding-bottom:0!important; }
.pl-0 { padding-left:0!important; }
.px-0 { padding-left:0!important;padding-right:0!important; }
.py-0 { padding-top:0!important;padding-bottom:0!important; }

.pt-1 { padding-top:.25rem!important; }
.pr-1 { padding-right:.25rem!important; }
.pb-1 { padding-bottom:.25rem!important; }
.pl-1 { padding-left:.25rem!important; }
.px-1 { padding-left:.25rem!important;padding-right:.25rem!important; }
.py-1 { padding-top:.25rem!important;padding-bottom:.25rem!important; }

.pt-2 { padding-top:.5rem!important; }
.pr-2 { padding-right:.5rem!important; }
.pb-2 { padding-bottom:.5rem!important; }
.pl-2 { padding-left:.5rem!important; }
.px-2 { padding-right:.5rem!important;padding-left:.5rem!important; }
.py-2 { padding-top:.5rem!important;padding-bottom:.5rem!important; }

.pt-3 { padding-top:1rem!important; }
.pr-3 { padding-right:1rem!important; }
.pb-3 { padding-bottom:1rem!important; }
.pl-3 { padding-left:1rem!important; }
.py-3 { padding-bottom:1rem!important;padding-top:1rem!important; }
.px-3 { padding-right:1rem!important;padding-left:1rem!important; }

.pt-4 { padding-top:1.5rem!important; }
.pr-4 { padding-right:1.5rem!important; }
.pb-4 { padding-bottom:1.5rem!important; }
.pl-4 { padding-left:1.5rem!important; }
.px-4 { padding-right:1.5rem!important;padding-left:1.5rem!important; }
.py-4 { padding-top:1.5rem!important;padding-bottom:1.5rem!important; }

.pt-5 { padding-top:3rem!important; }
.pr-5 { padding-right:3rem!important; }
.pb-5 { padding-bottom:3rem!important; }
.pl-5 { padding-left:3rem!important; }
.px-5 { padding-right:3rem!important;padding-left:3rem!important; }
.py-5 { padding-top:3rem!important;padding-bottom:3rem!important; }
</code>```

https://jsfiddle.net/ssuryar/x47bca1u/

Body:
Bootstrap has many facility of classes to easily style elements if HTML. It includes a various of padding and margin classes for modification of the appearance of the element.

.m-0 { margin:0!important; }
.m-1 { margin:.25rem!important; }
.m-2 { margin:.5rem!important; }
.m-3 { margin:1rem!important; }
.m-4 { margin:1.5rem!important; }
.m-5 { margin:3rem!important; }

.mt-0 { margin-top:0!important; }
.mr-0 { margin-right:0!important; }
.mb-0 { margin-bottom:0!important; }
.ml-0 { margin-left:0!important; }
.mx-0 { margin-left:0 !important;margin-right:0 !important; }
.my-0 { margin-top:0!important;margin-bottom:0!important; }

.mt-1 { margin-top:.25rem!important; }
.mr-1 { margin-right:.25rem!important; }
.mb-1 { margin-bottom:.25rem!important; }
.ml-1 { margin-left:.25rem!important; }
.mx-1 { margin-left:.25rem!important;margin-right:.25rem!important; }
.my-1 { margin-top:.25rem!important;margin-bottom:.25rem!important; }

.mt-2 { margin-top:.5rem!important; }
.mr-2 { margin-right:.5rem!important; }
.mb-2 { margin-bottom:.5rem!important; }
.ml-2 { margin-left:.5rem!important; }
.mx-2 { margin-right:.5rem!important;margin-left:.5rem!important; }
.my-2 { margin-top:.5rem!important;margin-bottom:.5rem!important; }

.mt-3 { margin-top:1rem!important; }
.mr-3 { margin-right:1rem!important; }
.mb-3 { margin-bottom:1rem!important; }
.ml-3 { margin-left:1rem!important; }
.mx-3 { margin-right:1rem!important;margin-left:1rem!important; }
.my-3 { margin-bottom:1rem!important;margin-top:1rem!important; }

.mt-4 { margin-top:1.5rem!important; }
.mr-4 { margin-right:1.5rem!important; }
.mb-4 { margin-bottom:1.5rem!important; }
.ml-4 { margin-left:1.5rem!important; }
.mx-4 { margin-right:1.5rem!important;margin-left:1.5rem!important; }
.my-4 { margin-top:1.5rem!important;margin-bottom:1.5rem!important; }

.mt-5 { margin-top:3rem!important; }
.mr-5 { margin-right:3rem!important; }
.mb-5 { margin-bottom:3rem!important; }
.ml-5 { margin-left:3rem!important; }
.mx-5 { margin-right:3rem!important;margin-left:3rem!important; }
.my-5 { margin-top:3rem!important;margin-bottom:3rem!important; }

.mt-auto { margin-top:auto!important; }
.mr-auto { margin-right:auto!important; }
.mb-auto { margin-bottom:auto!important; }
.ml-auto { margin-left:auto!important; }
.mx-auto { margin-right:auto!important;margin-left:auto!important; }
.my-auto { margin-bottom:auto!important;margin-top:auto!important; }

.p-0 { padding:0!important; }
.p-1 { padding:.25rem!important; }
.p-2 { padding:.5rem!important; }
.p-3 { padding:1rem!important; }
.p-4 { padding:1.5rem!important; }
.p-5 { padding:3rem!important; }

.pt-0 { padding-top:0!important; }
.pr-0 { padding-right:0!important; }
.pb-0 { padding-bottom:0!important; }
.pl-0 { padding-left:0!important; }
.px-0 { padding-left:0!important;padding-right:0!important; }
.py-0 { padding-top:0!important;padding-bottom:0!important; }

.pt-1 { padding-top:.25rem!important; }
.pr-1 { padding-right:.25rem!important; }
.pb-1 { padding-bottom:.25rem!important; }
.pl-1 { padding-left:.25rem!important; }
.px-1 { padding-left:.25rem!important;padding-right:.25rem!important; }
.py-1 { padding-top:.25rem!important;padding-bottom:.25rem!important; }

.pt-2 { padding-top:.5rem!important; }
.pr-2 { padding-right:.5rem!important; }
.pb-2 { padding-bottom:.5rem!important; }
.pl-2 { padding-left:.5rem!important; }
.px-2 { padding-right:.5rem!important;padding-left:.5rem!important; }
.py-2 { padding-top:.5rem!important;padding-bottom:.5rem!important; }

.pt-3 { padding-top:1rem!important; }
.pr-3 { padding-right:1rem!important; }
.pb-3 { padding-bottom:1rem!important; }
.pl-3 { padding-left:1rem!important; }
.py-3 { padding-bottom:1rem!important;padding-top:1rem!important; }
.px-3 { padding-right:1rem!important;padding-left:1rem!important; }

.pt-4 { padding-top:1.5rem!important; }
.pr-4 { padding-right:1.5rem!important; }
.pb-4 { padding-bottom:1.5rem!important; }
.pl-4 { padding-left:1.5rem!important; }
.px-4 { padding-right:1.5rem!important;padding-left:1.5rem!important; }
.py-4 { padding-top:1.5rem!important;padding-bottom:1.5rem!important; }

.pt-5 { padding-top:3rem!important; }
.pr-5 { padding-right:3rem!important; }
.pb-5 { padding-bottom:3rem!important; }
.pl-5 { padding-left:3rem!important; }
.px-5 { padding-right:3rem!important;padding-left:3rem!important; }
.py-5 { padding-top:3rem!important;padding-bottom:3rem!important; }

https://jsfiddle.net/ssuryar/x47bca1u/


来源: stackexchange

问:
Remove vignette filter of colored image
I am new to Python OpenCV image processing. I want to remove the border/outline shadow of images as shown below. I checked 'how to remove shadow from scanned images' which does not work for me. Is this even possible?

答:
Your problem of border/outline shadows reminded me of the vignette filter. You can have a look at this question if you want to know more about it. So essentially our task to remove the effect of the vignette filter and then increase brightness.

```<code>#####VIGNETTE
import cv2
import numpy as np

img = cv2.imread('Paris.jpg')
height, width = img.shape[:2]
original = img.copy()
# generating vignette mask using Gaussian kernels
kernel_x = cv2.getGaussianKernel(width, 150)
kernel_y = cv2.getGaussianKernel(height, 150)
kernel = kernel_y * kernel_x.T
mask = 255 * kernel / np.linalg.norm(kernel)

# applying the mask to each channel in the input image
for i in range(3):
    img[:, :, i] = img[:, :, i] * mask

cv2.imshow('Original', original)
cv2.imshow('Vignette', img)
cv2.waitKey(0)
cv2.destroyAllWindows()
</code>```

To counter the effect change img[:, :, i] = img[:, :, i] * mask to img[:, :, i] = img[:, :, i] / mask

Now we need to increase the brightness of the image. For this, we will convert the image to HSV and increase the values of saturation and value matrices. To know about it in more detail you can refer to this article.

```<code>#THE FULL CODE
import cv2
import numpy as np

img = cv2.imread('shadow.jpg')
original = cv2.imread('bright.jpg')
height, width = img.shape[:2]
# generating vignette mask using Gaussian kernels
kernel_x = cv2.getGaussianKernel(width, 150)
kernel_y = cv2.getGaussianKernel(height, 150)
kernel = kernel_y * kernel_x.T
mask = 255 * kernel / np.linalg.norm(kernel)

test = img.copy()
for i in range(3):
    test[:, :, i] = test[:, :, i] / mask

hsv = cv2.cvtColor(test, cv2.COLOR_BGR2HSV)
hsv = np.array(hsv, dtype = np.float64)
hsv[:,:,1] = hsv[:,:,1]*1.3 ## scale pixel values up or down for channel 1(Lightness)
hsv[:,:,1][hsv[:,:,1]>255]  = 255
hsv[:,:,2] = hsv[:,:,2]*1.3 ## scale pixel values up or down for channel 1(Lightness)
hsv[:,:,2][hsv[:,:,2]>255]  = 255
hsv = np.array(hsv, dtype = np.uint8)
test = cv2.cvtColor(hsv, cv2.COLOR_HSV2BGR)

cv2.imshow('Original_bright', original)
cv2.imshow('Original_dark', img)
cv2.imshow('Result', test)
cv2.waitKey(0)
cv2.destroyAllWindows()
</code>```

The result compared with the original bright image.

How the result would have looked like without the inverse vignette filter.

ContentLicense: CC BY-SA 4.0

Title: Remove vignette filter of colored image

Body:
Your problem of border/outline shadows reminded me of the vignette filter. You can have a look at this question if you want to know more about it. So essentially our task to remove the effect of the vignette filter and then increase brightness.

#####VIGNETTE
import cv2
import numpy as np

img = cv2.imread('Paris.jpg')
height, width = img.shape[:2]
original = img.copy()
# generating vignette mask using Gaussian kernels
kernel_x = cv2.getGaussianKernel(width, 150)
kernel_y = cv2.getGaussianKernel(height, 150)
kernel = kernel_y * kernel_x.T
mask = 255 * kernel / np.linalg.norm(kernel)

# applying the mask to each channel in the input image
for i in range(3):
    img[:, :, i] = img[:, :, i] * mask

cv2.imshow('Original', original)
cv2.imshow('Vignette', img)
cv2.waitKey(0)
cv2.destroyAllWindows()

To counter the effect change img[:, :, i] = img[:, :, i] * mask to img[:, :, i] = img[:, :, i] / mask

Now we need to increase the brightness of the image. For this, we will convert the image to HSV and increase the values of saturation and value matrices. To know about it in more detail you can refer to this article.

#THE FULL CODE
import cv2
import numpy as np

img = cv2.imread('shadow.jpg')
original = cv2.imread('bright.jpg')
height, width = img.shape[:2]
# generating vignette mask using Gaussian kernels
kernel_x = cv2.getGaussianKernel(width, 150)
kernel_y = cv2.getGaussianKernel(height, 150)
kernel = kernel_y * kernel_x.T
mask = 255 * kernel / np.linalg.norm(kernel)

test = img.copy()
for i in range(3):
    test[:, :, i] = test[:, :, i] / mask

hsv = cv2.cvtColor(test, cv2.COLOR_BGR2HSV)
hsv = np.array(hsv, dtype = np.float64)
hsv[:,:,1] = hsv[:,:,1]*1.3 ## scale pixel values up or down for channel 1(Lightness)
hsv[:,:,1][hsv[:,:,1]>255]  = 255
hsv[:,:,2] = hsv[:,:,2]*1.3 ## scale pixel values up or down for channel 1(Lightness)
hsv[:,:,2][hsv[:,:,2]>255]  = 255
hsv = np.array(hsv, dtype = np.uint8)
test = cv2.cvtColor(hsv, cv2.COLOR_HSV2BGR)

cv2.imshow('Original_bright', original)
cv2.imshow('Original_dark', img)
cv2.imshow('Result', test)
cv2.waitKey(0)
cv2.destroyAllWindows()

The result compared with the original bright image.

How the result would have looked like without the inverse vignette filter.


问:
Secure SQL update in PHP
As part of a job I want to update a database using a form. Since the database is large and is used by many users, I hope that this manipulation is at least secure for more safety.

HTML script :

```<code><form action="http://localhost/modifier_infos_signaletique.php" method=POST >
    <div class="id_sign">
    <h5>Id "Signalétique" :</h5>
    <input type="text" name="id_sign" id="id_sign"/><br>
    </div>
    <h5>Infos "Signalétique" : </h5>
    <input class="comment" type="text" id="maj_infos" name="maj_infos" required maxlength='140'/><br>
    <input type="submit" value="Submit" />
</form>
</code>```

PHP script:

```<code><?php
    $user = 'xxxx';
    $pass = 'xxxx';

    try{
        $dbconn = new PDO('pgsql:host=localhost;port=5432;dbname=xxxx',$user, $pass);
        $dbconn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

        $maj = $_POST['maj_infos'];
        $id = $_POST['id_sign'];

        $query = $dbconn->prepare("UPDATE signaletique SET infos = ':infos' WHERE id = ':id'");
        $query->bindParam(':infos', $maj, PDO::PARAM_STR);
        $query->bindParam(':id', $id, PDO::PARAM_INT);
        $query->execute();

        echo 'Données mises à jour';
    }
    catch(PDOException $e){
        echo "Erreur : " . $e->getMessage();
    }
?>
</code>```

However, when I use this script this error appears:

**Erreur : SQLSTATE[HY093]: Invalid parameter number: :infos **

The error would be due to the parameter used for the bindParam function.
However, I have in the properties of my PostgreSQL database, info in "character varying". I tried to change this parameter to "text", but the error remains the same.

Forgive me for this question but I am new to PHP and my SQL skills are thin since I use pgAdmin and its tools a lot to build and interact with my databases.

Here is a screenshot of my database :

The info parameter is in "text" on the screenshot but basic this property was in "character varying" (140).

Thank you for your help.

答:
In your query string you put single quotes around your placeholders. This makes them strings, not placeholders. You do not need quotes when using placeholders.

This should work:

$query = $dbconn->prepare("UPDATE signaletique SET infos = :infos WHERE id = :id");

See https://stackoverflow.com/questions/10966251/sqlstatehy093-invalid-parameter-number-parameter-was-not-defined for more information.

OwnerDisplayName: Teyhryu

Title: Secure SQL update in PHP

Body:
As part of a job I want to update a database using a form. Since the database is large and is used by many users, I hope that this manipulation is at least secure for more safety.

HTML script :

<form action="http://localhost/modifier_infos_signaletique.php" method=POST >

Id "Signalétique" :

    <input type="text" name="id_sign" id="id_sign"/>

Infos "Signalétique" :

    <input class="comment" type="text" id="maj_infos" name="maj_infos" required maxlength='140'/>

    <input type="submit" value="Submit" />
</form>

PHP script:

<?php
    $user = 'xxxx';
    $pass = 'xxxx';

    try{
        $dbconn = new PDO('pgsql:host=localhost;port=5432;dbname=xxxx',$user, $pass);
        $dbconn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

        $maj = $_POST['maj_infos'];
        $id = $_POST['id_sign'];

        $query = $dbconn->prepare("UPDATE signaletique SET infos = ':infos' WHERE id = ':id'");
        $query->bindParam(':infos', $maj, PDO::PARAM_STR);
        $query->bindParam(':id', $id, PDO::PARAM_INT);
        $query->execute();

        echo 'Données mises à jour';
    }
    catch(PDOException $e){
        echo "Erreur : " . $e->getMessage();
    }
?>

However, when I use this script this error appears:

**Erreur : SQLSTATE[HY093]: Invalid parameter number: :infos **

The error would be due to the parameter used for the bindParam function.
However, I have in the properties of my PostgreSQL database, info in "character varying". I tried to change this parameter to "text", but the error remains the same.

Forgive me for this question but I am new to PHP and my SQL skills are thin since I use pgAdmin and its tools a lot to build and interact with my databases.

Here is a screenshot of my database :

The info parameter is in "text" on the screenshot but basic this property was in "character varying" (140).

Thank you for your help.


问:
A difficult SQL query: tag popularity for models with complex associations
I'm not even sure this is possible to do efficiently, but here's my problem:

I'm writing what's essentially a blog engine where a blog post and all replies to each blog post can tagged.

So, I could have a blog post tagged "stack", and a reply to that post tagged "overflow".

Right now, I'm trying to generate a list of the most popular tags when a user hits a special page in my application.  It should return not only the n most popular tags by descending number of blog posts, but also the number of blog posts associated with each tag, even if a reply in that post but not the post itself is tagged with that tag.

So, if BlogPost A is tagged with "foo", and a reply in BlogPost B is tagged with "foo", the popular tag summary should count that as two blog posts in total, even though BlogPost B is not technically tagged.

Here's a description of the tables/fields that might be relevant:

```<code>BlogPosts
| id     # Primary key for all tables, Rails-style

BlogComments
| id
| blog_post_id

Tags
| id
| name   # 'foo'

Taggings
| id
| tag_id
| blog_post_id
| blog_comment_id
</code>```

There's some denormalization in Taggings for the sake of convenience.  If someone tags BlogPost, it fills in the blog_post_id field, and blog_comment_id remains NULL.  If someone tags a comment to a post, it fills in both blog_post_id and blog_comment_id.

Is there some way to return a sorted list of the most popular tags in one or several SQL queries?  I'm thinking I might need to just run a computationally-expensive script every few minutes on a cron job and render the cached output instead of running this every time somebody hits the page...

Thanks!

答:
So far I see nothing complicated in your request:

```<code>SELECT
  tag_id,
  COUNT(blog_post_id) + COUNT(blog_comment_id) tag_count
FROM
  Taggings
GROUP BY
  tag_id
ORDER BY
  COUNT(blog_post_id) + COUNT(blog_comment_id) DESC
</code>```

If you want to count "affected blog posts" only, I think that's the way:

```<code>SELECT
  t.id    tag_id,
  t.name  tag_name,
  COUNT(DISTINCT COALESCE(x.blog_post_id, c.blog_post_id)) tag_count
FROM
  Tags                    t
  INNER JOIN Taggings     x ON x.tag_id = t.id
  LEFT  JOIN BlogComments c ON c.id     = x.blog_comment_id
GROUP BY
  t.id,
  t.name
ORDER BY
  COUNT(DISTINCT COALESCE(x.blog_post_id, c.blog_post_id)) DESC
</code>```

OwnerDisplayName: O. Frabjous-Dey

ContentLicense: CC BY-SA 2.5

Body:
I'm not even sure this is possible to do efficiently, but here's my problem:

I'm writing what's essentially a blog engine where a blog post and all replies to each blog post can tagged.

So, I could have a blog post tagged "stack", and a reply to that post tagged "overflow".

Right now, I'm trying to generate a list of the most popular tags when a user hits a special page in my application.  It should return not only the n most popular tags by descending number of blog posts, but also the number of blog posts associated with each tag, even if a reply in that post but not the post itself is tagged with that tag.

So, if BlogPost A is tagged with "foo", and a reply in BlogPost B is tagged with "foo", the popular tag summary should count that as two blog posts in total, even though BlogPost B is not technically tagged.

Here's a description of the tables/fields that might be relevant:

BlogPosts
| id     # Primary key for all tables, Rails-style

BlogComments
| id
| blog_post_id

Tags
| id
| name   # 'foo'

Taggings
| id
| tag_id
| blog_post_id
| blog_comment_id

There's some denormalization in Taggings for the sake of convenience.  If someone tags BlogPost, it fills in the blog_post_id field, and blog_comment_id remains NULL.  If someone tags a comment to a post, it fills in both blog_post_id and blog_comment_id.

Is there some way to return a sorted list of the most popular tags in one or several SQL queries?  I'm thinking I might need to just run a computationally-expensive script every few minutes on a cron job and render the cached output instead of running this every time somebody hits the page...

Thanks!

Body:
So far I see nothing complicated in your request:

SELECT
  tag_id,
  COUNT(blog_post_id) + COUNT(blog_comment_id) tag_count
FROM
  Taggings
GROUP BY
  tag_id
ORDER BY
  COUNT(blog_post_id) + COUNT(blog_comment_id) DESC

If you want to count "affected blog posts" only, I think that's the way:

SELECT
  t.id    tag_id,
  t.name  tag_name,
  COUNT(DISTINCT COALESCE(x.blog_post_id, c.blog_post_id)) tag_count
FROM
  Tags                    t
  INNER JOIN Taggings     x ON x.tag_id = t.id
  LEFT  JOIN BlogComments c ON c.id     = x.blog_comment_id
GROUP BY
  t.id,
  t.name
ORDER BY
  COUNT(DISTINCT COALESCE(x.blog_post_id, c.blog_post_id)) DESC

OwnerDisplayName: Tomalak

LastEditorDisplayName: Tomalak


问:
Re-use variable outside of function?
How can I use return the $row array in the below example, so that I can re-use the variable outside of this function?

I manage to echo the information inside the function using $row['columnName'], but various combinations of global and $GLOBALS, return $xyz and getting variable scope to work for me has me a bit out of my depth. Any answers please?

```<code><?php
function getInfo() {

    $query = /* Some SQL Query */;

    $result = mysql_query($query);

    if($result == false)
    {
       user_error("Query failed: " . mysql_error() . "<br />\n$query");
    }
    elseif(mysql_num_rows($result) == 0)
    {
       echo "<p>Sorry, no rows were returned by your query.</p>\n";
    }
    else
    {
    while ($row = mysql_fetch_assoc($result)) {
        /* What goes here? */
        }
    }

}
?>
</code>```

答:
You can either use $row directly inside the while block, or you can pass it as a parameter to another function that performs the row-level processing. First, define the function:

```<code>function processRow($r)
{
  echo $r['columnName'];
}
</code>```

Then, inside your loop, call that function:

```<code>while ($row = mysql_fetch_assoc($result)) {
  processRow($row);
}
</code>```

Within that function, the value known as $row in getInfo will be known as $r. (You can name the formal parameter $row if you want, but I've used a different name here just to illustrate that they don't need to have the same name. If you're not clear on variable scope, then giving lots of variables the same name may just serve to confuse yourself more.)

ContentLicense: CC BY-SA 3.0

Title: Re-use variable outside of function?

Body:
How can I use return the $row array in the below example, so that I can re-use the variable outside of this function?

I manage to echo the information inside the function using $row['columnName'], but various combinations of global and $GLOBALS, return $xyz and getting variable scope to work for me has me a bit out of my depth. Any answers please?

<?php
function getInfo() {

    $query = /* Some SQL Query */;

    $result = mysql_query($query);

    if($result == false)
    {
       user_error("Query failed: " . mysql_error() . "
\n$query");
    }
    elseif(mysql_num_rows($result) == 0)
    {
       echo "
Sorry, no rows were returned by your query.
\n";
    }
    else
    {
    while ($row = mysql_fetch_assoc($result)) {
        /* What goes here? */
        }
    }

}
?>

Body:
You can either use $row directly inside the while block, or you can pass it as a parameter to another function that performs the row-level processing. First, define the function:

function processRow($r)
{
  echo $r['columnName'];
}

Then, inside your loop, call that function:

while ($row = mysql_fetch_assoc($result)) {
  processRow($row);
}

Within that function, the value known as $row in getInfo will be known as $r. (You can name the formal parameter $row if you want, but I've used a different name here just to illustrate that they don't need to have the same name. If you're not clear on variable scope, then giving lots of variables the same name may just serve to confuse yourself more.)


问:
Javascript functions doesn't work as expected
I am using Ruby on Rails 6.0.3. If I keep a javascript code in the app/assets/javascript/packs/file.js, and then include it with javascript_pack_tag(), the functions in the code doesn't work as expected.

For example, I have a BlogApp, with a blog controller.

The app/assets/javascript/packs/file.js

```<code>function notifySend(arg) {
    console.log(arg)
}

function notify(arg) {
    notifySend(arg)
}
</code>```

The app/views/layouts/blog.html.erb

```<code><!DOCTYPE html>
<html>
    <head>
        <title><%= @page_title %></title>
        <meta charset="utf-8">

        <%= csrf_meta_tags %>
        <%= csp_meta_tag %>

        <%= javascript_pack_tag 'file', %s(data-turbolinks-track) => 'reload' %>
    </head>

    <body>
        <script>notify('hello!')</script>
    </body>
</html>
</code>```

On opening localhost:3000/blogs, I get:

```<code>ReferenceError: notify is not defined
</code>```

In the browser's console.

But if I modify the file.js, a bit, like this:

```<code>function notifySend(arg) {
    console.log(arg)
}

notify = function(arg) {
    notifySend(arg)
}
</code>```

The javascript works fine, and I get "hello!" to the browser's console!

So there's a hassle of rewriting the functions.

But for bigger JS files or minified files, that can be time consuming. Every function that is called from the script tag in body needs a rewrite.

How do I keep my js code intact (like the example 1), and get it working with rails?

答:
This is because webpacker wraps your imports in functions so that they are not placed in the global scope.

In the second example by omitting the var keyword you are creating an implicit global:

```<code>function notifySend(arg) {
    console.log(arg)
}

notify = function(arg) {
    notifySend(arg)
}
</code>```

This is regarded as a really bad practice and if you where using strict mode or a linter it would have told you so. If you really want to declare a global do so explicitly:

```<code>function notifySend(arg) {
    console.log(arg)
}

window.notify = notifySend;
</code>```

But the real solution here is to not use inline script tags or inline handlers and write real maintainable minified javascript instead of making a mess. Javascript does not belong in your views. If your code relies on a bunch of globals you're doing it wrong.

Body:
I am using Ruby on Rails 6.0.3. If I keep a javascript code in the app/assets/javascript/packs/file.js, and then include it with javascript_pack_tag(), the functions in the code doesn't work as expected.

For example, I have a BlogApp, with a blog controller.

The app/assets/javascript/packs/file.js

function notifySend(arg) {
    console.log(arg)
}

function notify(arg) {
    notifySend(arg)
}

The app/views/layouts/blog.html.erb

<!DOCTYPE html>

        <title><%= @page_title %></title>
        <meta charset="utf-8">

        <%= csrf_meta_tags %>
        <%= csp_meta_tag %>

        <%= javascript_pack_tag 'file', %s(data-turbolinks-track) => 'reload' %>

On opening localhost:3000/blogs, I get:

ReferenceError: notify is not defined

In the browser's console.

But if I modify the file.js, a bit, like this:

function notifySend(arg) {
    console.log(arg)
}

notify = function(arg) {
    notifySend(arg)
}

The javascript works fine, and I get "hello!" to the browser's console!

So there's a hassle of rewriting the functions.

But for bigger JS files or minified files, that can be time consuming. Every function that is called from the script tag in body needs a rewrite.

How do I keep my js code intact (like the example 1), and get it working with rails?

Body:
This is because webpacker wraps your imports in functions so that they are not placed in the global scope.

In the second example by omitting the var keyword you are creating an implicit global:

function notifySend(arg) {
    console.log(arg)
}

notify = function(arg) {
    notifySend(arg)
}

This is regarded as a really bad practice and if you where using strict mode or a linter it would have told you so. If you really want to declare a global do so explicitly:

function notifySend(arg) {
    console.log(arg)
}

window.notify = notifySend;

But the real solution here is to not use inline script tags or inline handlers and write real maintainable minified javascript instead of making a mess. Javascript does not belong in your views. If your code relies on a bunch of globals you're doing it wrong.


问:
how to solve no such column: todo_todo.title
I'm making a basic todo app in Django3.
how to solve no such column: todo_todo.title error??
I can't solve this problem.
here is my todo models and views.

this is my todo/models.py

```<code>from django.db import models
from django.utils import timezone

class Todo(models.Model):
    title=models.CharField(max_length=200)
    details=models.TextField()
    date=models.DateTimeField(default=timezone.now)

    def __str__(self):
        return self.title
</code>```

this is my views.py

```<code>from django.shortcuts import render, redirect
from django.contrib import messages

from .forms import TodoForm
from .models import Todo

###############################################

def index(request):
    item_list = Todo.objects.order_by("-date")
    if request.method == "POST":
        form = TodoForm(request.POST)
        if form.is_valid():
            form.save()
            return redirect('todo')
    form = TodoForm()

    page = {
             "forms" : form,
             "list" : item_list,
             "title" : "TODO LIST",
           }
    return render(request, 'todo/index.html', page)

### function to remove item, it recive todo item id from url ##
def remove(request, item_id):
    item = Todo.objects.get(id=item_id)
    item.delete()
    messages.info(request, "item removed !!!")
    return redirect('todo')
</code>```

答:
First, make sure you run

```<code>python manage.py makemigrations

# and
python manage.py migrate
</code>```

The error looks like a database error.

Also, Change

```<code>item_list = Todo.objects.order_by("-date")
</code>```

To

```<code>item_list = Todo.objects.all().order_by("-date")
</code>```

An error may probably come from your template view todo\index.html where you will be trying to to access todo.title but it is not being passed correctly from the view.
The .all() function returns the queryset of objects you need from your database for the Todo model

Body:
I'm making a basic todo app in Django3.
how to solve no such column: todo_todo.title error??
I can't solve this problem.
here is my todo models and views.

this is my todo/models.py

from django.db import models
from django.utils import timezone

class Todo(models.Model):
    title=models.CharField(max_length=200)
    details=models.TextField()
    date=models.DateTimeField(default=timezone.now)

    def __str__(self):
        return self.title

this is my views.py

from django.shortcuts import render, redirect
from django.contrib import messages

from .forms import TodoForm
from .models import Todo

###############################################

def index(request):
    item_list = Todo.objects.order_by("-date")
    if request.method == "POST":
        form = TodoForm(request.POST)
        if form.is_valid():
            form.save()
            return redirect('todo')
    form = TodoForm()

    page = {
             "forms" : form,
             "list" : item_list,
             "title" : "TODO LIST",
           }
    return render(request, 'todo/index.html', page)

### function to remove item, it recive todo item id from url ##
def remove(request, item_id):
    item = Todo.objects.get(id=item_id)
    item.delete()
    messages.info(request, "item removed !!!")
    return redirect('todo')

Body:
First, make sure you run

python manage.py makemigrations

# and
python manage.py migrate

The error looks like a database error.

Also, Change

item_list = Todo.objects.order_by("-date")

To

item_list = Todo.objects.all().order_by("-date")

An error may probably come from your template view todo\index.html where you will be trying to to access todo.title but it is not being passed correctly from the view.
The .all() function returns the queryset of objects you need from your database for the Todo model


问:
How to divide 16-bit integer by 255 with using SSE?
I deal with image processing.
I need to divide 16-bit integer SSE vector by 255.

I can't use shift operator like _mm_srli_epi16(), because 255 is not a multiple of power of 2.

I know of course that it is possible convert integer to float, perform division and then back conversion to integer.

But might somebody knows another solution...

答:
Accurate version:

```<code>#define div_255_fast(x)    (((x) + (((x) + 257) >> 8)) >> 8)
</code>```

When x is in the range of [0, 65536], the ERROR is 0. It is twice as faster as x/255：

http://quick-bench.com/t3Y2-b4isYIwnKwMaPQi3n9dmtQ

SIMD version:

```<code>// (x + ((x + 257) >> 8)) >> 8
static inline __m128i _mm_fast_div_255_epu16(__m128i x) {
    return _mm_srli_epi16(_mm_adds_epu16(x,
        _mm_srli_epi16(_mm_adds_epu16(x, _mm_set1_epi16(0x0101)), 8)), 8);
}
</code>```

For a positive x above 65535, here is another version:

```<code>static inline int32_t fast_div_255_any (int32_t n) {
    uint64_t M = (((uint64_t)1) << 40) / 255 + 1;  // "1/255" in 24.40 fixed point number
    return (M * n) >> 40;   // fixed point multiply: n * (1/255)
}
</code>```

More expansive (requires 64-bits mul), but still faster than div instruction.

Body:
Accurate version:

#define div_255_fast(x)    (((x) + (((x) + 257) >> 8)) >> 8)

When x is in the range of [0, 65536], the ERROR is 0. It is twice as faster as x/255：

http://quick-bench.com/t3Y2-b4isYIwnKwMaPQi3n9dmtQ

SIMD version:

// (x + ((x + 257) >> 8)) >> 8
static inline __m128i _mm_fast_div_255_epu16(__m128i x) {
    return _mm_srli_epi16(_mm_adds_epu16(x,
        _mm_srli_epi16(_mm_adds_epu16(x, _mm_set1_epi16(0x0101)), 8)), 8);
}

For a positive x above 65535, here is another version:

static inline int32_t fast_div_255_any (int32_t n) {
    uint64_t M = (((uint64_t)1) << 40) / 255 + 1;  // "1/255" in 24.40 fixed point number
    return (M * n) >> 40;   // fixed point multiply: n * (1/255)
}

More expansive (requires 64-bits mul), but still faster than div instruction.


问:
Error while publishing the artifacts to Artifactory using Jenkins Pipeline Script

What I'm trying

I'm building an application using Artifactory maven and publishing the artifacts generated, to the Artifactory server.

What I need

If there are any suggestions, I would love to try them right away. ;)

Jenkins Pipeline Script

```<code> stage ('Build and Deploy Artifacts') {
    def server = Artifactory.newServer url: 'http://****/home', credentialsId: 'd***5c1'
    def rtMaven = Artifactory.newMavenBuild()
    rtMaven.resolver releaseRepo:'libs-release', snapshotRepo:'libs-snapshot', server: server
    rtMaven.deployer releaseRepo:'develop-release', snapshotRepo:'develop-snapshot', server: server
    rtMaven.tool = 'maven' // Tool name from Jenkins configuration
    def buildInfo = rtMaven.run pom: 'pom.xml', goals: 'clean install -Dmaven.test.skip=true' //buildInfo: buildInfo'
    buildInfo.env.capture = true
    server.publishBuildInfo buildInfo
}

</code>```

Errors being displayed on Jenkins

```Started by user Sunil boga
    [Pipeline] node
    Running on master in /var/lib/jenkins/workspace/JF
            [Pipeline] {
            [Pipeline] stage
            [Pipeline] { (Checkout)
            [Pipeline] checkout
     > git rev-parse --is-inside-work-tree # timeout=10
    Fetching changes from the remote Git repository
     > git config remote.origin.url https:***.git # timeout=10
    Fetching upstream changes from https:***.git
     > git --version # timeout=10
     > git fetch --tags --progress https:***.git +refs/heads/*:refs/remotes/origin/*
     > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
     > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
    Checking out Revision a704ec6ba9b9af8a1a02aeb3d1041a15135ac3d4 (refs/remotes/origin/master)
    Commit message: "Update docker-compose.yml"
     > git config core.sparsecheckout # timeout=10
     > git checkout -f a704ec6ba9b9af8a1a02aeb3d1041a15135ac3d4
     > git rev-list a704ec6ba9b9af8a1a02aeb3d1041a15135ac3d4 # timeout=10
    [Pipeline] }
    [Pipeline] // stage
    [Pipeline] stage
    [Pipeline] { (Build and Deploy Artifacts)
    [Pipeline] newArtifactoryServer
    [Pipeline] newMavenBuild
    [Pipeline] ArtifactoryMavenBuild
    Jenkins Artifactory Plugin version: 2.13.0
    Artifactory integration is enabled

[JF] $ java -classpath /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/maven/boot/* -Dmaven.home=/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/maven -DbuildInfoConfig.propertiesFile=/var/lib/jenkins/workspace/JF@tmp/buildInfo7470386380438368064.properties -Dm3plugin.lib=/var/lib/jenkins/workspace/JF@tmp/cache/artifactory-plugin/2.13.0 -Dclassworlds.conf=/var/lib/jenkins/workspace/JF@tmp/classworlds7388179377818037761conf -Dmaven.multiModuleProjectDirectory=/var/lib/jenkins/workspace/JF org.codehaus.plexus.classworlds.launcher.Launcher -f pom.xml clean install -Dmaven.test.skip=true
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Scanning for projects...
    [main] INFO org.jfrog.build.extractor.maven.BuildInfoRecorder - Initializing Artifactory Build-Info Recording
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Building SampleProjectForCICD 0.0.1-SNAPSHOT
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
    [main] WARNING org.codehaus.plexus.PlexusContainer - The POM for com.oracle.jdbc:ojdbc8:jar:12.2.0.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-clean-plugin:2.6.1:clean (default-clean) @ sampleproject ---
    [main] INFO org.apache.maven.plugin.clean.CleanMojo - Deleting /var/lib/jenkins/workspace/JF/target
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-resources-plugin:2.6:resources (default-resources) @ sampleproject ---
    [main] INFO org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering - Using 'UTF-8' encoding to copy filtered resources.
    [main] INFO org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering - Copying 1 resource
    [main] INFO org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering - Copying 3 resources
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-compiler-plugin:3.1:compile (default-compile) @ sampleproject ---
    [main] INFO org.apache.maven.plugin.compiler.CompilerMojo - Changes detected - recompiling the module!
    [main] INFO org.codehaus.plexus.compiler.javac.JavacCompiler - Compiling 11 source files to /var/lib/jenkins/workspace/JF/target/classes
    [main] WARNING org.apache.maven.plugin.compiler.CompilerMojo - /var/lib/jenkins/workspace/JF/src/main/java/guru/springframework/controllers/ProductAPI.java: /var/lib/jenkins/workspace/JF/src/main/java/guru/springframework/controllers/ProductAPI.java uses unchecked or unsafe operations.
    [main] WARNING org.apache.maven.plugin.compiler.CompilerMojo - /var/lib/jenkins/workspace/JF/src/main/java/guru/springframework/controllers/ProductAPI.java: Recompile with -Xlint:unchecked for details.
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-resources-plugin:2.6:testResources (default-testResources) @ sampleproject ---
    [main] INFO org.apache.maven.plugin.resources.TestResourcesMojo - Not copying test resources
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ sampleproject ---
    [main] INFO org.apache.maven.plugin.compiler.TestCompilerMojo - Not compiling test sources
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-surefire-plugin:2.18.1:test (default-test) @ sampleproject ---
    [main] INFO org.apache.maven.plugin.surefire.SurefirePlugin - Tests are skipped.
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-jar-plugin:2.6:jar (default-jar) @ sampleproject ---
    [main] INFO org.codehaus.plexus.archiver.jar.JarArchiver - Building jar: /var/lib/jenkins/workspace/JF/target/sampleproject-0.0.1-SNAPSHOT.jar
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- spring-boot-maven-plugin:1.5.1.RELEASE:repackage (default) @ sampleproject ---
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-install-plugin:2.5.2:install (default-install) @ sampleproject ---
    [main] INFO org.codehaus.plexus.PlexusContainer - Installing /var/lib/jenkins/workspace/JF/target/sampleproject-0.0.1-SNAPSHOT.jar to /var/lib/jenkins/.m2/repository/com/fortna/cicd/sampleproject/0.0.1-SNAPSHOT/sampleproject-0.0.1-SNAPSHOT.jar
    [main] INFO org.codehaus.plexus.PlexusContainer - Installing /var/lib/jenkins/workspace/JF/pom.xml to /var/lib/jenkins/.m2/repository/com/fortna/cicd/sampleproject/0.0.1-SNAPSHOT/sampleproject-0.0.1-SNAPSHOT.pom
    [main] INFO org.jfrog.build.extractor.maven.BuildInfoClientBuilder - Deploying artifact: http://***:8081/artifactory/webapp/#/home/develop-snapshot/com/fortna/cicd/sampleproject/0.0.1-SNAPSHOT/sampleproject-0.0.1-SNAPSHOT.jar
    [main] WARNING org.jfrog.build.extractor.maven.BuildInfoClientBuilder - Error occurred for request PUT /artifactory/webapp/%23/home/develop-snapshot/com/fortna/cicd/sampleproject/0.0.1-SNAPSHOT/sampleproject-0.0.1-SNAPSHOT.jar;vcs.revision=a704ec6ba9b9af8a1a02aeb3d1041a15135ac3d4;build.timestamp=1512480424292;build.name=JF;build.number=19 HTTP/1.1: Connection reset.
    [main] WARNING org.jfrog.build.extractor.maven.BuildInfoClientBuilder - Attempting retry #1
    [main] INFO org.apache.http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request to {}->http://***:8081: Connection reset
    [main] INFO org.apache.http.impl.execchain.RetryExec - Retrying request to {}->http://***:8081
    [main] WARNING org.jfrog.build.extractor.maven.BuildInfoClientBuilder - Error occurred for request PUT /artifactory/webapp/%23/home/develop-snapshot/com/fortna/cicd/sampleproject/0.0.1-SNAPSHOT/sampleproject-0.0.1-SNAPSHOT.jar;vcs.revision=a704ec6ba9b9af8a1a02aeb3d1041a15135ac3d4;build.timestamp=1512480424292;build.name=JF;build.number=19 HTTP/1.1: Connection reset.
    [main] WARNING org.jfrog.build.extractor.maven.BuildInfoClientBuilder - Attempting retry #2
    [main] INFO org.apache.http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request to {}->http://***:8081: Connection reset
    [main] INFO org.apache.http.impl.execchain.RetryExec - Retrying request to {}->http://***:8081
    [main] WARNING org.jfrog.build.extractor.maven.BuildInfoClientBuilder - Error occurred for request PUT /artifactory/webapp/%23/home/develop-snapshot/com/fortna/cicd/sampleproject/0.0.1-SNAPSHOT/sampleproject-0.0.1-SNAPSHOT.jar;vcs.revision=a704ec6ba9b9af8a1a02aeb3d1041a15135ac3d4;build.timestamp=1512480424292;build.name=JF;build.number=19 HTTP/1.1: Connection reset.
    [main] WARNING org.jfrog.build.extractor.maven.BuildInfoClientBuilder - Attempting retry #3
    [main] INFO org.apache.http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request to {}->http://***:8081: Connection reset
    [main] INFO org.apache.http.impl.execchain.RetryExec - Retrying request to {}->http://***:8081
    [main] WARNING org.jfrog.build.extractor.maven.BuildInfoClientBuilder - Error occurred for request PUT /artifactory/webapp/%23/home/develop-snapshot/com/fortna/cicd/sampleproject/0.0.1-SNAPSHOT/sampleproject-0.0.1-SNAPSHOT.jar;vcs.revision=a704ec6ba9b9af8a1a02aeb3d1041a15135ac3d4;build.timestamp=1512480424292;build.name=JF;build.number=19 HTTP/1.1: Connection reset.
    [main] ERROR org.jfrog.build.extractor.maven.BuildInfoRecorder - org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed:
    java.lang.RuntimeException: Error occurred while publishing artifact to Artifactory: /var/lib/jenkins/workspace/JF/target/sampleproject-0.0.1-SNAPSHOT.jar.
     Skipping deployment of remaining artifacts (if any) and build info.
        at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deployArtifacts (BuildDeploymentHelper.java:296)
        at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deploy (BuildDeploymentHelper.java:117)
        at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded (BuildInfoRecorder.java:173)
        at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64)
        at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:137)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
        at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
    Caused by: java.net.SocketException: Connection reset
        at java.net.SocketOutputStream.socketWrite (SocketOutputStream.java:115)
        at java.net.SocketOutputStream.write (SocketOutputStream.java:155)
        at org.apache.http.impl.io.SessionOutputBufferImpl.streamWrite (SessionOutputBufferImpl.java:124)
        at org.apache.http.impl.io.SessionOutputBufferImpl.flushBuffer (SessionOutputBufferImpl.java:136)
        at org.apache.http.impl.io.SessionOutputBufferImpl.write (SessionOutputBufferImpl.java:167)
        at org.apache.http.impl.io.ContentLengthOutputStream.write (ContentLengthOutputStream.java:113)
        at org.apache.http.entity.FileEntity.writeTo (FileEntity.java:99)
        at org.apache.http.impl.DefaultBHttpClientConnection.sendRequestEntity (DefaultBHttpClientConnection.java:156)
        at org.apache.http.impl.conn.CPoolProxy.sendRequestEntity (CPoolProxy.java:162)
        at org.apache.http.protocol.HttpRequestExecutor.doSendRequest (HttpRequestExecutor.java:238)
        at org.apache.http.protocol.HttpRequestExecutor.execute (HttpRequestExecutor.java:123)
        at org.apache.http.impl.execchain.MainClientExec.execute (MainClientExec.java:271)
        at org.apache.http.impl.execchain.ProtocolExec.execute (ProtocolExec.java:184)
        at org.apache.http.impl.execchain.RetryExec.execute (RetryExec.java:88)
        at org.apache.http.impl.execchain.RedirectExec.execute (RedirectExec.java:110)
        at org.apache.http.impl.execchain.ServiceUnavailableRetryExec.execute (ServiceUnavailableRetryExec.java:84)
        at org.apache.http.impl.client.InternalHttpClient.doExecute (InternalHttpClient.java:184)
        at org.apache.http.impl.client.CloseableHttpClient.execute (CloseableHttpClient.java:82)
        at org.jfrog.build.client.PreemptiveHttpClient.execute (PreemptiveHttpClient.java:103)
        at org.jfrog.build.client.ArtifactoryHttpClient.execute (ArtifactoryHttpClient.java:216)
        at org.jfrog.build.client.ArtifactoryHttpClient.upload (ArtifactoryHttpClient.java:212)
        at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile (ArtifactoryBuildInfoClient.java:654)
        at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact (ArtifactoryBuildInfoClient.java:344)
        at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deployArtifacts (BuildDeploymentHelper.java:294)
        at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deploy (BuildDeploymentHelper.java:117)
        at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded (BuildInfoRecorder.java:173)
        at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64)
        at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:137)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
        at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
    [main] ERROR org.apache.maven.cli.MavenCli - Internal error: java.lang.RuntimeException: org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed: Error occurred while publishing artifact to Artifactory: /var/lib/jenkins/workspace/JF/target/sampleproject-0.0.1-SNAPSHOT.jar.
    [main] ERROR org.apache.maven.cli.MavenCli -  Skipping deployment of remaining artifacts (if any) and build info. Connection reset
    [main] ERROR org.apache.maven.cli.MavenCli - -> [Help 1]
    org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed:
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:122)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
        at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
    Caused by: java.lang.RuntimeException: org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed:
        at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded (BuildInfoRecorder.java:182)
        at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64)
        at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:137)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
        at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
    Caused by: java.lang.RuntimeException: Error occurred while publishing artifact to Artifactory: /var/lib/jenkins/workspace/JF/target/sampleproject-0.0.1-SNAPSHOT.jar.
     Skipping deployment of remaining artifacts (if any) and build info.
        at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deployArtifacts (BuildDeploymentHelper.java:296)
        at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deploy (BuildDeploymentHelper.java:117)
        at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded (BuildInfoRecorder.java:173)
        at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64)
        at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:137)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
        at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
    Caused by: java.net.SocketException: Connection reset
        at java.net.SocketOutputStream.socketWrite (SocketOutputStream.java:115)
        at java.net.SocketOutputStream.write (SocketOutputStream.java:155)
        at org.apache.http.impl.io.SessionOutputBufferImpl.streamWrite (SessionOutputBufferImpl.java:124)
        at org.apache.http.impl.io.SessionOutputBufferImpl.flushBuffer (SessionOutputBufferImpl.java:136)
        at org.apache.http.impl.io.SessionOutputBufferImpl.write (SessionOutputBufferImpl.java:167)
        at org.apache.http.impl.io.ContentLengthOutputStream.write (ContentLengthOutputStream.java:113)
        at org.apache.http.entity.FileEntity.writeTo (FileEntity.java:99)
        at org.apache.http.impl.DefaultBHttpClientConnection.sendRequestEntity (DefaultBHttpClientConnection.java:156)
        at org.apache.http.impl.conn.CPoolProxy.sendRequestEntity (CPoolProxy.java:162)
        at org.apache.http.protocol.HttpRequestExecutor.doSendRequest (HttpRequestExecutor.java:238)
        at org.apache.http.protocol.HttpRequestExecutor.execute (HttpRequestExecutor.java:123)
        at org.apache.http.impl.execchain.MainClientExec.execute (MainClientExec.java:271)
        at org.apache.http.impl.execchain.ProtocolExec.execute (ProtocolExec.java:184)
        at org.apache.http.impl.execchain.RetryExec.execute (RetryExec.java:88)
        at org.apache.http.impl.execchain.RedirectExec.execute (RedirectExec.java:110)
        at org.apache.http.impl.execchain.ServiceUnavailableRetryExec.execute (ServiceUnavailableRetryExec.java:84)
        at org.apache.http.impl.client.InternalHttpClient.doExecute (InternalHttpClient.java:184)
        at org.apache.http.impl.client.CloseableHttpClient.execute (CloseableHttpClient.java:82)
        at org.jfrog.build.client.PreemptiveHttpClient.execute (PreemptiveHttpClient.java:103)
        at org.jfrog.build.client.ArtifactoryHttpClient.execute (ArtifactoryHttpClient.java:216)
        at org.jfrog.build.client.ArtifactoryHttpClient.upload (ArtifactoryHttpClient.java:212)
        at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile (ArtifactoryBuildInfoClient.java:654)
        at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact (ArtifactoryBuildInfoClient.java:344)
        at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deployArtifacts (BuildDeploymentHelper.java:294)
        at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deploy (BuildDeploymentHelper.java:117)
        at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded (BuildInfoRecorder.java:173)
        at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64)
        at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:137)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
        at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
    [main] ERROR org.apache.maven.cli.MavenCli -
    [main] ERROR org.apache.maven.cli.MavenCli - To see the full stack trace of the errors, re-run Maven with the -e switch.
    [main] ERROR org.apache.maven.cli.MavenCli - Re-run Maven using the -X switch to enable full debug logging.
    [main] ERROR org.apache.maven.cli.MavenCli -
    [main] ERROR org.apache.maven.cli.MavenCli - For more information about the errors and possible solutions, please read the following articles:
    [main] ERROR org.apache.maven.cli.MavenCli - [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorException
    [Pipeline] }
    [Pipeline] // stage
    [Pipeline] }
    [Pipeline] // node
    [Pipeline] End of Pipeline
    java.lang.RuntimeException: Maven build failed
        at org.jfrog.hudson.pipeline.steps.ArtifactoryMavenBuild$Execution.run(ArtifactoryMavenBuild.java:108)
        at org.jfrog.hudson.pipeline.steps.ArtifactoryMavenBuild$Execution.run(ArtifactoryMavenBuild.java:61)
        at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
        at hudson.security.ACL.impersonate(ACL.java:260)
        at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
    Finished: FAILURE
```

答:
[ERROR] org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed:
  [ERROR] Skipping deployment of remaining artifacts (if any) and build info. Connection reset
  [ERROR] -> [Help 1]

Solution:

If a job fails for the above reasons, then we need to uncheck the -Mask password parameters (username and password) under -Inject passwords to the build as environment variables inside the Build Environment.

Then rerun the job.

Body:
What I'm trying

I'm building an application using Artifactory maven and publishing the artifacts generated, to the Artifactory server.

What I need

If there are any suggestions, I would love to try them right away. ;)

Jenkins Pipeline Script

 stage ('Build and Deploy Artifacts') {
    def server = Artifactory.newServer url: 'http://****/home', credentialsId: 'd***5c1'
    def rtMaven = Artifactory.newMavenBuild()
    rtMaven.resolver releaseRepo:'libs-release', snapshotRepo:'libs-snapshot', server: server
    rtMaven.deployer releaseRepo:'develop-release', snapshotRepo:'develop-snapshot', server: server
    rtMaven.tool = 'maven' // Tool name from Jenkins configuration
    def buildInfo = rtMaven.run pom: 'pom.xml', goals: 'clean install -Dmaven.test.skip=true' //buildInfo: buildInfo'
    buildInfo.env.capture = true
    server.publishBuildInfo buildInfo
}

Errors being displayed on Jenkins

Started by user Sunil boga
    [Pipeline] node
    Running on master in /var/lib/jenkins/workspace/JF
            [Pipeline] {
            [Pipeline] stage
            [Pipeline] { (Checkout)
            [Pipeline] checkout
     > git rev-parse --is-inside-work-tree # timeout=10
    Fetching changes from the remote Git repository
     > git config remote.origin.url https:***.git # timeout=10
    Fetching upstream changes from https:***.git
     > git --version # timeout=10
     > git fetch --tags --progress https:***.git +refs/heads/*:refs/remotes/origin/*
     > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
     > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
    Checking out Revision a704ec6ba9b9af8a1a02aeb3d1041a15135ac3d4 (refs/remotes/origin/master)
    Commit message: "Update docker-compose.yml"
     > git config core.sparsecheckout # timeout=10
     > git checkout -f a704ec6ba9b9af8a1a02aeb3d1041a15135ac3d4
     > git rev-list a704ec6ba9b9af8a1a02aeb3d1041a15135ac3d4 # timeout=10
    [Pipeline] }
    [Pipeline] // stage
    [Pipeline] stage
    [Pipeline] { (Build and Deploy Artifacts)
    [Pipeline] newArtifactoryServer
    [Pipeline] newMavenBuild
    [Pipeline] ArtifactoryMavenBuild
    Jenkins Artifactory Plugin version: 2.13.0
    Artifactory integration is enabled

[JF] $ java -classpath /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/maven/boot/* -Dmaven.home=/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/maven -DbuildInfoConfig.propertiesFile=/var/lib/jenkins/workspace/JF@tmp/buildInfo7470386380438368064.properties -Dm3plugin.lib=/var/lib/jenkins/workspace/JF@tmp/cache/artifactory-plugin/2.13.0 -Dclassworlds.conf=/var/lib/jenkins/workspace/JF@tmp/classworlds7388179377818037761conf -Dmaven.multiModuleProjectDirectory=/var/lib/jenkins/workspace/JF org.codehaus.plexus.classworlds.launcher.Launcher -f pom.xml clean install -Dmaven.test.skip=true
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Scanning for projects...
    [main] INFO org.jfrog.build.extractor.maven.BuildInfoRecorder - Initializing Artifactory Build-Info Recording
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Building SampleProjectForCICD 0.0.1-SNAPSHOT
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
    [main] WARNING org.codehaus.plexus.PlexusContainer - The POM for com.oracle.jdbc:ojdbc8:jar:12.2.0.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-clean-plugin:2.6.1:clean (default-clean) @ sampleproject ---
    [main] INFO org.apache.maven.plugin.clean.CleanMojo - Deleting /var/lib/jenkins/workspace/JF/target
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-resources-plugin:2.6:resources (default-resources) @ sampleproject ---
    [main] INFO org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering - Using 'UTF-8' encoding to copy filtered resources.
    [main] INFO org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering - Copying 1 resource
    [main] INFO org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering - Copying 3 resources
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-compiler-plugin:3.1:compile (default-compile) @ sampleproject ---
    [main] INFO org.apache.maven.plugin.compiler.CompilerMojo - Changes detected - recompiling the module!
    [main] INFO org.codehaus.plexus.compiler.javac.JavacCompiler - Compiling 11 source files to /var/lib/jenkins/workspace/JF/target/classes
    [main] WARNING org.apache.maven.plugin.compiler.CompilerMojo - /var/lib/jenkins/workspace/JF/src/main/java/guru/springframework/controllers/ProductAPI.java: /var/lib/jenkins/workspace/JF/src/main/java/guru/springframework/controllers/ProductAPI.java uses unchecked or unsafe operations.
    [main] WARNING org.apache.maven.plugin.compiler.CompilerMojo - /var/lib/jenkins/workspace/JF/src/main/java/guru/springframework/controllers/ProductAPI.java: Recompile with -Xlint:unchecked for details.
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-resources-plugin:2.6:testResources (default-testResources) @ sampleproject ---
    [main] INFO org.apache.maven.plugin.resources.TestResourcesMojo - Not copying test resources
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ sampleproject ---
    [main] INFO org.apache.maven.plugin.compiler.TestCompilerMojo - Not compiling test sources
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-surefire-plugin:2.18.1:test (default-test) @ sampleproject ---
    [main] INFO org.apache.maven.plugin.surefire.SurefirePlugin - Tests are skipped.
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-jar-plugin:2.6:jar (default-jar) @ sampleproject ---
    [main] INFO org.codehaus.plexus.archiver.jar.JarArchiver - Building jar: /var/lib/jenkins/workspace/JF/target/sampleproject-0.0.1-SNAPSHOT.jar
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- spring-boot-maven-plugin:1.5.1.RELEASE:repackage (default) @ sampleproject ---
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
    [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-install-plugin:2.5.2:install (default-install) @ sampleproject ---
    [main] INFO org.codehaus.plexus.PlexusContainer - Installing /var/lib/jenkins/workspace/JF/target/sampleproject-0.0.1-SNAPSHOT.jar to /var/lib/jenkins/.m2/repository/com/fortna/cicd/sampleproject/0.0.1-SNAPSHOT/sampleproject-0.0.1-SNAPSHOT.jar
    [main] INFO org.codehaus.plexus.PlexusContainer - Installing /var/lib/jenkins/workspace/JF/pom.xml to /var/lib/jenkins/.m2/repository/com/fortna/cicd/sampleproject/0.0.1-SNAPSHOT/sampleproject-0.0.1-SNAPSHOT.pom
    [main] INFO org.jfrog.build.extractor.maven.BuildInfoClientBuilder - Deploying artifact: http://***:8081/artifactory/webapp/#/home/develop-snapshot/com/fortna/cicd/sampleproject/0.0.1-SNAPSHOT/sampleproject-0.0.1-SNAPSHOT.jar
    [main] WARNING org.jfrog.build.extractor.maven.BuildInfoClientBuilder - Error occurred for request PUT /artifactory/webapp/%23/home/develop-snapshot/com/fortna/cicd/sampleproject/0.0.1-SNAPSHOT/sampleproject-0.0.1-SNAPSHOT.jar;vcs.revision=a704ec6ba9b9af8a1a02aeb3d1041a15135ac3d4;build.timestamp=1512480424292;build.name=JF;build.number=19 HTTP/1.1: Connection reset.
    [main] WARNING org.jfrog.build.extractor.maven.BuildInfoClientBuilder - Attempting retry #1
    [main] INFO org.apache.http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request to {}->http://***:8081: Connection reset
    [main] INFO org.apache.http.impl.execchain.RetryExec - Retrying request to {}->http://***:8081
    [main] WARNING org.jfrog.build.extractor.maven.BuildInfoClientBuilder - Error occurred for request PUT /artifactory/webapp/%23/home/develop-snapshot/com/fortna/cicd/sampleproject/0.0.1-SNAPSHOT/sampleproject-0.0.1-SNAPSHOT.jar;vcs.revision=a704ec6ba9b9af8a1a02aeb3d1041a15135ac3d4;build.timestamp=1512480424292;build.name=JF;build.number=19 HTTP/1.1: Connection reset.
    [main] WARNING org.jfrog.build.extractor.maven.BuildInfoClientBuilder - Attempting retry #2
    [main] INFO org.apache.http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request to {}->http://***:8081: Connection reset
    [main] INFO org.apache.http.impl.execchain.RetryExec - Retrying request to {}->http://***:8081
    [main] WARNING org.jfrog.build.extractor.maven.BuildInfoClientBuilder - Error occurred for request PUT /artifactory/webapp/%23/home/develop-snapshot/com/fortna/cicd/sampleproject/0.0.1-SNAPSHOT/sampleproject-0.0.1-SNAPSHOT.jar;vcs.revision=a704ec6ba9b9af8a1a02aeb3d1041a15135ac3d4;build.timestamp=1512480424292;build.name=JF;build.number=19 HTTP/1.1: Connection reset.
    [main] WARNING org.jfrog.build.extractor.maven.BuildInfoClientBuilder - Attempting retry #3
    [main] INFO org.apache.http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request to {}->http://***:8081: Connection reset
    [main] INFO org.apache.http.impl.execchain.RetryExec - Retrying request to {}->http://***:8081
    [main] WARNING org.jfrog.build.extractor.maven.BuildInfoClientBuilder - Error occurred for request PUT /artifactory/webapp/%23/home/develop-snapshot/com/fortna/cicd/sampleproject/0.0.1-SNAPSHOT/sampleproject-0.0.1-SNAPSHOT.jar;vcs.revision=a704ec6ba9b9af8a1a02aeb3d1041a15135ac3d4;build.timestamp=1512480424292;build.name=JF;build.number=19 HTTP/1.1: Connection reset.
    [main] ERROR org.jfrog.build.extractor.maven.BuildInfoRecorder - org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed:
    java.lang.RuntimeException: Error occurred while publishing artifact to Artifactory: /var/lib/jenkins/workspace/JF/target/sampleproject-0.0.1-SNAPSHOT.jar.
     Skipping deployment of remaining artifacts (if any) and build info.
        at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deployArtifacts (BuildDeploymentHelper.java:296)
        at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deploy (BuildDeploymentHelper.java:117)
        at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded (BuildInfoRecorder.java:173)
        at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64)
        at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:137)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
        at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
    Caused by: java.net.SocketException: Connection reset
        at java.net.SocketOutputStream.socketWrite (SocketOutputStream.java:115)
        at java.net.SocketOutputStream.write (SocketOutputStream.java:155)
        at org.apache.http.impl.io.SessionOutputBufferImpl.streamWrite (SessionOutputBufferImpl.java:124)
        at org.apache.http.impl.io.SessionOutputBufferImpl.flushBuffer (SessionOutputBufferImpl.java:136)
        at org.apache.http.impl.io.SessionOutputBufferImpl.write (SessionOutputBufferImpl.java:167)
        at org.apache.http.impl.io.ContentLengthOutputStream.write (ContentLengthOutputStream.java:113)
        at org.apache.http.entity.FileEntity.writeTo (FileEntity.java:99)
        at org.apache.http.impl.DefaultBHttpClientConnection.sendRequestEntity (DefaultBHttpClientConnection.java:156)
        at org.apache.http.impl.conn.CPoolProxy.sendRequestEntity (CPoolProxy.java:162)
        at org.apache.http.protocol.HttpRequestExecutor.doSendRequest (HttpRequestExecutor.java:238)
        at org.apache.http.protocol.HttpRequestExecutor.execute (HttpRequestExecutor.java:123)
        at org.apache.http.impl.execchain.MainClientExec.execute (MainClientExec.java:271)
        at org.apache.http.impl.execchain.ProtocolExec.execute (ProtocolExec.java:184)
        at org.apache.http.impl.execchain.RetryExec.execute (RetryExec.java:88)
        at org.apache.http.impl.execchain.RedirectExec.execute (RedirectExec.java:110)
        at org.apache.http.impl.execchain.ServiceUnavailableRetryExec.execute (ServiceUnavailableRetryExec.java:84)
        at org.apache.http.impl.client.InternalHttpClient.doExecute (InternalHttpClient.java:184)
        at org.apache.http.impl.client.CloseableHttpClient.execute (CloseableHttpClient.java:82)
        at org.jfrog.build.client.PreemptiveHttpClient.execute (PreemptiveHttpClient.java:103)
        at org.jfrog.build.client.ArtifactoryHttpClient.execute (ArtifactoryHttpClient.java:216)
        at org.jfrog.build.client.ArtifactoryHttpClient.upload (ArtifactoryHttpClient.java:212)
        at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile (ArtifactoryBuildInfoClient.java:654)
        at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact (ArtifactoryBuildInfoClient.java:344)
        at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deployArtifacts (BuildDeploymentHelper.java:294)
        at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deploy (BuildDeploymentHelper.java:117)
        at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded (BuildInfoRecorder.java:173)
        at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64)
        at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:137)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
        at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
    [main] ERROR org.apache.maven.cli.MavenCli - Internal error: java.lang.RuntimeException: org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed: Error occurred while publishing artifact to Artifactory: /var/lib/jenkins/workspace/JF/target/sampleproject-0.0.1-SNAPSHOT.jar.
    [main] ERROR org.apache.maven.cli.MavenCli -  Skipping deployment of remaining artifacts (if any) and build info. Connection reset
    [main] ERROR org.apache.maven.cli.MavenCli - -> [Help 1]
    org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed:
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:122)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
        at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
    Caused by: java.lang.RuntimeException: org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed:
        at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded (BuildInfoRecorder.java:182)
        at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64)
        at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:137)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
        at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
    Caused by: java.lang.RuntimeException: Error occurred while publishing artifact to Artifactory: /var/lib/jenkins/workspace/JF/target/sampleproject-0.0.1-SNAPSHOT.jar.
     Skipping deployment of remaining artifacts (if any) and build info.
        at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deployArtifacts (BuildDeploymentHelper.java:296)
        at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deploy (BuildDeploymentHelper.java:117)
        at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded (BuildInfoRecorder.java:173)
        at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64)
        at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:137)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
        at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
    Caused by: java.net.SocketException: Connection reset
        at java.net.SocketOutputStream.socketWrite (SocketOutputStream.java:115)
        at java.net.SocketOutputStream.write (SocketOutputStream.java:155)
        at org.apache.http.impl.io.SessionOutputBufferImpl.streamWrite (SessionOutputBufferImpl.java:124)
        at org.apache.http.impl.io.SessionOutputBufferImpl.flushBuffer (SessionOutputBufferImpl.java:136)
        at org.apache.http.impl.io.SessionOutputBufferImpl.write (SessionOutputBufferImpl.java:167)
        at org.apache.http.impl.io.ContentLengthOutputStream.write (ContentLengthOutputStream.java:113)
        at org.apache.http.entity.FileEntity.writeTo (FileEntity.java:99)
        at org.apache.http.impl.DefaultBHttpClientConnection.sendRequestEntity (DefaultBHttpClientConnection.java:156)
        at org.apache.http.impl.conn.CPoolProxy.sendRequestEntity (CPoolProxy.java:162)
        at org.apache.http.protocol.HttpRequestExecutor.doSendRequest (HttpRequestExecutor.java:238)
        at org.apache.http.protocol.HttpRequestExecutor.execute (HttpRequestExecutor.java:123)
        at org.apache.http.impl.execchain.MainClientExec.execute (MainClientExec.java:271)
        at org.apache.http.impl.execchain.ProtocolExec.execute (ProtocolExec.java:184)
        at org.apache.http.impl.execchain.RetryExec.execute (RetryExec.java:88)
        at org.apache.http.impl.execchain.RedirectExec.execute (RedirectExec.java:110)
        at org.apache.http.impl.execchain.ServiceUnavailableRetryExec.execute (ServiceUnavailableRetryExec.java:84)
        at org.apache.http.impl.client.InternalHttpClient.doExecute (InternalHttpClient.java:184)
        at org.apache.http.impl.client.CloseableHttpClient.execute (CloseableHttpClient.java:82)
        at org.jfrog.build.client.PreemptiveHttpClient.execute (PreemptiveHttpClient.java:103)
        at org.jfrog.build.client.ArtifactoryHttpClient.execute (ArtifactoryHttpClient.java:216)
        at org.jfrog.build.client.ArtifactoryHttpClient.upload (ArtifactoryHttpClient.java:212)
        at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile (ArtifactoryBuildInfoClient.java:654)
        at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact (ArtifactoryBuildInfoClient.java:344)
        at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deployArtifacts (BuildDeploymentHelper.java:294)
        at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deploy (BuildDeploymentHelper.java:117)
        at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded (BuildInfoRecorder.java:173)
        at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64)
        at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:137)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
        at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
    [main] ERROR org.apache.maven.cli.MavenCli -
    [main] ERROR org.apache.maven.cli.MavenCli - To see the full stack trace of the errors, re-run Maven with the -e switch.
    [main] ERROR org.apache.maven.cli.MavenCli - Re-run Maven using the -X switch to enable full debug logging.
    [main] ERROR org.apache.maven.cli.MavenCli -
    [main] ERROR org.apache.maven.cli.MavenCli - For more information about the errors and possible solutions, please read the following articles:
    [main] ERROR org.apache.maven.cli.MavenCli - [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorException
    [Pipeline] }
    [Pipeline] // stage
    [Pipeline] }
    [Pipeline] // node
    [Pipeline] End of Pipeline
    java.lang.RuntimeException: Maven build failed
        at org.jfrog.hudson.pipeline.steps.ArtifactoryMavenBuild$Execution.run(ArtifactoryMavenBuild.java:108)
        at org.jfrog.hudson.pipeline.steps.ArtifactoryMavenBuild$Execution.run(ArtifactoryMavenBuild.java:61)
        at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
        at hudson.security.ACL.impersonate(ACL.java:260)
        at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
    Finished: FAILURE


问:
iOS images galleriers
I'd like to develop an app to visualize galleries and I really like the Flickr official app or Instabam app style.

Basically, something like this (instabam app)

my idea was to use a scrollview with buttons to easily handle touch event.
Is this a good approach?
Are there better approaches?

答: Have you considered using an open source library such as AQGridView?</p>

Title: iOS images galleriers


问:
I am getting a problem while understanding the UserMixin in Flask
I am currently learning flask and I have heard about the concept called UserMixin can anybody please tell what does it mean and how it works.</p>

答: UserMixin is part of flask-login package that implements user authentication functionality. In order for flask-login to work, it expects your User object to have certain pre-defined methods, like get_id(), is_authenticated(), etc (you can see what these are in the docs here). Technically you don't have to use the mixin and implement these methods yourself, but extending from mixin is a nice shortcut.


问:
Multitouch support for html5 mobile app? Specifically for map zoom/display
I want to make an html5-based webpage for mobile devices that shows a map from Google Maps (or other map provider, however I prefer GMaps), with multitouch support. Is this possible?

By this I mean: If you open Google Maps' android native app you see that you can pinch to zoom, rotate the map with two fingers, etc. However if you look at Google Maps' html5 app on a mobile platform, while you can still pan around with one finger you can't pinch to zoom etc. To zoom in the latter (html5) app, you have to press the provided "+" and "-" buttons.

Lastly, there may be some funky way of doing this that works for my particular application that is not the regular way of embedding GMaps in html5, so I want to share my application idea briefly. The overall goal is to make an html5 mobile app that shows only a limited area (say, 20km around a developer-chosen location) at only a few zoom levels (say, 4 levels). This means that there is only a small finite number of tiles that ever need to be displayed. So perhaps these tiles could be prepackaged and stored locally when the app is first loaded, in order that the user never has to wait for a tile to load on-the-fly. Therefore the GMaps APIs may never need to be used by the app user, it may be simply like a large image I am just panning/zooming around inside. In fact, we can use another map provider, not GMaps, if that is easier. Is there some other funky way of doing this other than the regular way of embedding (Google)Maps data in html5 document?

Thanks,

答:
Google Maps API v3 understands pinch-to-zoom on mobile devices.  It does not require the use of the + and - buttons.  Example:  http://tiny.ucsf.edu/parnassus_map

Exception:  It seems that some HTC hardware running Android OS doesn't handle pinch-to-zoom in an expected way in this context.  I believe this has to do with ignoring the viewport settings in the web page that tell the browser to not handle the zooming itself.  I am unaware of any workaround for this problem and have been living with it for some time.  I have experienced this problem on HTC hardware like the Evo and Thunderbolt, but not on hardware by other manufacturers.

UPDATE: OP reports problem on Droid 2, so I guess it's not just HTC hardware.  One device that does not exhibit the problem is a Galaxy Tab running Honeycomb, so it would appear that not all Android devices are affected.

YET MORE FURTHER SON OF UPDATE: It would appear that, currently, you cannot rely on being able to receive pinch-to-zoom events in JavaScript on Android browsers. Here it is in the Android issue tracker: http://code.google.com/p/android/issues/detail?id=11909


问:
Error using CGAL: class 'Alpha_shape_cell_base_3' has no member named 'hide_points'
I am trying to install the software Sibaco, but I get an error relative to CGAL class Alpha_shape_cell_base_3.

```<code>/usr/local/include/CGAL/Regular_triangulation_3.h:1230:12: error: ‘class CGAL::Alpha_shape_cell_base_3<CGAL::Epick, CGAL::Triangulation_cell_base_3<CGAL::Epick, CGAL::Triangulation_ds_cell_base_3<CGAL::Triangulation_data_structure_3<CGAL::Alpha_shape_vertex_base_3<CGAL::Epick, CGAL::Regular_triangulation_vertex_base_3<CGAL::Epick> >, CGAL::Alpha_shape_cell_base_3<CGAL::Epick> > > >, CGAL::Boolean_tag<false>, CGAL::Boolean_tag<false> >’ has no member named ‘hide_point’
</code>```

A similar error is reported for the members ‘hidden_points_begin’ and ‘hidden_points_end’.
I am using CGAL-4.11.3, since for later releases of CGAL I get many more errors when I try to install the software.

Any help to address this problem would be really appreciated!

答:
The cell base needs to match the triangulation. Since you're using a regular triangulation, the cell base must be a model of the concept RegularTriangulationCellBase_3, so CGAL::Regular_triangulation_cell_base_3 for example.

As pointed in the comment above, the example ex_weighted_alpha_shapes_3.cpp shows a correct setting of vertex and cell for 3D weighted alpha shapes.

If you need to use some more recent CGAL features and CGAL 4.11 is too old, feel free to post the errors you get and we can maybe help you upgrade the code from that library.

Body:
I am trying to install the software Sibaco, but I get an error relative to CGAL class Alpha_shape_cell_base_3.

/usr/local/include/CGAL/Regular_triangulation_3.h:1230:12: error: ‘class CGAL::Alpha_shape_cell_base_3<CGAL::Epick, CGAL::Triangulation_cell_base_3<CGAL::Epick, CGAL::Triangulation_ds_cell_base_3<CGAL::Triangulation_data_structure_3<CGAL::Alpha_shape_vertex_base_3<CGAL::Epick, CGAL::Regular_triangulation_vertex_base_3<CGAL::Epick> >, CGAL::Alpha_shape_cell_base_3<CGAL::Epick> > > >, CGAL::Boolean_tag<false>, CGAL::Boolean_tag<false> >’ has no member named ‘hide_point’

A similar error is reported for the members ‘hidden_points_begin’ and ‘hidden_points_end’.
I am using CGAL-4.11.3, since for later releases of CGAL I get many more errors when I try to install the software.

Any help to address this problem would be really appreciated!