问:
How to Widen My Website Without Recoding Everything
So, I'm not going to lie. I'm not a professional coder, I've learned everything I know from forums and I don't do things according to the book. I kind of cheat the system. Anyway, I've been editing a website on Enjin, it's a gaming platform where you can insert html/css modules that alter the layout and design. I've coded the entire thing, using divs and what-not for my friend's server. Once again I want to reiterate that I'm not a professional, I do it for fun and for free. Now, I'm in a predicament. I want to widen everything I've done, without going in and recoding all my divs since I used px to define them all. Here is my code, and I'll insert a link to the site. Any help will be appreciated.. </p>

<p>[Here's the site] http://www.terracrafters.net/test</p>

```<code>  .m_minecraftserverstatus_new.preset_43030555 {
    background-color: #1e2124;
    opacity: .9;
    border-radius: 0px;
    border: 0px solid #ffffff;
    margin-top: 10px;
    }

    BODY {
    overflow-x:hidden;
    }

    .breaker {
    opacity: 0;
    }

    .m_minecraftserverstatus_new.preset_43030555 .top-area {
    background-color: #1e2124;
    border-top-left-radius: 0px;
    border-top-right-radius: 0px;
    }

    .body-wrap-3 {
    background-repeat: no-repeat;
    background-position: top;
    background-image: url(https://assets-cloud.enjin.com/themes/1487945582_Background.png);
    }

    .body-wrap-3, #page {
    min-width: 0 !important;
    max-width: none !important;
    }

    #page-wrap {
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    max-width: 1100px;
    margin: 60px auto 30px;
    }

    .logo {
    z-index: 10000000;
    margin-top: -1px;
    margin-left:38%;
    margin-bottom: -65px;
    }

    .container {
    margin-top: -16px;
    }

    body #site-body {
    min-height: 750px;
    max-width: 1100px !important;
    margin: 0 auto;
    background-image: url(https://scontent-iad3-1.xx.fbcdn.net/v/t35.0-12/17521938_1421397851215990_1860950770_o.png?oh=a7575fe8a4e2aca7bc01d19f859148e0&oe=58D973CA);
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: 2000px;
    background-position-y: -260px;
    background-position-x: 0px;
    }

    a, p, div, h1, h2, h3, h4, span {
    font-family: MedievalSharp;  sans-serif;
    }

    .abmpro {
    background: transparent;
    float: right;
    margin-left: 800px;
    margin-top: 105px;
    z-index: 10000000;
    position: absolute;
    }

    .navbar {
    background-color: #1f4636;
    height: 15px;
    text-align: left;
    color: black;
    text-transform: uppercase;
    padding: 25px;
    font-size: 15px;
    font-weight: 0px;
    margin-bottom: -4%;
    width: 67.35%;
    margin-left: -.7%;
    margin-top: 90px;
    display: inline-block;
    }

    .navbar img{
    left: 50%;
    margin-top: -250px;
    position: relative;
    transform: translateX(-255.5%) translateY(40%);
    }

    .navbar a{
    -webkit-text-emphasis-color: black;
    color: white;
    text-transform: uppercase;
    padding: 25px;
    height: 35px;
    }

    .navbar a:hover {
    color: antiquewhite;
    background-color:#1a1a1a;
    text-transform: uppercase;
    text-decoration:none;
        width: 0;
        transition: 0.4s ease-in;
        -o-transition: 0.4s ease-in;
        -ms-transition: 0.4s ease-in;
        -moz-transition: 0.4s ease-in;
        -webkit-transition: 0.4s ease-in;
        overflow: hidden;
    padding: 25px;
    height: 35px;
    }

    .navbar p {
    margin-bottom: -5px;
    }

    .abmhomeconent {
    background-color: #452121;
    margin-left: -11px;
    margin-right: -11px;
    margin-top: -5.1%;
    margin-bottom: -39px;
    }

    .simple-ss {
    border-bottom-left-radius: 5em;
    border-bottom-right-radius: 5em;
    width: 1100px;
    height: 300px;
    background-color: black;
    margin-top: 23px;
    margin-left: -11px;
    background-image: url("http://i.imgur.com/vqs1TBE.jpg");
    background-position: 0;
    background-repeat: no-repeat;
    background-size: cover;
    animation-name: slide;
    animation-duration: 10s;
    animation-direction: normal;
    animation-timing-function: linear;
    animation-iteration-count: 1;
    float: right;
    margin-right: 470px;
    margin-bottom:-5px;
     animation-fill-mode:forwards;
    }
    @keyframes slide {
  0% {background-position: 0 -100;}
 50% {background-position: 0 -50px;}
  100% {background-position: 0 0px;}
    }

    #enjin-bar .left {
    display:inherit;
    z-index:50000;
    }

    .m_html p {
    min-height: 1.25em;
    margin-bottom: -64px;
    line-height: 1.25;
    margin-left: 405px;
    }

    #enjin-bar {
    right: .0%;
    top: 7.55%;
    text-transform: uppercase;
    text-decoration: none;
    font-family: 'Lato', sans-serif;
    color: #8a8a8a;
    position: absolute;
    z-index:50000;
    }

    #page-footer {
    display:none;
    }

    #page-footer left {
    display: none;
    }

    #page-footer right {
    display: none;
    }

    .container_body {
    margin-top:-.2%;
    margin-left:-.1%;
        margin-right:-.1%;
    }

    .m_news.main {
    position: relative;
    margin-top: 10px;
    }

    .m_news {
    background-color: #1e2124;
    margin-left: .1%;
    margin-right: 1%;
    opacity: .9;
    }
     .m_news.main .float-manage,.m_news.main .float-rss {
        margin-top:0px;
    }
    .m_news .heading {
        background:#D8D8D8;
        height:25px;
        padding:20px;
    }
    .m_news.main .article.first .heading {
        margin-right:0!important;
    }
    .m_news.main .heading .title, .m_news.viewarticle .heading .title {
    font-size: 20px;
    text-transform: uppercase;
    padding-top: 2px;
    margin-top: -5px;
    }
    .m_news .heading .title a {
        color:#000;
        font-weight:300!important;
    }
    .m_news .heading .info {
        visibility:hidden;
    }
    .m_news .heading .info .date {
        visibility:visible;
        float:right;
        position:relative;
        top:-30px;
        font-size:22px;
        text-transform:uppercase;
        color:#fff;

    }
    .m_news .article .article-content {
        font-size:14px;
        line-height:20px;
        text-align:justify;
        padding-bottom:10px;
    }
    .m_news.viewarticle .m_plugin_comment {
        width:94%;
        margin:50px auto 0 auto;
    }
    .m_news.viewarticle .m_plugin_comment .block-title {
        background:transparent;
        border-bottom:2px solid #FFA62F;
        color:#FFA62F;
    }
    .m_news .article .heading .element_avatar {
    margin-top: -2.4%;
    margin-left:-6px;
    }

    .post_interact_like_list {
    width:100px;
    }

    .post_interact_like_list_hidden{
    width:100px;
    }

    #boot_admin{
    margin-top:0px;

    }

    #boot_admin a:nth-child(1){
    display:none;
    }

    #boot_profile{
    height:30px;

    }

    #boot_profile .element_username{
    color: black !important;
    text-decoration:none !important;

    }

    #boot_profile span:hover{
    background-color: transparent;
    color: rgb(51, 51, 51) !important;
    text-decoration: none;
    }

    /*Changes our enjin dropdown caret to something that is close to twitter's     caret object(Part 2 for border)*/
    #enjin-bar .arrow:after{
    border-top:6px solid transparent;
    border-top-color:rgba(255, 255, 255);
    border-right:6px solid transparent;
    border-bottom:6px solid transparent;
    border-left:6px solid transparent;
top:3px;
}

/*Changes the style of our entire dropdown box to mimick Boot strap style*/
.element_dropdown_menu.element_popup.enjinbar-menu{
margin-top:26px;
-webkit-border-radius:6px 0 6px 6px;
-moz-border-radius:6px 0 6px 6px;
border-radius:6px 0 6px 6px;
border:1px solid #ccc;
border:1px solid rgba(0, 0, 0, 0.2);
-webkit-border-radius:6px;
-moz-border-radius:6px;
border-radius:6px;
z-index:99999;
color:black;
}

/*Our inner elements of our entire enjin drop down*/
.element_popup .inner {
background-color: white !important;
margin-left:10px;
text-decroation:none;
padding:0px 0;
margin:-1px -25px 0;
list-style:none;
border:solid gray 1px;
-webkit-background-clip:padding-box;
-moz-background-clip:padding;
background-clip:padding-box;
color:black;

}

/*Text - Our inner elements of our entire enjin drop down*/
.element_popup .inner li a{
color:#333;
font-size:12px;
font-family:Arial;
padding:6px 20px !important;
}

/*Text - Hover - Our inner elements of our entire enjin drop down*/
.element_popup .inner .menu-link:hover{
text-decoration:none;
color:#ffffff;
background-color:#0081c2;
background-image:-moz-linear-gradient(top, #0088cc, #0077b3);
background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
background-image:-webkit-linear-gradient(top, #0088cc, #0077b3);
background-image:-o-linear-gradient(top, #0088cc, #0077b3);
background-image:linear-gradient(to bottom, #0088cc, #0077b3);
background-repeat:repeat-x;
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);
}

/*Enjin Divider lines to look...better*/
.element_popup .inner .menu-divider-line{
background-color: #E5E5E5 !important;
border-bottom: 1px solid white !important;
height:1px !important;
opacity:0.4;
}

/*Profile drop down item hover events*/
.element_popup .inner .item:hover{
background-color: rgb(0, 129, 194);
background-image: linear-gradient(to bottom, rgb(0, 136, 204), rgb(0, 119, 179));
}

/*Profile drop down text style*/
.element_popup .inner .item a{
text-decoration:none;
font-weight: normal;
margin-bottom:-5px; /*Reduces some spacing..since menu is huge*/
color: rgb(51, 51, 51);
font-family:arial;
}

/*Profile drop down text style - hover*/
.element_popup .inner .item a:hover{
color: rgb(255, 255, 255);
}

/*Font,text - Our site box at bottom of profile dropdown*/
.sitebox a {
font-size:10px !important;
color:#333;
margin-left:-20px;
background-color:transparent;
}

/*Font,text, make less default space - Our site box at bottom of profile dropdown*/
.enjinbar-menu-user .sitebox{
margin-bottom:10px;
}

/*That damn gear! - Our site box at bottom of profile dropdown*/
.enjinbar-menu-user .sitebox .gear {
background-position: 40px 0px; /*Removes Enjin's mysterious extra icons*/ }

/*Text for site urls - Our site box at bottom of profile dropdown*/
.sitebox .url{
color:#333;
}

/*Our visible username text*/
#enjin-bar .element_username{
color:#000;
text-decoration:none;
}

/*Removes our likes etc.*/
#enjin-bar #enjin-bar-likes{
display:none !important;
}

/*Removes site info,site name and our admin gear*/
#enjin-bar .left a:nth-of-type(1),#enjin-bar .left a:nth-of-type(2),#enjin-bar .left a:nth-of-type(3){
display:none !important;
}

/*creates a default right position for our admin, fixed, position manually on your fixed nav*/
#enjin-bar .left{
margin-top:8px;
z-index:9999;
margin-left:530px;
position:fixed;
}

/*Our admin text on hover*/
#enjin-bar .left a:hover{
color: rgb(51, 51, 51);
text-decoration:none;
}

 .sitebox {
     display:none;
}
/*END Enjin bar nav positioning*/

/*profile*/

.v2_system_social .widget_owner {
    padding: 5px;
    font-size: 14px;
    padding-bottom: 25px;
}
.v2_system_social .middle_inner, .v2_system_social .sidebar_widget_inner, .v2_system_social .profile_menu .menu_popup_inner {
    border: 0px;
    border-color: transparent;
    padding: 1px;
}

.v2_system_social table.header .cover {
    display: inline-block;
    vertical-align: middle;
    text-align: left;
    width: 100%;
    height: 173px;
    max-width: 898px;
    border-top-right-radius: 0px;
    border-bottom-right-radius: 0px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background-repeat: no-repeat;
    background-position: -1px -1px;
    position: relative;
}

.v2_system_social table.header .avatar {
    width: 173px;
    height: 173px;
    border-top-left-radius: 0px;
    border-bottom-left-radius: 0px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background-repeat: no-repeat;
    background-position: -1px -1px;
}

.v2_system_social .middle {
    margin: 0 400px 0 78px;
    border-radius: 0px;
    min-height: 600px;
}

.v2_system_social .sidebar_widget {
    width: 383px;
    border-radius: 0px;
    margin-bottom: 15px;
}
.sidebar_widget {
    background-color: #613D41;
}
body.liquid .v2_system_social {
    max-width: 1090px;
    min-width: 954px;
    margin: 0 auto;
    width: 1067px;
}

#avatar img {
    max-width: 100%;
    border-style: solid;
    border-width: 0px;
    /* float: right; */
    z-index: 1;
    margin-top: -2.8%;
    /* margin-left: 700px; */
    float: right;
    position: relative;
}

.m_pointsdisplay {
display:none;
}
.v2_system_social .wall .share_closed, .v2_system_social .wall .share, .v2_system_social .wall .share_add_container {
    background-color: #ffffff;
    border: 1px solid;
    border-color: #1a1a1a;
    width: 67%;
}
.v2_system_social .widget_owner .logo {
    float: left;
    width: 74px;
    margin-right: 10px;
    border-radius: 0px;
    overflow: hidden;
}

.container_body .container_right {
    /* background-image: url(https://assets-cloud.enjin.com/themes/1350633694_re.png); */
    /* width: 13px; */
    /* background-color: transparent; */
}

.m_shoutbox {
    width: 100%;
    background-color: #1e2124;
    opacity: .9;
}

@media screen and (min-width: 1024px)
(index):477

#enjin-bar .left {
    display:none;
}

#boot_admin{
margin-top:0px;

}

#boot_admin a:nth-child(1){
display:none;
}

#boot_profile{
height:30px;

}

#boot_profile .element_username{
color: black !important;
text-decoration:none !important;

}

#boot_profile span:hover{
background-color: transparent;
color: rgb(51, 51, 51) !important;
text-decoration: none;
}

/*Changes our enjin dropdown caret to something that is close to twitter's caret object(Part 2 for border)*/
#enjin-bar .arrow:after{
border-top:6px solid transparent;
border-top-color:rgba(255, 255, 255);
border-right:6px solid transparent;
border-bottom:6px solid transparent;
border-left:6px solid transparent;
top:3px;
}

/*Changes the style of our entire dropdown box to mimick Boot strap style*/
.element_dropdown_menu.element_popup.enjinbar-menu{
margin-top:26px;
-webkit-border-radius:6px 0 6px 6px;
-moz-border-radius:6px 0 6px 6px;
border-radius:6px 0 6px 6px;
border:1px solid #ccc;
border:1px solid rgba(0, 0, 0, 0.2);
-webkit-border-radius:6px;
-moz-border-radius:6px;
border-radius:6px;
z-index:99999;
color:black;
}

/*Our inner elements of our entire enjin drop down*/
.element_popup .inner {
background-color: white !important;
margin-left:10px;
text-decroation:none;
padding:0px 0;
margin:-1px -25px 0;
list-style:none;
border:solid gray 1px;
-webkit-background-clip:padding-box;
-moz-background-clip:padding;
background-clip:padding-box;
color:black;

}

/*Text - Our inner elements of our entire enjin drop down*/
.element_popup .inner li a{
color:#333;
font-size:12px;
font-family:Arial;
padding:6px 20px !important;
}

/*Text - Hover - Our inner elements of our entire enjin drop down*/
.element_popup .inner .menu-link:hover{
text-decoration:none;
color:#ffffff;
background-color:#0081c2;
background-image:-moz-linear-gradient(top, #0088cc, #0077b3);
background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
background-image:-webkit-linear-gradient(top, #0088cc, #0077b3);
background-image:-o-linear-gradient(top, #0088cc, #0077b3);
background-image:linear-gradient(to bottom, #0088cc, #0077b3);
background-repeat:repeat-x;
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);
}

/*Enjin Divider lines to look...better*/
.element_popup .inner .menu-divider-line{
background-color: #E5E5E5 !important;
border-bottom: 1px solid white !important;
height:1px !important;
opacity:0.4;
}

/*Profile drop down item hover events*/
.element_popup .inner .item:hover{
background-color: rgb(0, 129, 194);
background-image: linear-gradient(to bottom, rgb(0, 136, 204), rgb(0, 119, 179));
}

/*Profile drop down text style*/
.element_popup .inner .item a{
text-decoration:none;
font-weight: normal;
margin-bottom:-5px; /*Reduces some spacing..since menu is huge*/
color: rgb(51, 51, 51);
font-family:arial;
}

/*Profile drop down text style - hover*/
.element_popup .inner .item a:hover{
color: rgb(255, 255, 255);
}

/*Font,text - Our site box at bottom of profile dropdown*/
.sitebox a {
font-size:10px !important;
color:#333;
margin-left:-20px;
background-color:transparent;
}

/*Font,text, make less default space - Our site box at bottom of profile dropdown*/
.enjinbar-menu-user .sitebox{
margin-bottom:10px;
}

/*That damn gear! - Our site box at bottom of profile dropdown*/
.enjinbar-menu-user .sitebox .gear {
background-position: 40px 0px; /*Removes Enjin's mysterious extra icons*/ }

/*Text for site urls - Our site box at bottom of profile dropdown*/
.sitebox .url{
color:#333;
}

/*Our visible username text*/
#enjin-bar .element_username{
color:#000;
text-decoration:none;
}

/*Removes our likes etc.*/
#enjin-bar #enjin-bar-likes{
display:none !important;
}

/*Removes site info,site name and our admin gear*/
#enjin-bar .left a:nth-of-type(1),#enjin-bar .left a:nth-of-type(2),#enjin-bar .left a:nth-of-type(3){
display:none !important;
}

/*creates a default right position for our admin, fixed, position manually on your fixed nav*/
#enjin-bar .left{
margin-top:8px;
z-index:9999;
margin-left:530px;
position:fixed;
}

/*Our admin text on hover*/
#enjin-bar .left a:hover{
color: rgb(51, 51, 51);
text-decoration:none;
}

/*END Enjin bar nav positioning*/
</code>```

答:
I think it's safe to say no one is going to read allllll that css ;) but having a quick look at your site, there are two obvious things to change. This is all of course dependent on what you mean by widen everything. But you have both body #site-body and #page-wrap set to max-width:100px.
You could remove this, or alter it, and it will stretch your main content across the page. I suspect there is something for higher up the page too with the image and menu.

I would also look to reduce the amount of !importants you have in there as they can get you into all sorts of hassles with trying to work out your styling. Hope that helps!

Body:
So, I'm not going to lie. I'm not a professional coder, I've learned everything I know from forums and I don't do things according to the book. I kind of cheat the system. Anyway, I've been editing a website on Enjin, it's a gaming platform where you can insert html/css modules that alter the layout and design. I've coded the entire thing, using divs and what-not for my friend's server. Once again I want to reiterate that I'm not a professional, I do it for fun and for free. Now, I'm in a predicament. I want to widen everything I've done, without going in and recoding all my divs since I used px to define them all. Here is my code, and I'll insert a link to the site. Any help will be appreciated..

[Here's the site] http://www.terracrafters.net/test

  .m_minecraftserverstatus_new.preset_43030555 {
    background-color: #1e2124;
    opacity: .9;
    border-radius: 0px;
    border: 0px solid #ffffff;
    margin-top: 10px;
    }

    BODY {
    overflow-x:hidden;
    }

    .breaker {
    opacity: 0;
    }

    .m_minecraftserverstatus_new.preset_43030555 .top-area {
    background-color: #1e2124;
    border-top-left-radius: 0px;
    border-top-right-radius: 0px;
    }

    .body-wrap-3 {
    background-repeat: no-repeat;
    background-position: top;
    background-image: url(https://assets-cloud.enjin.com/themes/1487945582_Background.png);
    }

    .body-wrap-3, #page {
    min-width: 0 !important;
    max-width: none !important;
    }

    #page-wrap {
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    max-width: 1100px;
    margin: 60px auto 30px;
    }

    .logo {
    z-index: 10000000;
    margin-top: -1px;
    margin-left:38%;
    margin-bottom: -65px;
    }

    .container {
    margin-top: -16px;
    }

    body #site-body {
    min-height: 750px;
    max-width: 1100px !important;
    margin: 0 auto;
    background-image: url(https://scontent-iad3-1.xx.fbcdn.net/v/t35.0-12/17521938_1421397851215990_1860950770_o.png?oh=a7575fe8a4e2aca7bc01d19f859148e0&oe=58D973CA);
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: 2000px;
    background-position-y: -260px;
    background-position-x: 0px;
    }

    a, p, div, h1, h2, h3, h4, span {
    font-family: MedievalSharp;  sans-serif;
    }

    .abmpro {
    background: transparent;
    float: right;
    margin-left: 800px;
    margin-top: 105px;
    z-index: 10000000;
    position: absolute;
    }

    .navbar {
    background-color: #1f4636;
    height: 15px;
    text-align: left;
    color: black;
    text-transform: uppercase;
    padding: 25px;
    font-size: 15px;
    font-weight: 0px;
    margin-bottom: -4%;
    width: 67.35%;
    margin-left: -.7%;
    margin-top: 90px;
    display: inline-block;
    }

    .navbar img{
    left: 50%;
    margin-top: -250px;
    position: relative;
    transform: translateX(-255.5%) translateY(40%);
    }

    .navbar a{
    -webkit-text-emphasis-color: black;
    color: white;
    text-transform: uppercase;
    padding: 25px;
    height: 35px;
    }

    .navbar a:hover {
    color: antiquewhite;
    background-color:#1a1a1a;
    text-transform: uppercase;
    text-decoration:none;
        width: 0;
        transition: 0.4s ease-in;
        -o-transition: 0.4s ease-in;
        -ms-transition: 0.4s ease-in;
        -moz-transition: 0.4s ease-in;
        -webkit-transition: 0.4s ease-in;
        overflow: hidden;
    padding: 25px;
    height: 35px;
    }

    .navbar p {
    margin-bottom: -5px;
    }

    .abmhomeconent {
    background-color: #452121;
    margin-left: -11px;
    margin-right: -11px;
    margin-top: -5.1%;
    margin-bottom: -39px;
    }

    .simple-ss {
    border-bottom-left-radius: 5em;
    border-bottom-right-radius: 5em;
    width: 1100px;
    height: 300px;
    background-color: black;
    margin-top: 23px;
    margin-left: -11px;
    background-image: url("http://i.imgur.com/vqs1TBE.jpg");
    background-position: 0;
    background-repeat: no-repeat;
    background-size: cover;
    animation-name: slide;
    animation-duration: 10s;
    animation-direction: normal;
    animation-timing-function: linear;
    animation-iteration-count: 1;
    float: right;
    margin-right: 470px;
    margin-bottom:-5px;
     animation-fill-mode:forwards;
    }
    @keyframes slide {
  0% {background-position: 0 -100;}
 50% {background-position: 0 -50px;}
  100% {background-position: 0 0px;}
    }

    #enjin-bar .left {
    display:inherit;
    z-index:50000;
    }

    .m_html p {
    min-height: 1.25em;
    margin-bottom: -64px;
    line-height: 1.25;
    margin-left: 405px;
    }

    #enjin-bar {
    right: .0%;
    top: 7.55%;
    text-transform: uppercase;
    text-decoration: none;
    font-family: 'Lato', sans-serif;
    color: #8a8a8a;
    position: absolute;
    z-index:50000;
    }

    #page-footer {
    display:none;
    }

    #page-footer left {
    display: none;
    }

    #page-footer right {
    display: none;
    }

    .container_body {
    margin-top:-.2%;
    margin-left:-.1%;
        margin-right:-.1%;
    }

    .m_news.main {
    position: relative;
    margin-top: 10px;
    }

    .m_news {
    background-color: #1e2124;
    margin-left: .1%;
    margin-right: 1%;
    opacity: .9;
    }
     .m_news.main .float-manage,.m_news.main .float-rss {
        margin-top:0px;
    }
    .m_news .heading {
        background:#D8D8D8;
        height:25px;
        padding:20px;
    }
    .m_news.main .article.first .heading {
        margin-right:0!important;
    }
    .m_news.main .heading .title, .m_news.viewarticle .heading .title {
    font-size: 20px;
    text-transform: uppercase;
    padding-top: 2px;
    margin-top: -5px;
    }
    .m_news .heading .title a {
        color:#000;
        font-weight:300!important;
    }
    .m_news .heading .info {
        visibility:hidden;
    }
    .m_news .heading .info .date {
        visibility:visible;
        float:right;
        position:relative;
        top:-30px;
        font-size:22px;
        text-transform:uppercase;
        color:#fff;

    }
    .m_news .article .article-content {
        font-size:14px;
        line-height:20px;
        text-align:justify;
        padding-bottom:10px;
    }
    .m_news.viewarticle .m_plugin_comment {
        width:94%;
        margin:50px auto 0 auto;
    }
    .m_news.viewarticle .m_plugin_comment .block-title {
        background:transparent;
        border-bottom:2px solid #FFA62F;
        color:#FFA62F;
    }
    .m_news .article .heading .element_avatar {
    margin-top: -2.4%;
    margin-left:-6px;
    }

    .post_interact_like_list {
    width:100px;
    }

    .post_interact_like_list_hidden{
    width:100px;
    }

    #boot_admin{
    margin-top:0px;

    }

    #boot_admin a:nth-child(1){
    display:none;
    }

    #boot_profile{
    height:30px;

    }

    #boot_profile .element_username{
    color: black !important;
    text-decoration:none !important;

    }

    #boot_profile span:hover{
    background-color: transparent;
    color: rgb(51, 51, 51) !important;
    text-decoration: none;
    }

    /*Changes our enjin dropdown caret to something that is close to twitter's     caret object(Part 2 for border)*/
    #enjin-bar .arrow:after{
    border-top:6px solid transparent;
    border-top-color:rgba(255, 255, 255);
    border-right:6px solid transparent;
    border-bottom:6px solid transparent;
    border-left:6px solid transparent;
top:3px;
}

/*Changes the style of our entire dropdown box to mimick Boot strap style*/
.element_dropdown_menu.element_popup.enjinbar-menu{
margin-top:26px;
-webkit-border-radius:6px 0 6px 6px;
-moz-border-radius:6px 0 6px 6px;
border-radius:6px 0 6px 6px;
border:1px solid #ccc;
border:1px solid rgba(0, 0, 0, 0.2);
-webkit-border-radius:6px;
-moz-border-radius:6px;
border-radius:6px;
z-index:99999;
color:black;
}

/*Our inner elements of our entire enjin drop down*/
.element_popup .inner {
background-color: white !important;
margin-left:10px;
text-decroation:none;
padding:0px 0;
margin:-1px -25px 0;
list-style:none;
border:solid gray 1px;
-webkit-background-clip:padding-box;
-moz-background-clip:padding;
background-clip:padding-box;
color:black;

}

/*Text - Our inner elements of our entire enjin drop down*/
.element_popup .inner li a{
color:#333;
font-size:12px;
font-family:Arial;
padding:6px 20px !important;
}

/*Text - Hover - Our inner elements of our entire enjin drop down*/
.element_popup .inner .menu-link:hover{
text-decoration:none;
color:#ffffff;
background-color:#0081c2;
background-image:-moz-linear-gradient(top, #0088cc, #0077b3);
background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
background-image:-webkit-linear-gradient(top, #0088cc, #0077b3);
background-image:-o-linear-gradient(top, #0088cc, #0077b3);
background-image:linear-gradient(to bottom, #0088cc, #0077b3);
background-repeat:repeat-x;
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);
}

/*Enjin Divider lines to look...better*/
.element_popup .inner .menu-divider-line{
background-color: #E5E5E5 !important;
border-bottom: 1px solid white !important;
height:1px !important;
opacity:0.4;
}

/*Profile drop down item hover events*/
.element_popup .inner .item:hover{
background-color: rgb(0, 129, 194);
background-image: linear-gradient(to bottom, rgb(0, 136, 204), rgb(0, 119, 179));
}

/*Profile drop down text style*/
.element_popup .inner .item a{
text-decoration:none;
font-weight: normal;
margin-bottom:-5px; /*Reduces some spacing..since menu is huge*/
color: rgb(51, 51, 51);
font-family:arial;
}

/*Profile drop down text style - hover*/
.element_popup .inner .item a:hover{
color: rgb(255, 255, 255);
}

/*Font,text - Our site box at bottom of profile dropdown*/
.sitebox a {
font-size:10px !important;
color:#333;
margin-left:-20px;
background-color:transparent;
}

/*Font,text, make less default space - Our site box at bottom of profile dropdown*/
.enjinbar-menu-user .sitebox{
margin-bottom:10px;
}

/*That damn gear! - Our site box at bottom of profile dropdown*/
.enjinbar-menu-user .sitebox .gear {
background-position: 40px 0px; /*Removes Enjin's mysterious extra icons*/ }

/*Text for site urls - Our site box at bottom of profile dropdown*/
.sitebox .url{
color:#333;
}

/*Our visible username text*/
#enjin-bar .element_username{
color:#000;
text-decoration:none;
}

/*Removes our likes etc.*/
#enjin-bar #enjin-bar-likes{
display:none !important;
}

/*Removes site info,site name and our admin gear*/
#enjin-bar .left a:nth-of-type(1),#enjin-bar .left a:nth-of-type(2),#enjin-bar .left a:nth-of-type(3){
display:none !important;
}

/*creates a default right position for our admin, fixed, position manually on your fixed nav*/
#enjin-bar .left{
margin-top:8px;
z-index:9999;
margin-left:530px;
position:fixed;
}

/*Our admin text on hover*/
#enjin-bar .left a:hover{
color: rgb(51, 51, 51);
text-decoration:none;
}

 .sitebox {
     display:none;
}
/*END Enjin bar nav positioning*/

/*profile*/

.v2_system_social .widget_owner {
    padding: 5px;
    font-size: 14px;
    padding-bottom: 25px;
}
.v2_system_social .middle_inner, .v2_system_social .sidebar_widget_inner, .v2_system_social .profile_menu .menu_popup_inner {
    border: 0px;
    border-color: transparent;
    padding: 1px;
}

.v2_system_social table.header .cover {
    display: inline-block;
    vertical-align: middle;
    text-align: left;
    width: 100%;
    height: 173px;
    max-width: 898px;
    border-top-right-radius: 0px;
    border-bottom-right-radius: 0px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background-repeat: no-repeat;
    background-position: -1px -1px;
    position: relative;
}

.v2_system_social table.header .avatar {
    width: 173px;
    height: 173px;
    border-top-left-radius: 0px;
    border-bottom-left-radius: 0px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background-repeat: no-repeat;
    background-position: -1px -1px;
}

.v2_system_social .middle {
    margin: 0 400px 0 78px;
    border-radius: 0px;
    min-height: 600px;
}

.v2_system_social .sidebar_widget {
    width: 383px;
    border-radius: 0px;
    margin-bottom: 15px;
}
.sidebar_widget {
    background-color: #613D41;
}
body.liquid .v2_system_social {
    max-width: 1090px;
    min-width: 954px;
    margin: 0 auto;
    width: 1067px;
}

#avatar img {
    max-width: 100%;
    border-style: solid;
    border-width: 0px;
    /* float: right; */
    z-index: 1;
    margin-top: -2.8%;
    /* margin-left: 700px; */
    float: right;
    position: relative;
}

.m_pointsdisplay {
display:none;
}
.v2_system_social .wall .share_closed, .v2_system_social .wall .share, .v2_system_social .wall .share_add_container {
    background-color: #ffffff;
    border: 1px solid;
    border-color: #1a1a1a;
    width: 67%;
}
.v2_system_social .widget_owner .logo {
    float: left;
    width: 74px;
    margin-right: 10px;
    border-radius: 0px;
    overflow: hidden;
}

.container_body .container_right {
    /* background-image: url(https://assets-cloud.enjin.com/themes/1350633694_re.png); */
    /* width: 13px; */
    /* background-color: transparent; */
}

.m_shoutbox {
    width: 100%;
    background-color: #1e2124;
    opacity: .9;
}

@media screen and (min-width: 1024px)
(index):477

#enjin-bar .left {
    display:none;
}

#boot_admin{
margin-top:0px;

}

#boot_admin a:nth-child(1){
display:none;
}

#boot_profile{
height:30px;

}

#boot_profile .element_username{
color: black !important;
text-decoration:none !important;

}

#boot_profile span:hover{
background-color: transparent;
color: rgb(51, 51, 51) !important;
text-decoration: none;
}

/*Changes our enjin dropdown caret to something that is close to twitter's caret object(Part 2 for border)*/
#enjin-bar .arrow:after{
border-top:6px solid transparent;
border-top-color:rgba(255, 255, 255);
border-right:6px solid transparent;
border-bottom:6px solid transparent;
border-left:6px solid transparent;
top:3px;
}

/*Changes the style of our entire dropdown box to mimick Boot strap style*/
.element_dropdown_menu.element_popup.enjinbar-menu{
margin-top:26px;
-webkit-border-radius:6px 0 6px 6px;
-moz-border-radius:6px 0 6px 6px;
border-radius:6px 0 6px 6px;
border:1px solid #ccc;
border:1px solid rgba(0, 0, 0, 0.2);
-webkit-border-radius:6px;
-moz-border-radius:6px;
border-radius:6px;
z-index:99999;
color:black;
}

/*Our inner elements of our entire enjin drop down*/
.element_popup .inner {
background-color: white !important;
margin-left:10px;
text-decroation:none;
padding:0px 0;
margin:-1px -25px 0;
list-style:none;
border:solid gray 1px;
-webkit-background-clip:padding-box;
-moz-background-clip:padding;
background-clip:padding-box;
color:black;

}

/*Text - Our inner elements of our entire enjin drop down*/
.element_popup .inner li a{
color:#333;
font-size:12px;
font-family:Arial;
padding:6px 20px !important;
}

/*Text - Hover - Our inner elements of our entire enjin drop down*/
.element_popup .inner .menu-link:hover{
text-decoration:none;
color:#ffffff;
background-color:#0081c2;
background-image:-moz-linear-gradient(top, #0088cc, #0077b3);
background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
background-image:-webkit-linear-gradient(top, #0088cc, #0077b3);
background-image:-o-linear-gradient(top, #0088cc, #0077b3);
background-image:linear-gradient(to bottom, #0088cc, #0077b3);
background-repeat:repeat-x;
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);
}

/*Enjin Divider lines to look...better*/
.element_popup .inner .menu-divider-line{
background-color: #E5E5E5 !important;
border-bottom: 1px solid white !important;
height:1px !important;
opacity:0.4;
}

/*Profile drop down item hover events*/
.element_popup .inner .item:hover{
background-color: rgb(0, 129, 194);
background-image: linear-gradient(to bottom, rgb(0, 136, 204), rgb(0, 119, 179));
}

/*Profile drop down text style*/
.element_popup .inner .item a{
text-decoration:none;
font-weight: normal;
margin-bottom:-5px; /*Reduces some spacing..since menu is huge*/
color: rgb(51, 51, 51);
font-family:arial;
}

/*Profile drop down text style - hover*/
.element_popup .inner .item a:hover{
color: rgb(255, 255, 255);
}

/*Font,text - Our site box at bottom of profile dropdown*/
.sitebox a {
font-size:10px !important;
color:#333;
margin-left:-20px;
background-color:transparent;
}

/*Font,text, make less default space - Our site box at bottom of profile dropdown*/
.enjinbar-menu-user .sitebox{
margin-bottom:10px;
}

/*That damn gear! - Our site box at bottom of profile dropdown*/
.enjinbar-menu-user .sitebox .gear {
background-position: 40px 0px; /*Removes Enjin's mysterious extra icons*/ }

/*Text for site urls - Our site box at bottom of profile dropdown*/
.sitebox .url{
color:#333;
}

/*Our visible username text*/
#enjin-bar .element_username{
color:#000;
text-decoration:none;
}

/*Removes our likes etc.*/
#enjin-bar #enjin-bar-likes{
display:none !important;
}

/*Removes site info,site name and our admin gear*/
#enjin-bar .left a:nth-of-type(1),#enjin-bar .left a:nth-of-type(2),#enjin-bar .left a:nth-of-type(3){
display:none !important;
}

/*creates a default right position for our admin, fixed, position manually on your fixed nav*/
#enjin-bar .left{
margin-top:8px;
z-index:9999;
margin-left:530px;
position:fixed;
}

/*Our admin text on hover*/
#enjin-bar .left a:hover{
color: rgb(51, 51, 51);
text-decoration:none;
}

/*END Enjin bar nav positioning*/


来源: stackexchange

问:
Checking 'checked' property selects radio button
I have two radio buttons, neither of them is checked by default, and depending on which one is clicked/checked i should collect text from two different textboxes.

```<code>if ($("#70").prop("checked", true)) {
    var s=$('input[name="a"]').val();
}
else {
    var s=$('input[name="b"]').val();
}
</code>```

The problem is that if I check the second one, with id '60', the first one gets the checked property, If I set the if statement to check the second one, id='60', then the same thing happens but this time the second one gets checked.

This is the code for the radio buttons

```<code><label id="a" for="70" style="width:50px">
          <input type="radio" name="brojBodova" value="70" id="70">70
    </label>
    <label id="b" for="60" style="width:50px;">
          <input type="radio" name="brojBodova" value="60" id="60">60
    </label>
</code>```

答:
Try remove second param in .prop() method! it will work!

Call $("#70").prop("checked") when you want get value of checked attribute

Call $("#70").prop("checked", true) when you want set value for checked attribute

if ($("#70").prop("checked")) {
    var s=$('input[name="a"]').val();
}else {
    var s=$('input[name="b"]').val();
}

ContentLicense: CC BY-SA 3.0

Body:
I have two radio buttons, neither of them is checked by default, and depending on which one is clicked/checked i should collect text from two different textboxes.

if ($("#70").prop("checked", true)) {
    var s=$('input[name="a"]').val();
}
else {
    var s=$('input[name="b"]').val();
}

The problem is that if I check the second one, with id '60', the first one gets the checked property, If I set the if statement to check the second one, id='60', then the same thing happens but this time the second one gets checked.

This is the code for the radio buttons

          <input type="radio" name="brojBodova" value="70" id="70">70

          <input type="radio" name="brojBodova" value="60" id="60">60


问:
How do css Infinity work?
here're plenty of different CSS shapes over at CSS Tricks - Shapes of CSS and I'm particularly puzzled with a Infinity:

#infinity {
  position: relative;
  width: 212px;
  height: 100px;
}

#infinity:before,
#infinity:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 60px;
  height: 60px;
  border: 20px solid red;
  -moz-border-radius: 50px 50px 0 50px;
  border-radius: 50px 50px 0 50px;
  -webkit-transform: rotate(-45deg);
  -moz-transform: rotate(-45deg);
  -ms-transform: rotate(-45deg);
  -o-transform: rotate(-45deg);
  transform: rotate(-45deg);
}

#infinity:after {
  left: auto;
  right: 0;
  -moz-border-radius: 50px 50px 50px 0;
  border-radius: 50px 50px 50px 0;
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  transform: rotate(45deg);
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div id="infinity"></div></code>```

How and why does it work?

答:
Two of these:

#p1, #p2, #p3, #p4 {
  border: 20px solid red;
  height: 60px;
  margin: 20px;
  width: 60px;
}

#p2, #p3, #p4 {
  border-radius: 50px;
}

#p3, #p4 {
  border-top-right-radius: 0;
}

#p4 {
  transform: rotate(45deg);
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div id="p1"></div>
<div id="p2"></div>
<div id="p3"></div>
<div id="p4"></div></code>```

Title: How do css Infinity work?

Body:
here're plenty of different CSS shapes over at CSS Tricks - Shapes of CSS and I'm particularly puzzled with a Infinity:

#infinity {
  position: relative;
  width: 212px;
  height: 100px;
}

#infinity:before,
#infinity:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 60px;
  height: 60px;
  border: 20px solid red;
  -moz-border-radius: 50px 50px 0 50px;
  border-radius: 50px 50px 0 50px;
  -webkit-transform: rotate(-45deg);
  -moz-transform: rotate(-45deg);
  -ms-transform: rotate(-45deg);
  -o-transform: rotate(-45deg);
  transform: rotate(-45deg);
}

#infinity:after {
  left: auto;
  right: 0;
  -moz-border-radius: 50px 50px 50px 0;
  border-radius: 50px 50px 50px 0;
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  transform: rotate(45deg);
}

How and why does it work?

Body:
Two of these:

#p1, #p2, #p3, #p4 {
  border: 20px solid red;
  height: 60px;
  margin: 20px;
  width: 60px;
}

#p2, #p3, #p4 {
  border-radius: 50px;
}

#p3, #p4 {
  border-top-right-radius: 0;
}

#p4 {
  transform: rotate(45deg);
}

<div id="p1"></div>
<div id="p2"></div>
<div id="p3"></div>
<div id="p4"></div>


问:
Selecting a word and shows tooltip in iOS
I would like to implement the Medium iOS App like effect for tapping highlight and shows tooltip.

I have been researching on Text Kit and some other stackoverflow questions have some thoughts on it, please also suggest what's the better alternative to this.

Scenario:

Static Text pre-defined

Shows highlights in several words or phrases

Solution thoughts:

Use UITextView for storing text

Use attributed string for text content

Showing background color using NSBackgroundColorAttributedName

Detect the selection by layoutManager.characterIndexForPoint(...)

Shows tooltip next to the selection

Shows tooltip using one of these pods AMPopTip, CMPopTipView, EasyTipView

Right now, I am not able to select the word and shows the tooltip just next to it. Any tier of help is appreciated.

答:
Here is a way to Highlight text.

Create an IBOutlet named myLabel

In ViewDidLoad type

```<code>let yourString = "This is how you highlight text"
myLabel.text = yourString

let malleableString = NSMutableAttributedString(string: yourString)

let numberOfCharactersToHighlight = 5
let startingIndex = 1
malleableString.addAttribute(NSBackgroundColorAttributeName, value: .magenta, range: NSRange(location: startingIndex, length: numberOfCharactersToHighlight))

myLabel.attributedText = malleableString
</code>```

Body:
Here is a way to Highlight text.

Create an IBOutlet named myLabel

In ViewDidLoad type

let yourString = "This is how you highlight text"
myLabel.text = yourString

let malleableString = NSMutableAttributedString(string: yourString)

let numberOfCharactersToHighlight = 5
let startingIndex = 1
malleableString.addAttribute(NSBackgroundColorAttributeName, value: .magenta, range: NSRange(location: startingIndex, length: numberOfCharactersToHighlight))

myLabel.attributedText = malleableString

ContentLicense: CC BY-SA 4.0


问:
How to update current session on multi-page application? .NET
I currently have a class of accounts that have 4 attributes and on one page I am performing math on one of the attributes, the balance, of the accounts. After doing the math I need to replace the current balance with the new balance in the session that I have saved for using on different pages and I can't figure it out for the life of me.
I saved the session using

```<code>HttpContext.Current.Session["accountsSession"] = accounts;
</code>```

and then I retrieve it using

```<code>List<Account> accounts = (List<Accounts>)Session["accountsSession"];
</code>```

I can get the data and perform the math I just need to be able to update it.

答:
Sessions can be used across different pages, you will need to just set the same session again with your new values and all pages will read the new values.

Are you able to tell why did you use sessions on the first place? sessions probably not your ideal solution here!

if you can share more information about the problem you are trying to solve and what technology you are using will be good.

Body:
I currently have a class of accounts that have 4 attributes and on one page I am performing math on one of the attributes, the balance, of the accounts. After doing the math I need to replace the current balance with the new balance in the session that I have saved for using on different pages and I can't figure it out for the life of me.
I saved the session using

HttpContext.Current.Session["accountsSession"] = accounts;

and then I retrieve it using

List<Account> accounts = (List<Accounts>)Session["accountsSession"];

I can get the data and perform the math I just need to be able to update it.


问:
RadioButton.IsChecked Not Going False
I have a UWP app in C#. I have a Radio Button that the user can turn check or uncheck. It is checked by default and the user can uncheck it when they wish. However when they uncheck it the bool value for RadioButton.IsChecked never returns false making impossible for the user to then recheck the Radio Button if required. My code is below.

```<code>    private void usingmltBtn_Click(object sender, RoutedEventArgs e)
    {

        if (RadioButton.IsChecked == true)
        {
            RadioButton.IsChecked = false;
            i2cerrRec.Visibility = Visibility.Collapsed;
            i2cerrTxt.Visibility = Visibility.Collapsed;
            mltI2Cnck = 0;

        }
        else if (RadioButton.IsChecked == false)
        {
            RadioButton.IsChecked = true;
            mlttempLbl.Text = "N/C";
        }

    }
</code>```

Thanks for your help.

答:
Use this

```<code> private void usingmltBtn_Click(object sender, RoutedEventArgs e)
        {

            if (RadioButton.Checked == true)
            {
                RadioButton.Checked = false;
                i2cerrRec.Visibility = Visibility.Collapsed;
                i2cerrTxt.Visibility = Visibility.Collapsed;
                mltI2Cnck = 0;

            }
            else if (RadioButton.Checked == false)
            {
                RadioButton.Checked = true;
                mlttempLbl.Text = "N/C";
            }
          }
</code>```

Title: RadioButton.IsChecked Not Going False

Body:
I have a UWP app in C#. I have a Radio Button that the user can turn check or uncheck. It is checked by default and the user can uncheck it when they wish. However when they uncheck it the bool value for RadioButton.IsChecked never returns false making impossible for the user to then recheck the Radio Button if required. My code is below.

    private void usingmltBtn_Click(object sender, RoutedEventArgs e)
    {

        if (RadioButton.IsChecked == true)
        {
            RadioButton.IsChecked = false;
            i2cerrRec.Visibility = Visibility.Collapsed;
            i2cerrTxt.Visibility = Visibility.Collapsed;
            mltI2Cnck = 0;

        }
        else if (RadioButton.IsChecked == false)
        {
            RadioButton.IsChecked = true;
            mlttempLbl.Text = "N/C";
        }

    }

Thanks for your help.

Body:
Use this

 private void usingmltBtn_Click(object sender, RoutedEventArgs e)
        {

            if (RadioButton.Checked == true)
            {
                RadioButton.Checked = false;
                i2cerrRec.Visibility = Visibility.Collapsed;
                i2cerrTxt.Visibility = Visibility.Collapsed;
                mltI2Cnck = 0;

            }
            else if (RadioButton.Checked == false)
            {
                RadioButton.Checked = true;
                mlttempLbl.Text = "N/C";
            }
          }


问:
AOP pointcut for @After
I want AOP logging for the method's return value</p>

```<code>    @After("execution(* com.dbs.tup.sample.service.*.*(..))")
    public void logAfter(JoinPoint point) {
        log.info("{} is returning {}", point.getSignature().getName(), "???");
    }
</code>```

答:
I found this </p>

```<code>    @AfterReturning(pointcut = "execution(* com.dbs.tup.sample.service.*.*(..))", returning = "retValue")
    public void logAfter(JoinPoint point, Object retValue) {
        log.info("{} is returning {}", point.getSignature().getName(), (((MethodSignature) point.getSignature()).getReturnType().cast(retValue)).toString());
    }
</code>```

Title: AOP pointcut for @After

Body:
I want AOP logging for the method's return value

    @After("execution(* com.dbs.tup.sample.service.*.*(..))")
    public void logAfter(JoinPoint point) {
        log.info("{} is returning {}", point.getSignature().getName(), "???");
    }

Body:
I found this

    @AfterReturning(pointcut = "execution(* com.dbs.tup.sample.service.*.*(..))", returning = "retValue")
    public void logAfter(JoinPoint point, Object retValue) {
        log.info("{} is returning {}", point.getSignature().getName(), (((MethodSignature) point.getSignature()).getReturnType().cast(retValue)).toString());
    }


问:
Flash, ActionScript 3: How do you put this collection in a variable?
```<code>    public function MovePath(ob:MovieClip)
    {
        ob.x = 458;
        ob.y = -5;
        TweenMax.to(ob, 30, {bezierThrough:[{x:458, y:-5},{x:458, y:153}, {x:212, y:254}, {x:208, y:606},{x:208, y:1000}], ease:1});
    }
</code>```

in the tweenmax there is a variable container "{x:458, y:-5},{x:458, y:153}, {x:212, y:254}, {x:208, y:606},{x:208, y:1000}"

but i want it to work like this:

```<code>    public function MovePath(ob:MovieClip,path)
    {
        ob.x = 458;
        ob.y = -5;
        TweenMax.to(ob, 30, {bezierThrough:[path], ease:1});
    }
</code>```

i tried declaring the variable path as

```<code>var path = {x:458, y:-5},{x:458, y:153}, {x:212, y:254}, {x:208, y:606},{x:208, y:1000}
</code>```

but with no succes
does anyone know how i can declare this variable proberly

thanks in advance
matthy

答:
```<code>var path = [{x:458, y:-5},{x:458, y:153}, {x:212, y:254}, {x:208, y:606},{x:208, y:1000}];
TweenMax.to(ob, 30, {bezierThrough:path, ease:1});
</code>```

<p>[] creates an array, so you are just creating an array of objects (with x and y properties).</p>

ContentLicense: CC BY-SA 2.5

Body:
    public function MovePath(ob:MovieClip)
    {
        ob.x = 458;
        ob.y = -5;
        TweenMax.to(ob, 30, {bezierThrough:[{x:458, y:-5},{x:458, y:153}, {x:212, y:254}, {x:208, y:606},{x:208, y:1000}], ease:1});
    }

in the tweenmax there is a variable container "{x:458, y:-5},{x:458, y:153}, {x:212, y:254}, {x:208, y:606},{x:208, y:1000}"

but i want it to work like this:

    public function MovePath(ob:MovieClip,path)
    {
        ob.x = 458;
        ob.y = -5;
        TweenMax.to(ob, 30, {bezierThrough:[path], ease:1});
    }

i tried declaring the variable path as

var path = {x:458, y:-5},{x:458, y:153}, {x:212, y:254}, {x:208, y:606},{x:208, y:1000}

but with no succes
does anyone know how i can declare this variable proberly

thanks in advance
matthy

Body:
var path = [{x:458, y:-5},{x:458, y:153}, {x:212, y:254}, {x:208, y:606},{x:208, y:1000}];
TweenMax.to(ob, 30, {bezierThrough:path, ease:1});

[] creates an array, so you are just creating an array of objects (with x and y properties).


问:
How to run selenium scripts written in java from jmeter?
I am trying to use my Selenium scripts in java with JMeter's WebDriver  Sampler.

Inside the webdriver sampler, the language is seleced to java, and the following code added:

```<code>package automationFramework;

public class FirstTestCase {

    public static void main(String[] args) {

        // Create a new instance of the Firefox driver
        WebDriver driver = new ChromeDriver();

        //Launch the Online Store Website
        driver.get("www.google.com");

        // Print a Log In message to the screen
        System.out.println("Successfully opened the website www.google.com");

        //Wait for 5 Sec
        Thread.sleep(5);

        // Close the driver
        driver.quit();
    }
}
</code>```

I am facing the following error:

```<code>java.net.MalformedURLException: unknown protocol: data
at java.net.URL.<init>(URL.java:600)
at java.net.URL.<init>(URL.java:490)
at java.net.URL.<init>(URL.java:439)
at com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler.sample(WebDriverSampler.java:80)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:475)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:418)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:249)
at java.lang.Thread.run(Thread.java:745)
</code>```

However, tests written in javascripts work just fine.

What is the problem here? How to solve it?

答:
You should not be instantiating WebDriver instance, JMeter does it for you given you add Chrome Driver Config element to your Test Plan and configure path to the ChromeDriver executable.

Once done you should be able to use WDS.browser shorthand like:

```<code>WDS.sampleResult.sampleStart();
WDS.browser.get("http://google.com");
WDS.log.info("Successfully opened the website www.google.com");
Thread.sleep(5000);
WDS.sampleResult.sampleEnd();
</code>```

Also don't call quit() method, the WebDriver instance(s) will be shut down when test will be finished.

See Using Selenium with JMeter's WebDriver Sampler guide to get started with Selenium and JMeter integration.

Body:
I am trying to use my Selenium scripts in java with JMeter's WebDriver  Sampler.

Inside the webdriver sampler, the language is seleced to java, and the following code added:

package automationFramework;

public class FirstTestCase {

    public static void main(String[] args) {

        // Create a new instance of the Firefox driver
        WebDriver driver = new ChromeDriver();

        //Launch the Online Store Website
        driver.get("www.google.com");

        // Print a Log In message to the screen
        System.out.println("Successfully opened the website www.google.com");

        //Wait for 5 Sec
        Thread.sleep(5);

        // Close the driver
        driver.quit();
    }
}

I am facing the following error:

java.net.MalformedURLException: unknown protocol: data
at java.net.URL.<init>(URL.java:600)
at java.net.URL.<init>(URL.java:490)
at java.net.URL.<init>(URL.java:439)
at com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler.sample(WebDriverSampler.java:80)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:475)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:418)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:249)
at java.lang.Thread.run(Thread.java:745)

However, tests written in javascripts work just fine.

What is the problem here? How to solve it?

Body:
You should not be instantiating WebDriver instance, JMeter does it for you given you add Chrome Driver Config element to your Test Plan and configure path to the ChromeDriver executable.

Once done you should be able to use WDS.browser shorthand like:

WDS.sampleResult.sampleStart();
WDS.browser.get("http://google.com");
WDS.log.info("Successfully opened the website www.google.com");
Thread.sleep(5000);
WDS.sampleResult.sampleEnd();

Also don't call quit() method, the WebDriver instance(s) will be shut down when test will be finished.

See Using Selenium with JMeter's WebDriver Sampler guide to get started with Selenium and JMeter integration.


问:
Exclude date via .exclude
I have been looking everywhere for documentation on excluding time and before and after. Ie My app for school is for appointments. They want me to make sure no one can sign up earlier than the current day. If someone could give me a format I have it so i can strip it down to just the day. But not only an solution to the problem but a link to some great detailed documentation as I need date and time for a lot on this project would be good. </p>

```<code>'other' : Item.objects.exclude(time |date:"M d, Y"),
</code>```

<p>that is the current code  it does not work. I get invalid syntax. If I take out the () of it my page loads so the () is the issue. Any help would be greatly appropriated. </p>

答:
Maybe try filtering a date range instead of excluding before and after

```<code>Item.objects.filter(date__range=["2017-01-01", "2017-01-31"])
</code>```

To exclude before and after something like this should work with __lt for less than and __gt for greater than:

```<code>Item.objects.exclude(date__lt=datetime.date(2017, 1, 1)).exclude(date__gt=datetime.date(2017, 1, 31))
</code>```

Title: Exclude date via .exclude

Body:
I have been looking everywhere for documentation on excluding time and before and after. Ie My app for school is for appointments. They want me to make sure no one can sign up earlier than the current day. If someone could give me a format I have it so i can strip it down to just the day. But not only an solution to the problem but a link to some great detailed documentation as I need date and time for a lot on this project would be good.

'other' : Item.objects.exclude(time |date:"M d, Y"),

that is the current code  it does not work. I get invalid syntax. If I take out the () of it my page loads so the () is the issue. Any help would be greatly appropriated.

Body:
Maybe try filtering a date range instead of excluding before and after

Item.objects.filter(date__range=["2017-01-01", "2017-01-31"])

To exclude before and after something like this should work with __lt for less than and __gt for greater than:

Item.objects.exclude(date__lt=datetime.date(2017, 1, 1)).exclude(date__gt=datetime.date(2017, 1, 31))


问:
Liferay Serivce Builder: Not able to run dynamic query
I have two plugin portlets. First has service builder with all entities. Second portlet is using service's jar file to execute Dynamic query.

I am using first's service jar in my second plugin portlet to interact with database. But in this jar file there is not any Impl class. Thats why i am getting error Impl Class not found.
Below is for reference:

```<code>DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(XXX.class,
PortletClassLoaderUtil.getClassLoader());
try {
    XXXLocalServiceUtil.dynamicQuery(dynamicQuery);
} catch (SystemException e1) {
  // TODO Auto-generated catch block
  e1.printStackTrace();
}
</code>```

Error:
[DynamicQueryFactoryImpl:96] Unable find model com.compass.model.impl.XXXImpl
java.lang.ClassNotFoundException: com.compass.model.impl.XXXImpl

Nomal Functions are working fine of service builder

答:
Both works for me..

ClassLoader classLoader = (ClassLoader)PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), "portletClassLoader");

OR

ClassLoader classLoader = PortletBeanLocatorUtil.getBeanLocator(ClpSerializer.getServletContextName()).getClassLoader();

DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(charges.class,classLoader);

Thanks @Romeo.

Body:
I have two plugin portlets. First has service builder with all entities. Second portlet is using service's jar file to execute Dynamic query.

I am using first's service jar in my second plugin portlet to interact with database. But in this jar file there is not any Impl class. Thats why i am getting error Impl Class not found.
Below is for reference:

DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(XXX.class,
PortletClassLoaderUtil.getClassLoader());
try {
    XXXLocalServiceUtil.dynamicQuery(dynamicQuery);
} catch (SystemException e1) {
  // TODO Auto-generated catch block
  e1.printStackTrace();
}

Error:
[DynamicQueryFactoryImpl:96] Unable find model com.compass.model.impl.XXXImpl
java.lang.ClassNotFoundException: com.compass.model.impl.XXXImpl

Nomal Functions are working fine of service builder


问:
JavaScript not working when clicked
I'm trying to make the div slide up or slide back down when clicked, but nothing is happening when I click. I'm following a tutorial and I checked everything and can't seem to find the problem. Please help and explain what I'm doing wrong, I'm learning and I make a lot of silly mistakes so don't hate :)

<!DOCTYPE html>

<link href='https://fonts.googleapis.com/css?family=Londrina+Shadow' rel='stylesheet' type='text/css'>

esha's restaurant

a New York City eatery

welsh onion soko $14

  Mustard sierra leone bologi kale chard beet greens black-eyed pea sorrel amaranth garlic tigernut spring onion summer purslane asparagus lentil.

pastrami boudin tongue $22

  Tri-tip capicola kielbasa salami brisket chicken rump strip steak drumstick. Meatloaf chuck boudin ribeye pork jowl. Andouille bacon jowl meatloaf pork loin prosciutto bresaola.

fruitcake marzipan pudding dragee $8

  Lollipop tart cotton candy jelly-o carrot cake apple pie cupcake. Jelly-o bear claw ice cream candy canes.

```

答:
I had the same issue, make sure your add-ons are not interfering. I had to disable some ad-blocking. And yes, I found out thanks to the console, so thank you for everyone for your comments about that.

I don't think it's necessary to change the source of the library if you followed the tutorial letter-by-letter.

Title: JavaScript not working when clicked


问:
ETS function in package 'Forecast" in R, minimum data points
For the ETS function in R, am I looking for the minimal number of data points for the forecast. I read both of the Hyndman papers (2002 & 2008) which are mentioned in the documentation, but I could not find a quantifiable value. In: http://robjhyndman.com/hyndsight/short-time-series/ he mentioned that it depends on the number of parameters . But at this point  I am looking for a good source that can clarify the amount of data points needed in the ETS function. Can somebody help me with this? </p>

答:
Why don't you just try it and see what happens. You will find that the ets function will work with a single observation:

```<code>> 1 %>% ets %>% forecast
   Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
 2              1     1     1     1     1
 3              1     1     1     1     1
 4              1     1     1     1     1
 5              1     1     1     1     1
 6              1     1     1     1     1
 7              1     1     1     1     1
 8              1     1     1     1     1
 9              1     1     1     1     1
10              1     1     1     1     1
11              1     1     1     1     1
</code>```

Of course, it is not fitting two parameters, but it is doing something reasonable given the information provided.

If you read the blog post you cite, I write "The only reasonable approach is to first check that there are enough observations to estimate the model, and then to test if the model performs well out-of-sample." You need more observations than parameters to actually estimate the model.

Body:
Why don't you just try it and see what happens. You will find that the ets function will work with a single observation:

> 1 %>% ets %>% forecast
   Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
 2              1     1     1     1     1
 3              1     1     1     1     1
 4              1     1     1     1     1
 5              1     1     1     1     1
 6              1     1     1     1     1
 7              1     1     1     1     1
 8              1     1     1     1     1
 9              1     1     1     1     1
10              1     1     1     1     1
11              1     1     1     1     1

Of course, it is not fitting two parameters, but it is doing something reasonable given the information provided.

If you read the blog post you cite, I write "The only reasonable approach is to first check that there are enough observations to estimate the model, and then to test if the model performs well out-of-sample." You need more observations than parameters to actually estimate the model.


问:
Go unmarshalling JSON from compessed HTTP: invalid character looking for beginning of value
I've just written my first Go application which downloads and unmarshales simple JSON object over http. Http content is compressed:
'content-encoding': 'deflate'

I used several well-known examples (like this). Unfortunately the application fails to parse the desired JSON with quite rare and strange error. I wasn't able to find out what's the problem. Any help will be appreciated.

JSON input
(Python was used for debugging)

```<code>In [8]: r = requests.get("http://172.17.0.31:20000/top")

In [9]: r.text
Out[9]: u'{"timestamp":{"tv_sec":1428447555,"tv_usec":600186},"string_timestamp":"2015-04-07 22:59:15.600186","monitor_status":"enabled"}'
In [18]: r.headers
Out[18]: {'content-length': '111', 'content-type': 'application/json', 'connection': 'close', 'content-encoding': 'deflate'}
</code>```

Source code (UPDATED according to the answers)

```<code>package main

import (
    "encoding/json"
    "fmt"
    "io/ioutil"
    "net/http"
)

type Top struct {
    Timestamp        Timestamp `json:"timestamp"`
    String_timestamp string    `json:"string_timestamp"`
    Monitor_status   string    `json:"monitor_status"`
}

type Timestamp struct {
    Tv_sec  int `json:"tv_sec"`
    Tv_usec int `json:"tv_usec"`
}

func get_content() {

    url := "http://172.17.0.31:20000/top"

    res, err := http.Get(url)
    if err != nil {
        panic(err.Error())
    }
    fmt.Println(res)

    body, err := ioutil.ReadAll(res.Body)
    if err != nil {
        panic(err.Error())
    }
    fmt.Println(body)

    var jsondata Top
    err = json.Unmarshal(body, &jsondata)
    if err != nil {
        panic(err.Error())
    }

    fmt.Println(jsondata)
}

func main() {
    get_content()
}
</code>```

Error

```<code>[vitaly@thermaltake elliptics-manager]$ go run main.go
&{200 OK 200 HTTP/1.1 1 1 map[Content-Type:[application/json] Content-Length:[111] Content-Encoding:[deflate]] 0xc20803e340 111 [] true map[] 0xc208028820 <nil>}
[120 156 77 203 65 14 130 48 16 70 225 171 152 127 93 76 59 51 162 244 50 13 96 99 154 216 98 232 192 134 112 119 81 55 110 95 190 183 65 83 142 85 251 252 130 223 160 107 168 113 132 119 66 55 145 182 117 108 62 109 249 70 98 234 108 183 27 84 157 83 121 132 191 19 100 221 165 177 210 216 235 137 200 11 123 230 243 207 195 32 79 37 233 52 135 3 235 82 15 29 75 63 60 227 29 251 27 195 90 38 189]
panic: invalid character 'x' looking for beginning of value
</code>```

UPD: Thanks everyone. Now it's obvious that the reason of this issue was a deflate compression of HTTP response. However, it's still not clear how to perform a decompression in Golang (see here).

答:
Try this please

```<code>func get_content() {

    url := "http://172.17.0.31:20000/top"

    res, err := http.Get(url)
    if err != nil {
        panic(err.Error())
    }
    defer res.Body.Close()

    fmt.Println("res body:", res.Body)

    body, err := ioutil.ReadAll(resp=.Body)

    fmt.Println("body:", body)
    re, err := zlib.NewReader(bytes.NewReader(body))
    fmt.Println("zlib:", re)
    enflated, err := ioutil.ReadAll(re)
    fmt.Println("enflated:", string(enflated))

    var jsondata Top
    err = json.Unmarshal(body, &jsondata)
    if err != nil {
        panic(err.Error())
    }

    fmt.Println(jsondata)
}
</code>```

and ensure http://172.17.0.31:20000/top return json type.

Body:
I've just written my first Go application which downloads and unmarshales simple JSON object over http. Http content is compressed:
'content-encoding': 'deflate'

I used several well-known examples (like this). Unfortunately the application fails to parse the desired JSON with quite rare and strange error. I wasn't able to find out what's the problem. Any help will be appreciated.

JSON input
(Python was used for debugging)

In [8]: r = requests.get("http://172.17.0.31:20000/top")

In [9]: r.text
Out[9]: u'{"timestamp":{"tv_sec":1428447555,"tv_usec":600186},"string_timestamp":"2015-04-07 22:59:15.600186","monitor_status":"enabled"}'
In [18]: r.headers
Out[18]: {'content-length': '111', 'content-type': 'application/json', 'connection': 'close', 'content-encoding': 'deflate'}

Source code (UPDATED according to the answers)

package main

import (
    "encoding/json"
    "fmt"
    "io/ioutil"
    "net/http"
)

type Top struct {
    Timestamp        Timestamp `json:"timestamp"`
    String_timestamp string    `json:"string_timestamp"`
    Monitor_status   string    `json:"monitor_status"`
}

type Timestamp struct {
    Tv_sec  int `json:"tv_sec"`
    Tv_usec int `json:"tv_usec"`
}

func get_content() {

    url := "http://172.17.0.31:20000/top"

    res, err := http.Get(url)
    if err != nil {
        panic(err.Error())
    }
    fmt.Println(res)

    body, err := ioutil.ReadAll(res.Body)
    if err != nil {
        panic(err.Error())
    }
    fmt.Println(body)

    var jsondata Top
    err = json.Unmarshal(body, &jsondata)
    if err != nil {
        panic(err.Error())
    }

    fmt.Println(jsondata)
}

func main() {
    get_content()
}

Error

[vitaly@thermaltake elliptics-manager]$ go run main.go
&{200 OK 200 HTTP/1.1 1 1 map[Content-Type:[application/json] Content-Length:[111] Content-Encoding:[deflate]] 0xc20803e340 111 [] true map[] 0xc208028820 <nil>}
[120 156 77 203 65 14 130 48 16 70 225 171 152 127 93 76 59 51 162 244 50 13 96 99 154 216 98 232 192 134 112 119 81 55 110 95 190 183 65 83 142 85 251 252 130 223 160 107 168 113 132 119 66 55 145 182 117 108 62 109 249 70 98 234 108 183 27 84 157 83 121 132 191 19 100 221 165 177 210 216 235 137 200 11 123 230 243 207 195 32 79 37 233 52 135 3 235 82 15 29 75 63 60 227 29 251 27 195 90 38 189]
panic: invalid character 'x' looking for beginning of value

UPD: Thanks everyone. Now it's obvious that the reason of this issue was a deflate compression of HTTP response. However, it's still not clear how to perform a decompression in Golang (see here).

Body:
Try this please

func get_content() {

    url := "http://172.17.0.31:20000/top"

    res, err := http.Get(url)
    if err != nil {
        panic(err.Error())
    }
    defer res.Body.Close()

    fmt.Println("res body:", res.Body)

    body, err := ioutil.ReadAll(resp=.Body)

    fmt.Println("body:", body)
    re, err := zlib.NewReader(bytes.NewReader(body))
    fmt.Println("zlib:", re)
    enflated, err := ioutil.ReadAll(re)
    fmt.Println("enflated:", string(enflated))

    var jsondata Top
    err = json.Unmarshal(body, &jsondata)
    if err != nil {
        panic(err.Error())
    }

    fmt.Println(jsondata)
}

and ensure http://172.17.0.31:20000/top return json type.


问:
advanced custom filed (ACF) front end form not sending email.
I am using acf form to add events to my site. it is adding event perfectly . I am try to send email when user submit email. But mail not working. here is the code I am using

```<code>    <div class="event_forn_holder">

            <?php acf_form(array(

                'post_id'       => 'new_post',
                'new_post'      => array(
                    'post_type'     => 'events',
                    'post_status'       => 'pending'
                ),

                'html_updated_message'  => '<div id="event_message" class="alert alert-success"><p>Event has been submitted for review. Thanks</p></div>',
                'post_title' => false,
                'uploader' => 'basic',
            'field_groups' => array(3236),
                'submit_value'      => 'Submit Event'
            )); ?>

            </div>
</code>```

Here is the code I am using in functions.php

```<code>add_action('acf/save_post', 'acf_my_save_post');

function acf_my_save_post( $post_id ) {

    // bail early if not a contact_form post
    if( get_post_type($post_id) !== 'events' ) {

        return;

    }

    // bail early if editing in admin
    if( is_admin() ) {

        return;

    }

    // vars
    $post = get_post( $post_id );

    // get custom fields (field group exists for content_form)
    $name = get_field('event_name', $post_id);
    $email = get_field('your_email', $post_id);

    // email data
    $to = 'mail@yahoo.com';
    $headers = 'From: ' . $name . ' <' . $email . '>' . "\r\n";
    $subject = $post->post_title;
    $body = $post->post_content;

    // send email
    wp_mail($to, $subject, $body, $headers );

}
</code>```

答:
I just compared it with a function I have that's almost exactly the same, except it actually does work and send me the email. The only difference I see is that in mine I have the $body variable starting with "\r\n" and then the content.

```<code>    $body = "\r\n" . $post->post_content;
</code>```

Other than that maybe it's going to spam. Or maybe you have some other plugin or code somehow conflicting with it.

Body:
I am using acf form to add events to my site. it is adding event perfectly . I am try to send email when user submit email. But mail not working. here is the code I am using

            <?php acf_form(array(

                'post_id'       => 'new_post',
                'new_post'      => array(
                    'post_type'     => 'events',
                    'post_status'       => 'pending'
                ),

                'html_updated_message'  => '

Event has been submitted for review. Thanks

',
                'post_title' => false,
                'uploader' => 'basic',
            'field_groups' => array(3236),
                'submit_value'      => 'Submit Event'
            )); ?>

Here is the code I am using in functions.php

add_action('acf/save_post', 'acf_my_save_post');

function acf_my_save_post( $post_id ) {

    // bail early if not a contact_form post
    if( get_post_type($post_id) !== 'events' ) {

        return;

    }

    // bail early if editing in admin
    if( is_admin() ) {

        return;

    }

    // vars
    $post = get_post( $post_id );

    // get custom fields (field group exists for content_form)
    $name = get_field('event_name', $post_id);
    $email = get_field('your_email', $post_id);

    // email data
    $to = 'mail@yahoo.com';
    $headers = 'From: ' . $name . ' <' . $email . '>' . "\r\n";
    $subject = $post->post_title;
    $body = $post->post_content;

    // send email
    wp_mail($to, $subject, $body, $headers );

}

Body:
I just compared it with a function I have that's almost exactly the same, except it actually does work and send me the email. The only difference I see is that in mine I have the $body variable starting with "\r\n" and then the content.

    $body = "\r\n" . $post->post_content;

Other than that maybe it's going to spam. Or maybe you have some other plugin or code somehow conflicting with it.


问:
Reindex data from Elasticsearch 1.X to ElastichSearch with old _timeStamp to new Field
I am trying to migrate my data from an old Elasticsearch(Version 1.4.4) Cluster to a new one (5.1)

I am using the reindex api in the new Elasticsearch, but can't get the old _timestamp to a new field timestamp. Everything else works fine.

```<code>POST _reindex
{
  "source": {
    "remote": {
      "host": "http://oldhost:9200"
    },
    "index": "source",
    "query": {
       "match_all": {}
    }
  },
  "dest": {
    "index": "dest"
  }
}
</code>```

Are there any way to add a script tag to set the new field timestamp from the old _timestamp?

答:
I'm not 100% certain this will work, but using the reindex API you can specify a tiny bit of script that might be able to read the old _timestamp field (although I've never tried it personally):

```<code>POST _reindex
{
  "source": {
    "remote": {
      "host": "http://oldhost:9200"
    },
    "index": "source"
    "query": {
       "match_all": {}
    }
  },
  "dest": {
    "index": "dest"
  },
  "script": {
    "lang": "painless",
    "inline": "ctx._source.timestamp = ctx._timestamp"
  }
}
</code>```

Body:
I am trying to migrate my data from an old Elasticsearch(Version 1.4.4) Cluster to a new one (5.1)

I am using the reindex api in the new Elasticsearch, but can't get the old _timestamp to a new field timestamp. Everything else works fine.

POST _reindex
{
  "source": {
    "remote": {
      "host": "http://oldhost:9200"
    },
    "index": "source",
    "query": {
       "match_all": {}
    }
  },
  "dest": {
    "index": "dest"
  }
}

Are there any way to add a script tag to set the new field timestamp from the old _timestamp?

Body:
I'm not 100% certain this will work, but using the reindex API you can specify a tiny bit of script that might be able to read the old _timestamp field (although I've never tried it personally):

POST _reindex
{
  "source": {
    "remote": {
      "host": "http://oldhost:9200"
    },
    "index": "source"
    "query": {
       "match_all": {}
    }
  },
  "dest": {
    "index": "dest"
  },
  "script": {
    "lang": "painless",
    "inline": "ctx._source.timestamp = ctx._timestamp"
  }
}


问:
Width of R code chunk output in RMarkdown files knitr-ed to html

Question:

What is the current working solution to set the width of r code output in html files? I would like to set width to something big and use a slider in the html output.

options(width = XXX) seems not to work anymore.

Example:

```<code>---
title: "Width test"
output:
  html_document:
    theme: default
---
```{r global_options, echo = FALSE, include = FALSE}
options(width = 999)
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE,
                      cache = FALSE, tidy = FALSE, size = "small")
```
```{r}
sessionInfo()
```
```{r}
dataM <- matrix(rnorm(100, 5, 2), ncol = 15)
dataM
```
</code>```

Result:

sessionInfo() output on the screenshot above.

Related:

(options(width = 999) is not working for me)

knitr: How to prevent text wrapping in output?

How to adjust the output width of RStudio Markdown output (to HTML)

答:
I ran into a similar problem but was using the Stata engine (more info here). In this case it turned out that it wasn't a problem with knitr itself but with my Stata settings.

The trick was to add a Stata-specific block after the initial setup block that sets the line width.

```<code>```{r setup_knitr, echo=FALSE, message=FALSE}
# This is the usual setup block needed to set up the Stata Engine
require(knitr)
statapath <- "C:/Program Files (x86)/Stata13/Stata-64.exe"
opts_chunk$set(engine="stata", engine.path=statapath, comment="")
```

```{r setup_stata, echo=FALSE,message=FALSE,collectcode=TRUE}
* Now that Stata engine is set up, this block sets up Stata options
set linesize 200
set more off
```
</code>```

Body:
Question:

What is the current working solution to set the width of r code output in html files? I would like to set width to something big and use a slider in the html output.

options(width = XXX) seems not to work anymore.

Example:

---
title: "Width test"
output:
  html_document:
    theme: default
---
```{r global_options, echo = FALSE, include = FALSE}
options(width = 999)
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE,
                      cache = FALSE, tidy = FALSE, size = "small")
```
```{r}
sessionInfo()
```
```{r}
dataM <- matrix(rnorm(100, 5, 2), ncol = 15)
dataM
```

Result:

sessionInfo() output on the screenshot above.

Related:

(options(width = 999) is not working for me)

knitr: How to prevent text wrapping in output?

How to adjust the output width of RStudio Markdown output (to HTML)

Body:
I ran into a similar problem but was using the Stata engine (more info here). In this case it turned out that it wasn't a problem with knitr itself but with my Stata settings.

The trick was to add a Stata-specific block after the initial setup block that sets the line width.

```{r setup_knitr, echo=FALSE, message=FALSE}
# This is the usual setup block needed to set up the Stata Engine
require(knitr)
statapath <- "C:/Program Files (x86)/Stata13/Stata-64.exe"
opts_chunk$set(engine="stata", engine.path=statapath, comment="")
```

```{r setup_stata, echo=FALSE,message=FALSE,collectcode=TRUE}
* Now that Stata engine is set up, this block sets up Stata options
set linesize 200
set more off
```


问:
How to get date more than 14 days base on date in column?
Example: Claim Date = 14/3/2017 And today was 29/3/2017 it was more than 14 days.
I've tried DATEDIFF in Mysql it keep showing error somehow.

```<code>Example Table:
Table Name:
**ec_claims**
ec_claims_id Primaryint(11)
ec_claims_date  date
</code>```

CODE:

```<code>SELECT DATEDIFF(NOW(),ec_claims_date) AS DAYGAP FROM ec_claims
WHERE DAYGAP >= 14
</code>```

Error:

```<code>#1054 - Unknown column 'DAYGAP' in 'where clause'
</code>```

Thank You For Reading This.

答:
Use DATE_ADD function like

```<code>SELECT DATE_ADD(now(),INTERVAL -14 DAY) AS fourteenDayAgo
</code>```

In your case

```<code>SELECT ec_claims_date FROM ec_claims
WHERE DATE_ADD(now(),INTERVAL -14 DAY)> ec_claims_date
</code>```

or like you write, you must repeat it in WHERE clause

```<code>SELECT DATEDIFF(NOW(),ec_claims_date) AS DAYGAP FROM ec_claims
  WHERE DATEDIFF(NOW(),ec_claims_date) >= 14
</code>```

Body:
Example: Claim Date = 14/3/2017 And today was 29/3/2017 it was more than 14 days.
I've tried DATEDIFF in Mysql it keep showing error somehow.

Example Table:
Table Name:
**ec_claims**
ec_claims_id Primaryint(11)
ec_claims_date  date

CODE:

SELECT DATEDIFF(NOW(),ec_claims_date) AS DAYGAP FROM ec_claims
WHERE DAYGAP >= 14

Error:

#1054 - Unknown column 'DAYGAP' in 'where clause'

Thank You For Reading This.

Body:
Use DATE_ADD function like

SELECT DATE_ADD(now(),INTERVAL -14 DAY) AS fourteenDayAgo

In your case

SELECT ec_claims_date FROM ec_claims
WHERE DATE_ADD(now(),INTERVAL -14 DAY)> ec_claims_date

or like you write, you must repeat it in WHERE clause

SELECT DATEDIFF(NOW(),ec_claims_date) AS DAYGAP FROM ec_claims
  WHERE DATEDIFF(NOW(),ec_claims_date) >= 14


问:
Efficient algorithms to find out n shortest euclidean length of one point to many other points
Trying to find the n shortest length between a lot of points.

Example:

```<code>A1 = (1.31, 2.22)
B1 = (2.33, 4.88)
C1 = (12,1, 0.11)
.
.
.
.
Z100 = (0.01, 0.05)
target = (1.0, 1.0)
</code>```

The question is, how could I find out the top 10 shortest length of target and another points.Easiest solution is compare them one by one

```<code>for(size_t i = 0; i != points.size(); ++i){
  priority_queue.push(distance(target, points[i]));
  if(priority_queue.size() >= max_size){
    priority_queue.pop();
  }
}
</code>```

I think complexity is O(n) by this naive solution, is it possible to speed things up?Thanks

答:
If you are just presented with a list of N points and a single target point, the cost is likely to be O(N) because if this is all you know you will need to examine all of the N points to find the closest 10, and this is cost O(N).

If, for example, you have a list of N points and expect to receive a large number of queries, it may be worth building a data-structure to speed up the search, especially if the number of dimensions in the problem is small (such as 2, in the example you give). Data structures include https://en.wikipedia.org/wiki/Cover_tree and https://en.wikipedia.org/wiki/K-d_tree. If you are satisfied with finding 10 points which are pretty close but not necessarily the 10 closest, then packages such as https://www.cs.umd.edu/~mount/ANN/ may be useful.

Body:
Trying to find the n shortest length between a lot of points.

Example:

A1 = (1.31, 2.22)
B1 = (2.33, 4.88)
C1 = (12,1, 0.11)
.
.
.
.
Z100 = (0.01, 0.05)
target = (1.0, 1.0)

The question is, how could I find out the top 10 shortest length of target and another points.Easiest solution is compare them one by one

for(size_t i = 0; i != points.size(); ++i){
  priority_queue.push(distance(target, points[i]));
  if(priority_queue.size() >= max_size){
    priority_queue.pop();
  }
}

I think complexity is O(n) by this naive solution, is it possible to speed things up?Thanks


问:
How to combine hash in PHP
I would like to ask if how to combine hash codes in PHP?

For example I have some checksums here (just sample checksums):

```<code>checksum1:b62e146dbc34b6f7dd0d7b1dc4e6c93ebc2a0016793e3af701fe4f3eab3299d1
checksum2:dsfhsdf8s6f87e4r34ijtr5i34u5934534534ij5340598348534095834095j34
checksum3:4324298sdfhsdhfsdhf387455hsdfhsdf9358903485jsdfjsdjfsiuf03458345
</code>```

If I have these sample checksums of a file which will be split into 3 parts, I have to combine the first 2 checksums and then combine the last checksum after.

Edit: Combine means if I combine 2 checksums, it will generate new checksum.

I would like to achieve through the code what was stated in here:

Combine the first two hashes and take the binary hash of the result.

$ cat hash1 hash2 > hash12

$ openssl dgst -sha256 -binary hash12 > hash12hash

This is in the command line interface. The binary result was later on converted to hexadecimal.
How is it possible for PHP?

答:
You can use . operator to combine </p>

```<code>        $checksum1='b62e146dbc34b6f7dd0d7b1dc4e6c93ebc2a0016793e3af701fe4f3eab3299d1';
        $checksum2='dsfhsdf8s6f87e4r34ijtr5i34u5934534534ij5340598348534095834095j34';
        $checksum3='4324298sdfhsdhfsdhf387455hsdfhsdf9358903485jsdfjsdjfsiuf03458345';

echo $checksum1.$checksum2.$checksum3;
</code>```

Title: How to combine hash in PHP

Body:
I would like to ask if how to combine hash codes in PHP?

For example I have some checksums here (just sample checksums):

checksum1:b62e146dbc34b6f7dd0d7b1dc4e6c93ebc2a0016793e3af701fe4f3eab3299d1
checksum2:dsfhsdf8s6f87e4r34ijtr5i34u5934534534ij5340598348534095834095j34
checksum3:4324298sdfhsdhfsdhf387455hsdfhsdf9358903485jsdfjsdjfsiuf03458345

If I have these sample checksums of a file which will be split into 3 parts, I have to combine the first 2 checksums and then combine the last checksum after.

Edit: Combine means if I combine 2 checksums, it will generate new checksum.

I would like to achieve through the code what was stated in here:

Combine the first two hashes and take the binary hash of the result.

$ cat hash1 hash2 > hash12

$ openssl dgst -sha256 -binary hash12 > hash12hash

This is in the command line interface. The binary result was later on converted to hexadecimal.
How is it possible for PHP?

Body:
You can use . operator to combine

        $checksum1='b62e146dbc34b6f7dd0d7b1dc4e6c93ebc2a0016793e3af701fe4f3eab3299d1';
        $checksum2='dsfhsdf8s6f87e4r34ijtr5i34u5934534534ij5340598348534095834095j34';
        $checksum3='4324298sdfhsdhfsdhf387455hsdfhsdf9358903485jsdfjsdjfsiuf03458345';

echo $checksum1.$checksum2.$checksum3;


问:
How can I correct my PHP code for this SQL query?
I've been messing with this for a while and I'm nearly there. Just need to get past this wall I've hit.

I have the following tables:

```<code>tracks (trackid, tracktitle, albumid, composerid)
albums (albumid, albumname)
composers (composerid, composername)
</code>```

I can insert a new record via PhpMyAdmin SQL tab with

```<code>INSERT INTO tracks (tracktitle, albumid, composerid) VALUES ('New Song', 1, 1);
</code>```

and it works fine.

My PHP form though isn't doing the same thing and I must have overlooked something.
Please can someone check out the code for my addtrack page and tell me what is wrong?

```<code> if (isset($_POST['tracktitle'])):
 // A new track has been entered
 // using the form.

 $cid= $_POST['cid'];
 $tracktitle = $_POST['tracktitle'];
 $albs = $_POST['albs'];

 if ($cid == '') {
 exit('<p>You must choose an composer for this track.
 Click "Back" and try again.</p>');
  }

  $sql = "INSERT INTO tracks SET
  tracks.tracktitle='$tracktitle'" ;
  if (@mysql_query($sql)) {
  echo '<p>New track added</p>';
  } else {
  exit('<p>Error adding new track' . mysql_error() . '</p>');
  }

  $trackid = mysql_insert_id();

  if (isset($_POST['albs'])) {
   $albs = $_POST['albs'];
   } else {
   $albs = array();
   }

  $numAlbs = 0;
  foreach ($albs as $albID) {
  $sql = "INSERT IGNORE INTO tracks (trackid, albumid,
  composerid) VALUES " .
"($trackid, $albs, $cid)";

if ($ok) {
  $numAlbs = $numAlbs + 1;
} else {
  echo "<p>Error inserting track into album $albID: " .
      mysql_error() . '</p>';
}
}
 ?>

<p>Track was added to <?php echo $numAlbs; ?> albums.</p>

 <p><a href="<?php echo $_SERVER['PHP_SELF']; ?>">Add another
 track</a></p>
 <p><a href="tracks.php">Return to track search</a></p>

 <?php
 else: // Allow the user to enter a new track

 $composers = @mysql_query('SELECT composerid, composername
 FROM composers');
  if (!$composers) {
 exit('<p>Unable to obtain composer list from the
database.</p>');
 }

$albs = @mysql_query('SELECT albumid, albumname FROM albums');
 if (!$albs) {
 exit('<p>Unable to obtain album list from the
 database.</p>');
 }
 ?>

 <form action="<?php echo $_SERVER['PHP_SELF']; ?>"
 method="post">
 <p>Enter the new track:<br />
 <textarea name="tracktitle" rows="1" cols="20">
 </textarea></p>
 <p>Composer:
 <select name="cid" size="1">
  <option selected value="">Select One</option>
  <option value="">---------</option>
  <?php
   while ($composer= mysql_fetch_array($composers)) {
    $cid = $composer['composerid'];
    $cname = htmlspecialchars($composer['composername']);
    echo "<option value='$cid'>$cname</option>\n";
     }
    ?>
    </select></p>
    <p>Place in albums:<br />
   <?php
   while ($alb = mysql_fetch_array($albs)) {
    $aid = $alb['albumid'];
    $aname = htmlspecialchars($alb['albumname']);
     echo "<label><input type='checkbox' name='albs[]'
    value='$aid' />$aname</label><br />\n";
    }
   ?>
</code>```

Once I have this sorted, I can move on to expanding it and also sorting out the security issues. Someone on here recommended I look into PDO's which are a new thing to me.
But one hurdle at a time....

Thanks

答:
Your INSERT syntax is incorrect. You are trying to INSERT using an UPDATE syntax.

You are trying:

```<code>INSERT INTO table_name SET field_name = '$value', another_field_name = '$another_value'
</code>```

But you should be doing:

```<code>INSERT INTO table_name (
    field_name,
    another_field_name
)
VALUES (
    '$value',
    '$another_value'
)
</code>```

Also, you really should be using addslahes(), like this:

```<code>INSERT INTO table_name (
    field_name,
    another_field_name
)
VALUES (
    '".addslashes($value)."',
    '".addslashes($another_value)."'
)
</code>```

Otherwise your code is easier to hack than a boiled potato. :)

EDIT: Chad Birch (below) suggests rather using parameterized values, which admittedly is better than addslashes(). I honestly didn't know PHP had those already.

Body:
I've been messing with this for a while and I'm nearly there. Just need to get past this wall I've hit.

I have the following tables:

tracks (trackid, tracktitle, albumid, composerid)
albums (albumid, albumname)
composers (composerid, composername)

I can insert a new record via PhpMyAdmin SQL tab with

INSERT INTO tracks (tracktitle, albumid, composerid) VALUES ('New Song', 1, 1);

and it works fine.

My PHP form though isn't doing the same thing and I must have overlooked something.
Please can someone check out the code for my addtrack page and tell me what is wrong?

 if (isset($_POST['tracktitle'])):
 // A new track has been entered
 // using the form.

 $cid= $_POST['cid'];
 $tracktitle = $_POST['tracktitle'];
 $albs = $_POST['albs'];

 if ($cid == '') {
 exit('
You must choose an composer for this track.
 Click "Back" and try again.
');
  }

  $sql = "INSERT INTO tracks SET
  tracks.tracktitle='$tracktitle'" ;
  if (@mysql_query($sql)) {
  echo '
New track added
';
  } else {
  exit('
Error adding new track' . mysql_error() . '
');
  }

  $trackid = mysql_insert_id();

  if (isset($_POST['albs'])) {
   $albs = $_POST['albs'];
   } else {
   $albs = array();
   }

  $numAlbs = 0;
  foreach ($albs as $albID) {
  $sql = "INSERT IGNORE INTO tracks (trackid, albumid,
  composerid) VALUES " .
"($trackid, $albs, $cid)";

if ($ok) {
  $numAlbs = $numAlbs + 1;
} else {
  echo "
Error inserting track into album $albID: " .
      mysql_error() . '
';
}
}
 ?>

Track was added to <?php echo $numAlbs; ?> albums.

<a href="<?php echo $_SERVER['PHP_SELF']; ?>">Add another
 track

Return to track search

 <?php
 else: // Allow the user to enter a new track

 $composers = @mysql_query('SELECT composerid, composername
 FROM composers');
  if (!$composers) {
 exit('
Unable to obtain composer list from the
database.
');
 }

$albs = @mysql_query('SELECT albumid, albumname FROM albums');
 if (!$albs) {
 exit('
Unable to obtain album list from the
 database.
');
 }
 ?>

 <form action="<?php echo $_SERVER['PHP_SELF']; ?>"
 method="post">

Enter the new track:

 <textarea name="tracktitle" rows="1" cols="20">
 </textarea>

Composer:
 <select name="cid" size="1">
  <option selected value="">Select One</option>
  <option value="">---------</option>
  <?php
   while ($composer= mysql_fetch_array($composers)) {
    $cid = $composer['composerid'];
    $cname = htmlspecialchars($composer['composername']);
    echo "<option value='$cid'>$cname</option>\n";
     }
    ?>
    </select>

Place in albums:

   <?php
   while ($alb = mysql_fetch_array($albs)) {
    $aid = $alb['albumid'];
    $aname = htmlspecialchars($alb['albumname']);
     echo "<input type='checkbox' name='albs[]'
    value='$aid' />$aname
\n";
    }
   ?>

Once I have this sorted, I can move on to expanding it and also sorting out the security issues. Someone on here recommended I look into PDO's which are a new thing to me.
But one hurdle at a time....

Thanks

Body:
Your INSERT syntax is incorrect. You are trying to INSERT using an UPDATE syntax.

You are trying:

INSERT INTO table_name SET field_name = '$value', another_field_name = '$another_value'

But you should be doing:

INSERT INTO table_name (
    field_name,
    another_field_name
)
VALUES (
    '$value',
    '$another_value'
)

Also, you really should be using addslahes(), like this:

INSERT INTO table_name (
    field_name,
    another_field_name
)
VALUES (
    '".addslashes($value)."',
    '".addslashes($another_value)."'
)

Otherwise your code is easier to hack than a boiled potato. :)

EDIT: Chad Birch (below) suggests rather using parameterized values, which admittedly is better than addslashes(). I honestly didn't know PHP had those already.


问:
How to make a bullet list with Swift?
So I want to make something like this using swift and xcode:

Where I get each dot from an array. What I have thought is to make a UILabel and make a for loop that iterates over the array and in each iteration it adds to the label \u{2022} + content. I know \u{2022} is the dot point in unicode, the problem is that I need a way to make the list divided in two columns as shown and to make the dot point color yellow. This cant be done if I add the dots programmatically as I described above because the default color would be black. As the number of dots varies from the array contents for example if the array is of size 3 then only 3 dots would show 2 in the left and one to the right I need a way to meet this requirement, the other method I thought was of having two table views that takes half the screen and add this elements to each table view depending on the array. What should be the best practice here or is there a way to make this in the storyboard in a form that is dependent of an array.

答:
use 2 labels inside a view for the columns. both labels being multulined

```<code>class Helper {

    static func bulletedList(strings:[String], textColor:UIColor, font:UIFont, bulletColor:UIColor, bulletSize:BulletSize) -> NSAttributedString {
        let textAttributesDictionary = [NSFontAttributeName : font, NSForegroundColorAttributeName:textColor]

        let bulletAttributesDictionary = [NSFontAttributeName : font.withSize(bulletSize.rawValue), NSForegroundColorAttributeName:bulletColor]
        let fullAttributedString = NSMutableAttributedString.init()

        for string: String in strings
        {
            let bulletPoint: String = "\u{2022}"
            let formattedString: String = "\(bulletPoint) \(string)\n"
            let attributedString: NSMutableAttributedString = NSMutableAttributedString(string: formattedString)
            let paragraphStyle = createParagraphAttribute()

            attributedString.addAttributes([NSParagraphStyleAttributeName: paragraphStyle], range: NSMakeRange(0, attributedString.length))
            attributedString.addAttributes(textAttributesDictionary, range: NSMakeRange(0, attributedString.length))

            let string:NSString = NSString(string: formattedString)
            let rangeForBullet:NSRange = string.range(of: bulletPoint)

            attributedString.addAttributes(bulletAttributesDictionary, range: rangeForBullet)
            fullAttributedString.append(attributedString)
        }
        return fullAttributedString
    }

    static func createParagraphAttribute() -> NSParagraphStyle {

        var paragraphStyle: NSMutableParagraphStyle
        paragraphStyle = NSParagraphStyle.default.mutableCopy() as! NSMutableParagraphStyle
        paragraphStyle.tabStops = [NSTextTab(textAlignment: .left, location: 15, options: NSDictionary() as! [String : AnyObject])]
        paragraphStyle.defaultTabInterval = 15
        paragraphStyle.firstLineHeadIndent = 0
        paragraphStyle.lineSpacing = 3
        paragraphStyle.headIndent = 10
        return paragraphStyle
    }
}
</code>```

and simply use Helper.bulletedList to create your bulletted list as Attributed text for the label

Title: How to make a bullet list with Swift?

Body:
use 2 labels inside a view for the columns. both labels being multulined

class Helper {

    static func bulletedList(strings:[String], textColor:UIColor, font:UIFont, bulletColor:UIColor, bulletSize:BulletSize) -> NSAttributedString {
        let textAttributesDictionary = [NSFontAttributeName : font, NSForegroundColorAttributeName:textColor]

        let bulletAttributesDictionary = [NSFontAttributeName : font.withSize(bulletSize.rawValue), NSForegroundColorAttributeName:bulletColor]
        let fullAttributedString = NSMutableAttributedString.init()

        for string: String in strings
        {
            let bulletPoint: String = "\u{2022}"
            let formattedString: String = "\(bulletPoint) \(string)\n"
            let attributedString: NSMutableAttributedString = NSMutableAttributedString(string: formattedString)
            let paragraphStyle = createParagraphAttribute()

            attributedString.addAttributes([NSParagraphStyleAttributeName: paragraphStyle], range: NSMakeRange(0, attributedString.length))
            attributedString.addAttributes(textAttributesDictionary, range: NSMakeRange(0, attributedString.length))

            let string:NSString = NSString(string: formattedString)
            let rangeForBullet:NSRange = string.range(of: bulletPoint)

            attributedString.addAttributes(bulletAttributesDictionary, range: rangeForBullet)
            fullAttributedString.append(attributedString)
        }
        return fullAttributedString
    }

    static func createParagraphAttribute() -> NSParagraphStyle {

        var paragraphStyle: NSMutableParagraphStyle
        paragraphStyle = NSParagraphStyle.default.mutableCopy() as! NSMutableParagraphStyle
        paragraphStyle.tabStops = [NSTextTab(textAlignment: .left, location: 15, options: NSDictionary() as! [String : AnyObject])]
        paragraphStyle.defaultTabInterval = 15
        paragraphStyle.firstLineHeadIndent = 0
        paragraphStyle.lineSpacing = 3
        paragraphStyle.headIndent = 10
        return paragraphStyle
    }
}

and simply use Helper.bulletedList to create your bulletted list as Attributed text for the label