问:
Android gradle sync issue
This app was running perfectly OK without any issue. Suddenly i saw this gradle sync problems.I'm really stuck and need help. What to do now? I've uninstalled and reinstalled android support repository from SDK manager.

```<code>C:\Users\DELL\AndroidStudioProjects\Prokriti\app\build.gradle
    Error:Error:Failed to resolve: com.android.support:support-annotations:27.0.1
Install Repository and sync project
    Error:Error:Failed to resolve: com.android.support:appcompat-v7:27.0.1
Install Repository and sync project
    Error:Error:Failed to resolve: com.android.support:customtabs:27.0.1
Install Repository and sync project
    Error:Error:Failed to resolve: com.android.support:cardview-v7:27.0.1
Install Repository and sync project
    Error:Error:Failed to resolve: com.android.support:support-v4:27.0.1
Install Repository and sync project
    Error:Error:Failed to resolve: com.android.support:support-core-utils:27.0.1
Install Repository and sync project
</code>```

build.gradle  (app)

```<code>apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.avtro.prokriti.prokriti"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true

    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:cardview-v7:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support:support-core-utils:25.3.1'
    compile 'com.android.support:support-annotations:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.android.gms:play-services-auth:11.0.4'
    compile 'com.google.firebase:firebase-core:11.0.2'
    compile 'com.google.firebase:firebase-messaging:11.0.2'
    compile 'com.google.firebase:firebase-database:11.0.2'
    compile 'com.google.firebase:firebase-auth:11.0.2'
    compile 'com.google.firebase:firebase-ads:11.0.2'
    compile 'com.afollestad.material-dialogs:core:0.9.4.5'
    compile 'com.wang.avi:library:2.1.3'
    compile 'com.google.android.gms:play-services-ads:11.0.4'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.survivingwithandroid:weatherlib:1.6.0'
    compile 'com.amitshekhar.android:android-networking:1.0.0'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.squareup.okhttp:okhttp:2.0.0'
    compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    compile 'com.google.firebase:firebase-storage:11.0.2'
    androidTestCompile 'junit:junit:4.12'
    compile 'javax.inject:javax.inject:1'
    compile 'com.android.support:support-v4:25.3.1'
    compile 'com.github.bumptech.glide:glide:3.8.0'
}
apply plugin: 'com.google.gms.google-services'
</code>```

build.gradle  (project)

```<code>buildscript {
    repositories {
        jcenter()
    }
dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.google.gms:google-services:3.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
</code>```

i didnt update android studio or gradle. Android support repository is installed.

答:
You need to change only one line.

Fixed by updating facebook sdk version

from

compile 'com.facebook.android:facebook-android-sdk:[4,5)'
to

compile 'com.facebook.android:facebook-android-sdk:4.26.0'

Title: Android gradle sync issue

Body:
This app was running perfectly OK without any issue. Suddenly i saw this gradle sync problems.I'm really stuck and need help. What to do now? I've uninstalled and reinstalled android support repository from SDK manager.

C:\Users\DELL\AndroidStudioProjects\Prokriti\app\build.gradle
    Error:Error:Failed to resolve: com.android.support:support-annotations:27.0.1
Install Repository and sync project
    Error:Error:Failed to resolve: com.android.support:appcompat-v7:27.0.1
Install Repository and sync project
    Error:Error:Failed to resolve: com.android.support:customtabs:27.0.1
Install Repository and sync project
    Error:Error:Failed to resolve: com.android.support:cardview-v7:27.0.1
Install Repository and sync project
    Error:Error:Failed to resolve: com.android.support:support-v4:27.0.1
Install Repository and sync project
    Error:Error:Failed to resolve: com.android.support:support-core-utils:27.0.1
Install Repository and sync project

build.gradle  (app)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.avtro.prokriti.prokriti"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true

    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:cardview-v7:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support:support-core-utils:25.3.1'
    compile 'com.android.support:support-annotations:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.android.gms:play-services-auth:11.0.4'
    compile 'com.google.firebase:firebase-core:11.0.2'
    compile 'com.google.firebase:firebase-messaging:11.0.2'
    compile 'com.google.firebase:firebase-database:11.0.2'
    compile 'com.google.firebase:firebase-auth:11.0.2'
    compile 'com.google.firebase:firebase-ads:11.0.2'
    compile 'com.afollestad.material-dialogs:core:0.9.4.5'
    compile 'com.wang.avi:library:2.1.3'
    compile 'com.google.android.gms:play-services-ads:11.0.4'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.survivingwithandroid:weatherlib:1.6.0'
    compile 'com.amitshekhar.android:android-networking:1.0.0'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.squareup.okhttp:okhttp:2.0.0'
    compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    compile 'com.google.firebase:firebase-storage:11.0.2'
    androidTestCompile 'junit:junit:4.12'
    compile 'javax.inject:javax.inject:1'
    compile 'com.android.support:support-v4:25.3.1'
    compile 'com.github.bumptech.glide:glide:3.8.0'
}
apply plugin: 'com.google.gms.google-services'

build.gradle  (project)

buildscript {
    repositories {
        jcenter()
    }
dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.google.gms:google-services:3.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

i didnt update android studio or gradle. Android support repository is installed.


来源: stackexchange

问:
C++ conversion from unsigned char to std::string
Intro: Consider that I have no experience with C++, but can find my way around any language to do basic tasks.
Most of my experience is with .net languages (vn.net and C#), php and js, so please explain as if you were teaching a complete noob.

Here is the problem: I receive data in an unsigned char characters[12]; and I have to then append that data to a std::string

data is always 12 characters long, and is not null terminated, because it is gathered by selecting specific bytes received from serial port.

Long story short:

```<code>std::string stroutput = "some text ";
unsigned char characters[12];
characters[0]=64; //demo data to shorten the code
characters[1]=72;
stroutput.append(characters[0]);
stroutput.append(characters[1]);
....
</code>```

The result i want is to have the string value

```<code>some text @H...
</code>```

But what i get is an error while compiling

```<code>error: invalid conversion from ‘unsigned char’ to ‘const char*’ [-fpermissive]
stroutput.append(characters[0]);
                 ~~~~~~~~~~~~^
</code>```

Logic behind this thinking is that output of:

```<code>printf("%c%c",characters[0],characters[1]);
</code>```

and

```<code>std::cout << characters[0] << characters[0] << std::endl;
</code>```

results in

```<code>@H
</code>```

So: How do I convert unsigned char something[12] to std::string?

Thanks

Edit: Sorry for the duplicate, search didn't return that question.
Thanks everyone - too bad I can't mark multiple answers!

答:
You almost had it, just use string::push_back instead of string::append - append is for concatenating strings, whereas push_back is for adding characters (and deals with resizing the internals etc).

Using a string constructor is normally a better option but here could cause issues as your array isn't null-terminated (see here).

Edit: Actually, constructor 5 from the link above (from-sequence) should be suitable (if you're willing to cast from unsigned char * to const char *, which is safe according to this question+answer):

```<code>std::string stroutput(reinterpret_cast<const char *>(characters), 12);
</code>```

ContentLicense: CC BY-SA 3.0

Body:
Intro: Consider that I have no experience with C++, but can find my way around any language to do basic tasks.
Most of my experience is with .net languages (vn.net and C#), php and js, so please explain as if you were teaching a complete noob.

Here is the problem: I receive data in an unsigned char characters[12]; and I have to then append that data to a std::string

data is always 12 characters long, and is not null terminated, because it is gathered by selecting specific bytes received from serial port.

Long story short:

std::string stroutput = "some text ";
unsigned char characters[12];
characters[0]=64; //demo data to shorten the code
characters[1]=72;
stroutput.append(characters[0]);
stroutput.append(characters[1]);
....

The result i want is to have the string value

some text @H...

But what i get is an error while compiling

error: invalid conversion from ‘unsigned char’ to ‘const char*’ [-fpermissive]
stroutput.append(characters[0]);
                 ~~~~~~~~~~~~^

Logic behind this thinking is that output of:

printf("%c%c",characters[0],characters[1]);

and

std::cout << characters[0] << characters[0] << std::endl;

results in

@H

So: How do I convert unsigned char something[12] to std::string?

Thanks

Edit: Sorry for the duplicate, search didn't return that question.
Thanks everyone - too bad I can't mark multiple answers!

Body:
You almost had it, just use string::push_back instead of string::append - append is for concatenating strings, whereas push_back is for adding characters (and deals with resizing the internals etc).

Using a string constructor is normally a better option but here could cause issues as your array isn't null-terminated (see here).

Edit: Actually, constructor 5 from the link above (from-sequence) should be suitable (if you're willing to cast from unsigned char * to const char *, which is safe according to this question+answer):

std::string stroutput(reinterpret_cast<const char *>(characters), 12);


问:
Big white Space on the right side On Screen Size 767px and Below Bootstrap responsive
I'm having some issues with a bootstrap responsive screen size, for some reason when the window is smaller than 767px there is around 30px or larger  padding on the right and I have no idea how to get rid of it. if screen size is smaller, the white bar in the right size is bigger. Could you please give me a hand?
Here is a link for files

Here's a screenshot
Bootstrap.responsive

```<code>@media(max-width:767px) {
  body {
    padding-right: 20px;
    padding-left: 20px;
  }
  .navbar-fixed-top,
  .navbar-fixed-bottom,
  .navbar-static-top {
    margin-right: -20px;
    margin-left: -20px;
  }
  .container-fluid {
    padding: 0
  }
  .dl-horizontal dt {
    float: none;
    width: auto;
    clear: none;
    text-align: left
  }
  .dl-horizontal dd {
    margin-left: 0
  }
  .container {
    width: auto
  }
  .row-fluid {
    width: 100%
  }
  .row,
  .thumbnails {
    margin-left: 0
  }
  .thumbnails>li {
    float: none;
    margin-left: 0
  }
  [class*="span"],
  .uneditable-input[class*="span"],
  .row-fluid [class*="span"] {
    display: block;
    float: none;
    width: 100%;
    margin-left: 0;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box
  }
  .span12,
  .row-fluid .span12 {
    width: 100%;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box
  }
  .row-fluid [class*="offset"]:first-child {
    margin-left: 0
  }
  .input-large,
  .input-xlarge,
  .input-xxlarge,
  input[class*="span"],
  select[class*="span"],
  textarea[class*="span"],
  .uneditable-input {
    display: block;
    width: 100%;
    min-height: 30px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box
  }
  .input-prepend input,
  .input-append input,
  .input-prepend input[class*="span"],
  .input-append input[class*="span"] {
    display: inline-block;
    width: auto
  }
  .controls-row [class*="span"]+[class*="span"] {
    margin-left: 0
  }
  .modal {
    position: fixed;
    top: 20px;
    right: 20px;
    left: 20px;
    width: auto;
    margin: 0
  }
  .modal.fade {
    top: -100px
  }
  .modal.fade.in {
    top: 20px
  }
}

@media(max-width:480px) {
  .nav-collapse {
    -webkit-transform: translate3d(0, 0, 0)
  }
  .page-header h1 small {
    display: block;
    line-height: 20px
  }
  input[type="checkbox"],
  input[type="radio"] {
    border: 1px solid #ccc
  }
  .form-horizontal .control-label {
    float: none;
    width: auto;
    padding-top: 0;
    text-align: left
  }
  .form-horizontal .controls {
    margin-left: 0
  }
  .form-horizontal .control-list {
    padding-top: 0
  }
  .form-horizontal .form-actions {
    padding-right: 10px;
    padding-left: 10px
  }
  .media .pull-left,
  .media .pull-right {
    display: block;
    float: none;
    margin-bottom: 10px
  }
  .media-object {
    margin-right: 0;
    margin-left: 0
  }
  .modal {
    top: 10px;
    right: 10px;
    left: 10px
  }
  .modal-header .close {
    padding: 10px;
    margin: -10px
  }
  .carousel-caption {
    position: static
  }
}
</code>```

Main.CSS

@import url(http://fonts.googleapis.com/css?family=Fjalla+One);
.clearfix{*zoom:1}
.clearfix:before,
.clearfix:after{
 display:table;
 content:"";
 line-height:0
 }
.clearfix:after{
 clear:both
 }
.hide-text{
 font:0/0 a;
 color:transparent;
 text-shadow:none;
 background-color:transparent;
 border:0
 }
.input-block-level{
 display:block;
 width:100%;
 min-height:30px;
 -webkit-box-sizing:border-box;
 -moz-box-sizing:border-box;
 box-sizing:border-box
 }

body{
 padding-top:80px;
 font-size:12px;
 color:#34495e;
 background:#f5f5f5
 width:100%;
}
body h1,body h2,body h3,body h4,body
.created{
 font-family:"Fjalla One";
 font-weight:normal
 }
body h5{margin:0}
body h3,body h4{margin-top:0}
body h6{margin:0;font-family:"roboto_thregular"; font-size: "24px"}
body
.btn{
 -webkit-border-radius:0;
 -moz-border-radius:0;
 border-radius:0;
 border:0;
 background-image:none;
 text-shadow:none;
 -webkit-box-shadow:none;
 -moz-box-shadow:none;
 box-shadow:none
 }
 .btn.btn-transparent{
  border:3px solid #fff;
  background:transparent;
  color:#fff
  }
 .btn.btn-transparent:hover{ border-color:rgba(255,255,255,0.5)}
 .btn.btn-link{color:#bb0300;padding:0}
 .btn.btn-link:hover{text-decoration:none}
 .btn-primary{background-color:#bb0300}
 .btn-primary:hover{background-color:#ff0200}
 a{color:#bb0300;-webkit-transition:300ms;-moz-transition:300ms;-o-transition:300ms;transition:300ms}
 a:hover,
 a:focus{color:#ff0200;text-decoration:none;outline:0}
 .dropdown-menu{margin-top:-1px;min-width:180px; color:#bb0300 }
 body>section{padding:5px 0}
 body>section
 #slide-show{padding:0}
 #recent-works{background:#bb0300;color:#fff}
 #recent-works .links>a{background:#fff;color:#bb0300;text-shadow:none}
 #clients{background:#fff}
 #clients h4{color:#999}
 #clients .carousel{margin-bottom:0}
 #clients .clients ul.thumbnails{margin:0}
 #clients .clients ul.thumbnails>li{text-align:center;margin-bottom:0}
 #clients .prev,
 #clients .next{color:#999}
 .title{background:#bb0000;color:#fff;padding:20px 0}
 .center{text-align:center}
 .box{
  background-color:#fff;
  border-top:1px solid #f0f0f0;
  -webkit-box-shadow:0 1px 2px 0 rgba(0,0,0,0.1);
  box-shadow:0 1px 2px 0 rgba(0,0,0,0.1);
  padding:10px;
  -webkit-border-radius:4px;
  -moz-border-radius:4px;
  border-radius:4px
  }
 .progress{margin-bottom:10px}
 .progress,.progress .bar{
  -webkit-border-radius:0;
  -moz-border-radius:0;
  border-radius:0;
  background-image:none;
  -webkit-box-shadow:none;
  -moz-box-shadow:none;
  box-shadow:none;
  text-shadow:none;
  height:30px;
  line-height:30px
  }
 .label,.badge{font-weight:300;font-size:90%}
 ul.breadcrumb{margin:12px 0 0;background:transparent}
 ul.breadcrumb>li{text-shadow:none}
 ul.breadcrumb>li>a,ul.breadcrumb>li .divider{color:#fff}
 ul.breadcrumb>li.active{color:rgba(255,255,255,0.7)}
 ul.tag-cloud li{display:inline-block;margin:0 0 2px 0}
 .btn-social{border:0;color:#fff;text-shadow:0 1px rgba(0,0,0,0.5)}
 .btn-social.btn-facebook{background:#4f7dd4}
 .btn-social.btn-facebook:hover{background:#789bde}
 .btn-social.btn-twitter{background:#5bceff}
 .btn-social.btn-twitter:hover{background:#8eddff}
 .btn-social.btn-linkedin{background:#21a6d8}
 .btn-social.btn-linkedin:hover{background:#49b9e3}
 .btn-social.btn-google-plus{background:#dc422b}
 .btn-social.btn-google-plus:hover{background:#e36957}
 .btn-social:hover{color:#fff}
 header.navbar .navbar-inner{
  background:#fff!important;
  border:0;
  -webkit-box-shadow:none;
  -moz-box-shadow:none;
  box-shadow:none
  }
 header #logo{
  width:435px;
  height:80px;
  background:url(../images/logo/trlogo.png) no-repeat 0 50%
  }
 header.navbar{
  margin-bottom:0
  }
 header.navbar .nav{ margin-top:20px}
 header.navbar .nav>li{margin-left:1px}
 header.navbar .nav>li>a{
  padding-top:10px;
  padding-bottom:10px;
  color:#333;
  font-family:"Fjalla One";
  font-size:14px;
  text-transform:uppercase;
  text-shadow:none
  }
  header.navbar .nav>li>a:hover{
   background:transparent;
   color:#bb0300;
   -webkit-box-shadow:none;
   -moz-box-shadow:none;
   box-shadow:none
   }
  header.navbar .nav>li.active>a,header.navbar .nav>li.active>a:hover{
   background:transparent;
   color:#bb0300;
   -webkit-box-shadow:none;
   -moz-box-shadow:none;
   box-shadow:none
   }
  header.navbar .nav>li.dropdown.open>a.dropdown-toggle{
   background:transparent;
   color:#bb0300
   }
  header.navbar .nav>li.login>a{ border-left:1px solid #e5e5e5 }
  header .dropdown-menu{margin-top:20px; color:#bb0300 }
  header .dropdown-menu:before{display:none!important}
  .navbar .nav li.dropdown.open>.dropdown-toggle,.navbar .nav li.dropdown.active>.dropdown-toggle,.navbar .nav li.dropdown.open.active>.dropdown-toggle{
   background-color:transparent;
   color:#bb0300
   }
  .navbar .nav>.active>a,.navbar .nav>.active>a:hover,.navbar .nav>.active>a:focus{
   -webkit-box-shadow:none;
   -moz-box-shadow:none;
   box-shadow:none
   }
  .navbar .nav>li>a:focus,.navbar .nav>li>a:hover{color:#bb0300}
  .dropdown-menu{-webkit-border-radius:0;-moz-border-radius:0; border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;padding:0;border:0}
  .dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus,.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus,.dropdown-submenu:hover>a,.dropdown-submenu:focus>a{
   background:#bb0300
   }
   .main-info{
    background-color:#fff;
    color:#3a3a3a
   }.main-info h4{
    color:#706f6f
   }
   .icon-medium{
    font-size:18px;
    width:18px;
    line-height:18px;
    text-align:center;
    display:inline-block;
    background:#db2323;
    padding:10px;
    -webkit-border-radius:100%;
    -moz-border-radius:100%;
    border-radius:100%;
    color:#fff
    }
   .modal{border:0}
   .modal#loginForm{width:600px;margin-left:-300px}
   .modal .modal-header{border:0;padding:20px 20px 0}
   .modal .modal-header>h4{font-weight:300;font-size:14px;color:#848484;text-transform:uppercase;margin:0}
   .modal .modal-body{padding:20px}
   .modal input[type="text"],.modal input[type="password"]{padding:5px 10px;min-height:30px;width:130px;margin-right:10px}
   .modal .icon-remove{
    color:#848484;
    position:absolute;
    right:-5px;
    top:-5px;
    width:16px;
    height:16px;
    line-height:16px;
    text-align:center;
    display:block;
    background:#ebebeb;
    -webkit-border-radius:100%;
    -moz-border-radius:100%;
    border-radius:100%;
    cursor:pointer
    }
    .modal button{margin-left:10px;border:0}
    .gap{margin-bottom:50px}
    .big-gap{margin-bottom:100px}
    .no-margin{margin:0;padding:0}
    #services{background:#252525;color:#999}
    #services h1,#services h2,#services h3,#services h4,#services h5,#services h6{color:#fff}
    #main-contents{margin-top:20px}
    #main-contents .blog-news .created{font-size:18px;color:#2dcc70}
    .registration-form{
     border:0;
     background-color:#fff;
     border-top:1px solid #f0f0f0;
     -webkit-box-shadow:0 1px 2px 0 rgba(0,0,0,0.1);
     -moz-box-shadow:0 1px 2px 0 rgba(0,0,0,0.1);
     box-shadow:0 1px 2px 0 rgba(0,0,0,0.1);
     padding:20px;
     display:inline-block}#bottom{background:#000000;
     color:#6f6f6f
     }
     #bottom h4{margin-top:0;margin-bottom:15px}
     #bottom h1,#bottom h2,#bottom h3,#bottom h4,#bottom h5,#bottom h6{color:#fff}
     #bottom a{color:#6f6f6f}
     #bottom a:hover{color:#2dcc70}
     #bottom ul.address>li{position:relative;padding-left:20px;margin-top:10px}
     #bottom ul.address>li:first-child{margin-top:0}
     #bottom ul.address>li>i{position:absolute;top:3px;left:0}
     #bottom ul.thumbnails{margin-bottom:0}
     #bottom ul.thumbnails li{
      margin-bottom:5px;
      }
      ul.arrow,ul.arrow-double,ul.tick,ul.cross,ul.star,ul.rss{
       list-style:none;padding:0;margin:0;
      }
      ul.arrow li::before,ul.arrow-double li::before,ul.tick li::before,ul.cross li::before,ul.star li::before,ul.rss li::before,ul.arrow li::after,ul.arrow-double li::after,ul.tick li::after,ul.cross li::after,ul.star li::after,ul.rss
      li::after{
       font-family:FontAwesome;
       font-size:11px;
       }
      ul.arrow li::before,ul.arrow-double li::before,ul.tick li::before,ul.cross li::before,ul.star li::before,ul.rss li::before{margin-right:5px}
      ul.arrow li::before{content:"\f105"}
      ul.arrow-double li::before{content:"\f101"}
      ul.tick li::before{content:"\f00c"}
      ul.cross li::before{content:"\f00d"}
      ul.star li::before{content:"\f006"}
      ul.rss li::before{content:"\f09e"}
      #footer{
       background:#333;
       padding-top:15px;
       padding-bottom:15px;
       color:#666;
      }
      #footer a{color:#666}
      #footer a:hover{color:#ef0909}
      #footer #gototop{height:40px;
      line-height:40px;
      width:40px;
      text-align:center;
      display:inline-block;
      background:#1d1d1d;
      font-size:24px;
      color:#fff;
      }
      #footer #gototop:hover{
       background:#bb0000;
       text-decoration:none;
      }
      #footer .cp{
       margin-top:11px;
       }
      ul.social{
       list-style:none;
       margin:10px 0 0;
       padding:0;
       display:inline-block;
      }
      ul.social>li{
       display:inline-block;
       margin:0 5px;
      }
      ul.social>li>a{
       font-size:24px;
       color:#666;
      }
      ul.social>li>a:hover{
       color:#999;
      }.box-border{
       padding:15px;
      }.accordion-group{
       background-color:#fff;
       border-top:1px solid #f0f0f0;
      }.accordion-heading .accordion-toggle{
      color:#666;
      font-weight:700;
      }
      .accordion-inner{border-top:0}
      .blog .blog-item h2{margin-top:0}
      .blog .blog-item .date span{display:block;text-align:center}
      .blog .blog-item .date span.day{
       font-size:50px;
       line-height:50px;
       padding-top:10px;
       font-family:"Fjalla One",sans-serif;
      }
      .blog .blog-item .date span.month{font-size:18px}
      .blog .blog-item .tag{margin-top:5px}
      .blog .blog-item .avatar{margin-top:5px}
      select,textarea,input[type="text"],
      input[type="password"],
      input[type="datetime"],
      input[type="datetime-local"],
      input[type="date"],
      input[type="month"],
      input[type="time"],
      input[type="week"],
      input[type="number"],
      input[type="email"],
      input[type="url"],
      input[type="search"],
      input[type="tel"],
      input[type="color"],
      .uneditable-input{-webkit-border-radius:3px;
       -moz-border-radius:3px;
       border-radius:3px;
       -webkit-box-shadow:none;
       -moz-box-shadow:none;
       box-shadow:none;
       min-height:50px;
       padding:0 15px;
       border:3px solid #ededed
      }
      select:focus,textarea:focus,
      input[type="text"]:focus,
      input[type="password"]:focus,
      input[type="datetime"]:focus,
      input[type="datetime-local"]:focus,
      input[type="date"]:focus,
      input[type="month"]:focus,
      input[type="time"]:focus,
      input[type="week"]:focus,
      input[type="number"]:focus,
      input[type="email"]:focus,
      input[type="url"]:focus,
      input[type="search"]:focus,
      input[type="tel"]:focus,
      input[type="color"]:focus,
      .uneditable-input:focus{
       border-color:#2dcc70;
       -webkit-box-shadow:none;
       -moz-box-shadow:none;
       box-shadow:none;
      }
      .input-block-level{
       min-height:50px;
      }
      textarea#message{
       padding:10px 15px;
       height:305px;
      }
      .widget{
       margin-bottom:30px;
      }
      .widget>h3{
       font-size:16px;
       margin-top:0;
      }
      .widget h5{
       margin-top:10px;
      }.widget .date{
       margin-top:5px;
       padding:8px 10px;
       background:#2dcc70;
      }.widget .date>span{
       display:block;
       text-align:center;
       font-family:"Fjalla One";
       color:#fff;
      }.widget .date>span.month{
       font-size:14px;
       line-height:14px;
       font-weight:700;
       text-transform:uppercase;
      }.widget .date>span.day{
       font-size:18px;
       line-height:18px;
      }#pricing-table{
       margin-top:20px;
       margin-bottom:30px;
      }#pricing-table .plan{
       list-style:none;
       margin:0;
       padding:0;
       color:#fff;
      }#pricing-table .plan.featured{
       -webkit-transform:scale(1.1);
       -moz-transform:scale(1.1);
       -ms-transform:scale(1.1);
       -o-transform:scale(1.1);
       transform:scale(1.1);
      }
      #pricing-table .plan>li{padding:10px 15px}
      #pricing-table .plan>li.plan-name{background:rgba(0,0,0,0.1)}
      #pricing-table .plan>li.plan-name h3{margin:10px 0}
      #pricing-table .plan>li.plan-action{padding:20px 0}
      #pricing-table .plan1{background:#1abc9c}
      #pricing-table .plan2{background:#e74c3c}
      #pricing-table .plan3{background:#3498db}
      #pricing-table .plan4{background:#9b59b6}
      ul.gallery{display:block;margin:-15px}
      ul.gallery.col-1 li{width:100%}
      ul.gallery.col-2 li{width:50%}
      ul.gallery.col-3 li{width:33.3333%}
      ul.gallery.col-4 li{width:25%}
      ul.gallery li{display:block;padding:0;margin:0;float:left}
      ul.gallery li .desc{margin:15px}
      ul.gallery li .preview{margin:15px;display:block;position:relative}
      ul.gallery li .preview .overlay{
       width:100%;
       height:100%;
       position:absolute;
       left:0;top:0;
       background:rgba(0,0,0,0.6);
       opacity:0;
       filter:alpha(opacity=0);
       -webkit-transition:opacity 300ms;
       -moz-transition:opacity 300ms;
       -o-transition:opacity 300ms;
       transition:opacity 300ms;
      }
      ul.gallery li .preview modal-bodyinks{
       width:104px;
       height:40px;
       position:absolute;
       top:50%;
       left:50%;
       margin-top:-20px;
       margin-left:-52px;
       opacity:0;
       filter:alpha(opacity=0);
       -webkit-transform:translate(0,-50px);
       -moz-transform:translate(0,-50px);
       -ms-transform:translate(0,-50px);
       -o-transform:translate(0,-50px);
       transform:translate(0,-50px);
       -webkit-transition:300ms;
       -moz-transition:300ms;
       -o-transition:300ms;
       transition:300ms
      }
      ul.gallery li .preview .links>a{
       width:50px;
       height:40px;
       line-height:40px;
       display:inline-block;
       text-align:center;
       background:#2dcc70;
       color:#fff;
       text-shadow:0 1px rgba(0,0,0,0.3);
       font-size:18px;
       margin:0 1px;
      }
      ul.gallery li .preview:hover .overlay,ul.gallery li .preview:hover .links{
       opacity:1;
       filter:alpha(opacity=100)
      }
      ul.gallery li .preview:hover .links{
       -webkit-transform:translate(0,0);
       -moz-transform:translate(0,0);
       -ms-transform:translate(0,0);
       -o-transform:translate(0,0);
       transform:translate(0,0);
      }
      ul.faq{
       list-style:none;
       margin:0;
      }
      ul.faq li{
       margin-top:30px;
      }
      ul.faq li:first-child{margin-top:0}
      ul.faq li span.number{
       display:block;
       float:left;
       width:50px;
       height:50px;
       line-height:50px;
       text-align:center;
       background:#bb0300;
       color:#fff;font-size:24px;
      }ul.faq li>div{margin-left:70px}ul.faq li>div h3{margin-top:0}#error{text-align:center;margin-top:150px;margin-bottom:150px}
  #mapSection, #carouselSection{border-top:0px solid #BB0000; border-bottom: 0px; background: #bb0300; color:#fff}

  .container1{width:1170px; margin-right:0px; }
  .input-block-level1{
 display:block;
 width:100%;
 min-height:30px;
 -webkit-box-sizing:border-box;
 -moz-box-sizing:border-box;
 box-sizing:border-box
 }
  .input-block-level1{min-height:50px}textarea#message1 { padding:10px 15px; height:220px}```

答:
The code snippet isn't working - you'd need to add the html to have help debugging this specific case.

However, the key to solving this problem (and others like it - they will come up all the time if you're working with HTML/CSS) will be in learning how to debug the HTML/CSS for yourself - the best approach will be to learn how to use 'inspect element' or 'Firefox Developer Browser' with Firefox or 'chrome-devtools' in Chrome. Some articles to help:

https://developers.google.com/web/tools/chrome-devtools/inspect-styles/

https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector

Body:
I'm having some issues with a bootstrap responsive screen size, for some reason when the window is smaller than 767px there is around 30px or larger  padding on the right and I have no idea how to get rid of it. if screen size is smaller, the white bar in the right size is bigger. Could you please give me a hand?
Here is a link for files

Here's a screenshot
Bootstrap.responsive

@media(max-width:767px) {
  body {
    padding-right: 20px;
    padding-left: 20px;
  }
  .navbar-fixed-top,
  .navbar-fixed-bottom,
  .navbar-static-top {
    margin-right: -20px;
    margin-left: -20px;
  }
  .container-fluid {
    padding: 0
  }
  .dl-horizontal dt {
    float: none;
    width: auto;
    clear: none;
    text-align: left
  }
  .dl-horizontal dd {
    margin-left: 0
  }
  .container {
    width: auto
  }
  .row-fluid {
    width: 100%
  }
  .row,
  .thumbnails {
    margin-left: 0
  }
  .thumbnails>li {
    float: none;
    margin-left: 0
  }
  [class*="span"],
  .uneditable-input[class*="span"],
  .row-fluid [class*="span"] {
    display: block;
    float: none;
    width: 100%;
    margin-left: 0;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box
  }
  .span12,
  .row-fluid .span12 {
    width: 100%;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box
  }
  .row-fluid [class*="offset"]:first-child {
    margin-left: 0
  }
  .input-large,
  .input-xlarge,
  .input-xxlarge,
  input[class*="span"],
  select[class*="span"],
  textarea[class*="span"],
  .uneditable-input {
    display: block;
    width: 100%;
    min-height: 30px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box
  }
  .input-prepend input,
  .input-append input,
  .input-prepend input[class*="span"],
  .input-append input[class*="span"] {
    display: inline-block;
    width: auto
  }
  .controls-row [class*="span"]+[class*="span"] {
    margin-left: 0
  }
  .modal {
    position: fixed;
    top: 20px;
    right: 20px;
    left: 20px;
    width: auto;
    margin: 0
  }
  .modal.fade {
    top: -100px
  }
  .modal.fade.in {
    top: 20px
  }
}

@media(max-width:480px) {
  .nav-collapse {
    -webkit-transform: translate3d(0, 0, 0)
  }
  .page-header h1 small {
    display: block;
    line-height: 20px
  }
  input[type="checkbox"],
  input[type="radio"] {
    border: 1px solid #ccc
  }
  .form-horizontal .control-label {
    float: none;
    width: auto;
    padding-top: 0;
    text-align: left
  }
  .form-horizontal .controls {
    margin-left: 0
  }
  .form-horizontal .control-list {
    padding-top: 0
  }
  .form-horizontal .form-actions {
    padding-right: 10px;
    padding-left: 10px
  }
  .media .pull-left,
  .media .pull-right {
    display: block;
    float: none;
    margin-bottom: 10px
  }
  .media-object {
    margin-right: 0;
    margin-left: 0
  }
  .modal {
    top: 10px;
    right: 10px;
    left: 10px
  }
  .modal-header .close {
    padding: 10px;
    margin: -10px
  }
  .carousel-caption {
    position: static
  }
}

Main.CSS

@import url(http://fonts.googleapis.com/css?family=Fjalla+One);
.clearfix{*zoom:1}
.clearfix:before,
.clearfix:after{
 display:table;
 content:"";
 line-height:0
 }
.clearfix:after{
 clear:both
 }
.hide-text{
 font:0/0 a;
 color:transparent;
 text-shadow:none;
 background-color:transparent;
 border:0
 }
.input-block-level{
 display:block;
 width:100%;
 min-height:30px;
 -webkit-box-sizing:border-box;
 -moz-box-sizing:border-box;
 box-sizing:border-box
 }

body{
 padding-top:80px;
 font-size:12px;
 color:#34495e;
 background:#f5f5f5
 width:100%;
}
body h1,body h2,body h3,body h4,body
.created{
 font-family:"Fjalla One";
 font-weight:normal
 }
body h5{margin:0}
body h3,body h4{margin-top:0}
body h6{margin:0;font-family:"roboto_thregular"; font-size: "24px"}
body
.btn{
 -webkit-border-radius:0;
 -moz-border-radius:0;
 border-radius:0;
 border:0;
 background-image:none;
 text-shadow:none;
 -webkit-box-shadow:none;
 -moz-box-shadow:none;
 box-shadow:none
 }
 .btn.btn-transparent{
  border:3px solid #fff;
  background:transparent;
  color:#fff
  }
 .btn.btn-transparent:hover{ border-color:rgba(255,255,255,0.5)}
 .btn.btn-link{color:#bb0300;padding:0}
 .btn.btn-link:hover{text-decoration:none}
 .btn-primary{background-color:#bb0300}
 .btn-primary:hover{background-color:#ff0200}
 a{color:#bb0300;-webkit-transition:300ms;-moz-transition:300ms;-o-transition:300ms;transition:300ms}
 a:hover,
 a:focus{color:#ff0200;text-decoration:none;outline:0}
 .dropdown-menu{margin-top:-1px;min-width:180px; color:#bb0300 }
 body>section{padding:5px 0}
 body>section
 #slide-show{padding:0}
 #recent-works{background:#bb0300;color:#fff}
 #recent-works .links>a{background:#fff;color:#bb0300;text-shadow:none}
 #clients{background:#fff}
 #clients h4{color:#999}
 #clients .carousel{margin-bottom:0}
 #clients .clients ul.thumbnails{margin:0}
 #clients .clients ul.thumbnails>li{text-align:center;margin-bottom:0}
 #clients .prev,
 #clients .next{color:#999}
 .title{background:#bb0000;color:#fff;padding:20px 0}
 .center{text-align:center}
 .box{
  background-color:#fff;
  border-top:1px solid #f0f0f0;
  -webkit-box-shadow:0 1px 2px 0 rgba(0,0,0,0.1);
  box-shadow:0 1px 2px 0 rgba(0,0,0,0.1);
  padding:10px;
  -webkit-border-radius:4px;
  -moz-border-radius:4px;
  border-radius:4px
  }
 .progress{margin-bottom:10px}
 .progress,.progress .bar{
  -webkit-border-radius:0;
  -moz-border-radius:0;
  border-radius:0;
  background-image:none;
  -webkit-box-shadow:none;
  -moz-box-shadow:none;
  box-shadow:none;
  text-shadow:none;
  height:30px;
  line-height:30px
  }
 .label,.badge{font-weight:300;font-size:90%}
 ul.breadcrumb{margin:12px 0 0;background:transparent}
 ul.breadcrumb>li{text-shadow:none}
 ul.breadcrumb>li>a,ul.breadcrumb>li .divider{color:#fff}
 ul.breadcrumb>li.active{color:rgba(255,255,255,0.7)}
 ul.tag-cloud li{display:inline-block;margin:0 0 2px 0}
 .btn-social{border:0;color:#fff;text-shadow:0 1px rgba(0,0,0,0.5)}
 .btn-social.btn-facebook{background:#4f7dd4}
 .btn-social.btn-facebook:hover{background:#789bde}
 .btn-social.btn-twitter{background:#5bceff}
 .btn-social.btn-twitter:hover{background:#8eddff}
 .btn-social.btn-linkedin{background:#21a6d8}
 .btn-social.btn-linkedin:hover{background:#49b9e3}
 .btn-social.btn-google-plus{background:#dc422b}
 .btn-social.btn-google-plus:hover{background:#e36957}
 .btn-social:hover{color:#fff}
 header.navbar .navbar-inner{
  background:#fff!important;
  border:0;
  -webkit-box-shadow:none;
  -moz-box-shadow:none;
  box-shadow:none
  }
 header #logo{
  width:435px;
  height:80px;
  background:url(../images/logo/trlogo.png) no-repeat 0 50%
  }
 header.navbar{
  margin-bottom:0
  }
 header.navbar .nav{ margin-top:20px}
 header.navbar .nav>li{margin-left:1px}
 header.navbar .nav>li>a{
  padding-top:10px;
  padding-bottom:10px;
  color:#333;
  font-family:"Fjalla One";
  font-size:14px;
  text-transform:uppercase;
  text-shadow:none
  }
  header.navbar .nav>li>a:hover{
   background:transparent;
   color:#bb0300;
   -webkit-box-shadow:none;
   -moz-box-shadow:none;
   box-shadow:none
   }
  header.navbar .nav>li.active>a,header.navbar .nav>li.active>a:hover{
   background:transparent;
   color:#bb0300;
   -webkit-box-shadow:none;
   -moz-box-shadow:none;
   box-shadow:none
   }
  header.navbar .nav>li.dropdown.open>a.dropdown-toggle{
   background:transparent;
   color:#bb0300
   }
  header.navbar .nav>li.login>a{ border-left:1px solid #e5e5e5 }
  header .dropdown-menu{margin-top:20px; color:#bb0300 }
  header .dropdown-menu:before{display:none!important}
  .navbar .nav li.dropdown.open>.dropdown-toggle,.navbar .nav li.dropdown.active>.dropdown-toggle,.navbar .nav li.dropdown.open.active>.dropdown-toggle{
   background-color:transparent;
   color:#bb0300
   }
  .navbar .nav>.active>a,.navbar .nav>.active>a:hover,.navbar .nav>.active>a:focus{
   -webkit-box-shadow:none;
   -moz-box-shadow:none;
   box-shadow:none
   }
  .navbar .nav>li>a:focus,.navbar .nav>li>a:hover{color:#bb0300}
  .dropdown-menu{-webkit-border-radius:0;-moz-border-radius:0; border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;padding:0;border:0}
  .dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus,.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus,.dropdown-submenu:hover>a,.dropdown-submenu:focus>a{
   background:#bb0300
   }
   .main-info{
    background-color:#fff;
    color:#3a3a3a
   }.main-info h4{
    color:#706f6f
   }
   .icon-medium{
    font-size:18px;
    width:18px;
    line-height:18px;
    text-align:center;
    display:inline-block;
    background:#db2323;
    padding:10px;
    -webkit-border-radius:100%;
    -moz-border-radius:100%;
    border-radius:100%;
    color:#fff
    }
   .modal{border:0}
   .modal#loginForm{width:600px;margin-left:-300px}
   .modal .modal-header{border:0;padding:20px 20px 0}
   .modal .modal-header>h4{font-weight:300;font-size:14px;color:#848484;text-transform:uppercase;margin:0}
   .modal .modal-body{padding:20px}
   .modal input[type="text"],.modal input[type="password"]{padding:5px 10px;min-height:30px;width:130px;margin-right:10px}
   .modal .icon-remove{
    color:#848484;
    position:absolute;
    right:-5px;
    top:-5px;
    width:16px;
    height:16px;
    line-height:16px;
    text-align:center;
    display:block;
    background:#ebebeb;
    -webkit-border-radius:100%;
    -moz-border-radius:100%;
    border-radius:100%;
    cursor:pointer
    }
    .modal button{margin-left:10px;border:0}
    .gap{margin-bottom:50px}
    .big-gap{margin-bottom:100px}
    .no-margin{margin:0;padding:0}
    #services{background:#252525;color:#999}
    #services h1,#services h2,#services h3,#services h4,#services h5,#services h6{color:#fff}
    #main-contents{margin-top:20px}
    #main-contents .blog-news .created{font-size:18px;color:#2dcc70}
    .registration-form{
     border:0;
     background-color:#fff;
     border-top:1px solid #f0f0f0;
     -webkit-box-shadow:0 1px 2px 0 rgba(0,0,0,0.1);
     -moz-box-shadow:0 1px 2px 0 rgba(0,0,0,0.1);
     box-shadow:0 1px 2px 0 rgba(0,0,0,0.1);
     padding:20px;
     display:inline-block}#bottom{background:#000000;
     color:#6f6f6f
     }
     #bottom h4{margin-top:0;margin-bottom:15px}
     #bottom h1,#bottom h2,#bottom h3,#bottom h4,#bottom h5,#bottom h6{color:#fff}
     #bottom a{color:#6f6f6f}
     #bottom a:hover{color:#2dcc70}
     #bottom ul.address>li{position:relative;padding-left:20px;margin-top:10px}
     #bottom ul.address>li:first-child{margin-top:0}
     #bottom ul.address>li>i{position:absolute;top:3px;left:0}
     #bottom ul.thumbnails{margin-bottom:0}
     #bottom ul.thumbnails li{
      margin-bottom:5px;
      }
      ul.arrow,ul.arrow-double,ul.tick,ul.cross,ul.star,ul.rss{
       list-style:none;padding:0;margin:0;
      }
      ul.arrow li::before,ul.arrow-double li::before,ul.tick li::before,ul.cross li::before,ul.star li::before,ul.rss li::before,ul.arrow li::after,ul.arrow-double li::after,ul.tick li::after,ul.cross li::after,ul.star li::after,ul.rss
      li::after{
       font-family:FontAwesome;
       font-size:11px;
       }
      ul.arrow li::before,ul.arrow-double li::before,ul.tick li::before,ul.cross li::before,ul.star li::before,ul.rss li::before{margin-right:5px}
      ul.arrow li::before{content:"\f105"}
      ul.arrow-double li::before{content:"\f101"}
      ul.tick li::before{content:"\f00c"}
      ul.cross li::before{content:"\f00d"}
      ul.star li::before{content:"\f006"}
      ul.rss li::before{content:"\f09e"}
      #footer{
       background:#333;
       padding-top:15px;
       padding-bottom:15px;
       color:#666;
      }
      #footer a{color:#666}
      #footer a:hover{color:#ef0909}
      #footer #gototop{height:40px;
      line-height:40px;
      width:40px;
      text-align:center;
      display:inline-block;
      background:#1d1d1d;
      font-size:24px;
      color:#fff;
      }
      #footer #gototop:hover{
       background:#bb0000;
       text-decoration:none;
      }
      #footer .cp{
       margin-top:11px;
       }
      ul.social{
       list-style:none;
       margin:10px 0 0;
       padding:0;
       display:inline-block;
      }
      ul.social>li{
       display:inline-block;
       margin:0 5px;
      }
      ul.social>li>a{
       font-size:24px;
       color:#666;
      }
      ul.social>li>a:hover{
       color:#999;
      }.box-border{
       padding:15px;
      }.accordion-group{
       background-color:#fff;
       border-top:1px solid #f0f0f0;
      }.accordion-heading .accordion-toggle{
      color:#666;
      font-weight:700;
      }
      .accordion-inner{border-top:0}
      .blog .blog-item h2{margin-top:0}
      .blog .blog-item .date span{display:block;text-align:center}
      .blog .blog-item .date span.day{
       font-size:50px;
       line-height:50px;
       padding-top:10px;
       font-family:"Fjalla One",sans-serif;
      }
      .blog .blog-item .date span.month{font-size:18px}
      .blog .blog-item .tag{margin-top:5px}
      .blog .blog-item .avatar{margin-top:5px}
      select,textarea,input[type="text"],
      input[type="password"],
      input[type="datetime"],
      input[type="datetime-local"],
      input[type="date"],
      input[type="month"],
      input[type="time"],
      input[type="week"],
      input[type="number"],
      input[type="email"],
      input[type="url"],
      input[type="search"],
      input[type="tel"],
      input[type="color"],
      .uneditable-input{-webkit-border-radius:3px;
       -moz-border-radius:3px;
       border-radius:3px;
       -webkit-box-shadow:none;
       -moz-box-shadow:none;
       box-shadow:none;
       min-height:50px;
       padding:0 15px;
       border:3px solid #ededed
      }
      select:focus,textarea:focus,
      input[type="text"]:focus,
      input[type="password"]:focus,
      input[type="datetime"]:focus,
      input[type="datetime-local"]:focus,
      input[type="date"]:focus,
      input[type="month"]:focus,
      input[type="time"]:focus,
      input[type="week"]:focus,
      input[type="number"]:focus,
      input[type="email"]:focus,
      input[type="url"]:focus,
      input[type="search"]:focus,
      input[type="tel"]:focus,
      input[type="color"]:focus,
      .uneditable-input:focus{
       border-color:#2dcc70;
       -webkit-box-shadow:none;
       -moz-box-shadow:none;
       box-shadow:none;
      }
      .input-block-level{
       min-height:50px;
      }
      textarea#message{
       padding:10px 15px;
       height:305px;
      }
      .widget{
       margin-bottom:30px;
      }
      .widget>h3{
       font-size:16px;
       margin-top:0;
      }
      .widget h5{
       margin-top:10px;
      }.widget .date{
       margin-top:5px;
       padding:8px 10px;
       background:#2dcc70;
      }.widget .date>span{
       display:block;
       text-align:center;
       font-family:"Fjalla One";
       color:#fff;
      }.widget .date>span.month{
       font-size:14px;
       line-height:14px;
       font-weight:700;
       text-transform:uppercase;
      }.widget .date>span.day{
       font-size:18px;
       line-height:18px;
      }#pricing-table{
       margin-top:20px;
       margin-bottom:30px;
      }#pricing-table .plan{
       list-style:none;
       margin:0;
       padding:0;
       color:#fff;
      }#pricing-table .plan.featured{
       -webkit-transform:scale(1.1);
       -moz-transform:scale(1.1);
       -ms-transform:scale(1.1);
       -o-transform:scale(1.1);
       transform:scale(1.1);
      }
      #pricing-table .plan>li{padding:10px 15px}
      #pricing-table .plan>li.plan-name{background:rgba(0,0,0,0.1)}
      #pricing-table .plan>li.plan-name h3{margin:10px 0}
      #pricing-table .plan>li.plan-action{padding:20px 0}
      #pricing-table .plan1{background:#1abc9c}
      #pricing-table .plan2{background:#e74c3c}
      #pricing-table .plan3{background:#3498db}
      #pricing-table .plan4{background:#9b59b6}
      ul.gallery{display:block;margin:-15px}
      ul.gallery.col-1 li{width:100%}
      ul.gallery.col-2 li{width:50%}
      ul.gallery.col-3 li{width:33.3333%}
      ul.gallery.col-4 li{width:25%}
      ul.gallery li{display:block;padding:0;margin:0;float:left}
      ul.gallery li .desc{margin:15px}
      ul.gallery li .preview{margin:15px;display:block;position:relative}
      ul.gallery li .preview .overlay{
       width:100%;
       height:100%;
       position:absolute;
       left:0;top:0;
       background:rgba(0,0,0,0.6);
       opacity:0;
       filter:alpha(opacity=0);
       -webkit-transition:opacity 300ms;
       -moz-transition:opacity 300ms;
       -o-transition:opacity 300ms;
       transition:opacity 300ms;
      }
      ul.gallery li .preview modal-bodyinks{
       width:104px;
       height:40px;
       position:absolute;
       top:50%;
       left:50%;
       margin-top:-20px;
       margin-left:-52px;
       opacity:0;
       filter:alpha(opacity=0);
       -webkit-transform:translate(0,-50px);
       -moz-transform:translate(0,-50px);
       -ms-transform:translate(0,-50px);
       -o-transform:translate(0,-50px);
       transform:translate(0,-50px);
       -webkit-transition:300ms;
       -moz-transition:300ms;
       -o-transition:300ms;
       transition:300ms
      }
      ul.gallery li .preview .links>a{
       width:50px;
       height:40px;
       line-height:40px;
       display:inline-block;
       text-align:center;
       background:#2dcc70;
       color:#fff;
       text-shadow:0 1px rgba(0,0,0,0.3);
       font-size:18px;
       margin:0 1px;
      }
      ul.gallery li .preview:hover .overlay,ul.gallery li .preview:hover .links{
       opacity:1;
       filter:alpha(opacity=100)
      }
      ul.gallery li .preview:hover .links{
       -webkit-transform:translate(0,0);
       -moz-transform:translate(0,0);
       -ms-transform:translate(0,0);
       -o-transform:translate(0,0);
       transform:translate(0,0);
      }
      ul.faq{
       list-style:none;
       margin:0;
      }
      ul.faq li{
       margin-top:30px;
      }
      ul.faq li:first-child{margin-top:0}
      ul.faq li span.number{
       display:block;
       float:left;
       width:50px;
       height:50px;
       line-height:50px;
       text-align:center;
       background:#bb0300;
       color:#fff;font-size:24px;
      }ul.faq li>div{margin-left:70px}ul.faq li>div h3{margin-top:0}#error{text-align:center;margin-top:150px;margin-bottom:150px}
  #mapSection, #carouselSection{border-top:0px solid #BB0000; border-bottom: 0px; background: #bb0300; color:#fff}

  .container1{width:1170px; margin-right:0px; }
  .input-block-level1{
 display:block;
 width:100%;
 min-height:30px;
 -webkit-box-sizing:border-box;
 -moz-box-sizing:border-box;
 box-sizing:border-box
 }
  .input-block-level1{min-height:50px}textarea#message1 { padding:10px 15px; height:220px}


问:
Azure ARM Template : Create Resource Group
We are new to ARM (Azure Resource Manager) templates. While working on a template, I observed that we have to supply a resource group when deploying our template.
Is it is possible to create a resource group through a template like other resources?</p>

答:
Is it is possible to create resource group through template like
  other resources ??

For now, we can't use arm template to create Azure resource group.

ContentLicense: CC BY-SA 4.0


问:
Check if one string includes a substring with Levenshtein distance of 1 from other string
My problem is that we want our users to enter the code like this:
639195-EM-66-XA-53-WX somewhere in the input, so the result may look like this: The code is 639195-EM-66-XA-53-WX, let me in. We still want to match the string if they make a small error in the code (Levenshtein distance of 1). For example The code is 739195-EM-66-XA-53-WX, let me in. (changed 6 to 7 in the first letter of the code)

The algorithm should match even if user skips dashes, and it should ignore lowercase/uppercase letters. These requirements are easy to fulfil, because I can remove all dashes and do to_uppercase.

Is there an algorithm for something like that?

Generating all strings with the distance of 1 from original code is computationally expensive.

I was also thinking about using something like Levenshtein distance, but ignoring missing letters that user added in the second string, but that would allow wrong letters in the middle of the code.

Searching for the code in user input seems a little bit better, but still not very clean.

答:
I had an idea for a solution, maybe this is good enough for you:

As you said, first remove the dashes and make everything upper (or lower) case:

Sentence: THE CODE IS 639195EM66XA53WX, LET ME IN

Code: 639195EM66XA53WX

Split the code in the middle (c1 and c2), because Levenshtein distance of 1 means that there can only be one mistake (insertion, deletion or replacement of a single character), so one of c1 or c2 has to match if the code is present in the sentence with just 1 or less mistakes. Splitting in the middle because the longer both substrings of the code are the fewer matches you should get:

c1: 639195EM

c2: 66XA53WX

Now try to find c1 and c2 in your sentence, if you find a match then you either have to go forward (c1 matched) or backwards (c2 matched) in the sentence to check if the Levenshtein distance of the missing part is 1 or less.

So in your example you would find c2 and then:

Set pointers to the last character of c1 and the character before the match.

While the characters are the same reduce both pointers by 1 (go backwards in both strings).

If you can consume c1 completely this way you found an exact match (Levenshtein distance of 0).

Otherwise try the 3 possibilities for Levenshtein distance of 1:

Only move the pointer of the c1 backwards and see if the rest matches (deletion).

Only move the pointer of the sentence backwards and see if the rest matches (insertion).

Move both pointers backwards and see if the rest matches (replacement).

If one of them succeeds you found a match with Levenshtein distance of 1, otherwise the distance is higher.


问:
Maven2 Eclipse integration
There seem to be two rival  Eclipse plugins for integrating with Maven:
m2Eclipse
and
q4e.

Has anyone recently evaluated or used these plugins?

Why would I choose one or the other?

答: Side by side comparison table of three maven plugins. </p>

OwnerDisplayName: David

ContentLicense: CC BY-SA 2.5

Title: Maven2 Eclipse integration

OwnerDisplayName: marcio


问:
nuget, download uncommitted dlls
I made a checkout of my project from a different location, now I noticed that I didn't commit the dll files from /packages, can I get nuget to download them?</p>

答: The only way to do this right now is to is to remove the reference from packages.config and reinstall those packages. We're planning to support this scenario in the future (more info here http://nuget.codeplex.com/workitem/165).</p>

Title: nuget, download uncommitted dlls


问:
Reset/Delete (not empty) product customization fields on Prestashop
I'm trying to reset the customization fields of a specific product on a Prestashop website.

Currently, i succeed in saving them, but when i visit other pages of my website and come back to this product page, the customization fields are still saved and displayed (which is the normal behavior, which is the normal behavior, i know).

My aim is to give the user a "Reset customization" button that really reset/delete the data and not just empty them temporarily (while you stay on the page)...

Is there a simple way to do this ?

答:
If I had to add a "Reset customization" button, here is how I would code it :

Add the button in your product.tpl file. In the
<form> div of the  section

```<code><button class="button btn btn-default button button-small" name="resetCustomization" value="1">
    <span>{l s='Reset customization'}</span>
</button>
</code>```

Override the initContent() function from ProductController.php like so

```<code>public function initContent()
{
    if (Tools::isSubmit('resetCustomization')) {
        $this->product->deleteCustomization();
    }

    parent::initContent();
}
</code>```

Don't forget to make backups copy of these files and delete your class_index.php located in the /cache/ folder.

Body:
If I had to add a "Reset customization" button, here is how I would code it :

Add the button in your product.tpl file. In the
<form> div of the <!--Customization --> section

<button class="button btn btn-default button button-small" name="resetCustomization" value="1">
    <span>{l s='Reset customization'}</span>
</button>

Override the initContent() function from ProductController.php like so

public function initContent()
{
    if (Tools::isSubmit('resetCustomization')) {
        $this->product->deleteCustomization();
    }

    parent::initContent();
}

Don't forget to make backups copy of these files and delete your class_index.php located in the /cache/ folder.


问:
get_the_category_list to display only two categories
I am using get_the_category_list()  function for getting categories but for a particular post if there is too many categories it looks bad.

I want to display just 2 or 3 categories not all.

How can I achieve this using get_the_category_list()  function

答:
Get the categories into a variable:

```<code>$categories_list = get_the_category_list();
</code>```

Now you can get the number of elements you want using array_slice.

```<code>$output = array_slice($categories_list, 2);
</code>```

Next display  $output in the way you want and you will get only 2 categories displayed.

Body:
Get the categories into a variable:

$categories_list = get_the_category_list();

Now you can get the number of elements you want using array_slice.

$output = array_slice($categories_list, 2);

Next display  $output in the way you want and you will get only 2 categories displayed.


问:
Connection is not associated with a managed connection.org.jboss.resource.adapter.jdbc.jdk6.WrappedConnectionJDK6
I am using Hibernate on a JBoss server. I get the error below.

The error happens when I try to connect to the database for the second time in the same sesssion.

Also I get the error "Closing connection for you. Please close your connection".

```<code>    14:28:37,869 ERROR [HibernateUtil] HibernateException  occurred in executeQuery  method   in  HibernateUtil class
    org.hibernate.exception.GenericJDBCException: could not execute query
    at   org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
    at org.hibernate.loader.Loader.doList(Loader.java:2231)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
    at org.hibernate.loader.Loader.list(Loader.java:2120)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
    at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)
    at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)
    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
    at com.a.amc.dao.utils.HibernateUtil.executeQuery(HibernateUtil.java:154)
    at com.a.amc.service.impl.CityServiceImpl.isCityExists(CityServiceImpl.java:142)
    at com.a.amc.service.impl.CityServiceImpl.addCity(CityServiceImpl.java:38)
    at com.a.amc.web.actions.CityAction.addCity(CityAction.java:50)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)

14:28:37,869 ERROR [JDBCTransaction] Could not toggle autocommit
java.sql.SQLException: Connection is not associated with a managed connection.org.jboss.resource.adapter.jdbc.jdk6.WrappedConnectionJDK6@1269ca1
    at org.jboss.resource.adapter.jdbc.WrappedConnection.lock(WrappedConnection.java:81)
    at org.jboss.resource.adapter.jdbc.WrappedConnection.setAutoCommit(WrappedConnection.java:454)
    at org.hibernate.transaction.JDBCTransaction.toggleAutoCommit(JDBCTransaction.java:228)
    at org.hibernate.transaction.JDBCTransaction.rollbackAndResetAutoCommit(JDBCTransaction.java:220)
    at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:196)
    at com.a.amc.dao.utils.HibernateUtil.executeQuery(HibernateUtil.java:159)
    at com.a.amc.service.impl.CityServiceImpl.isCityExists(CityServiceImpl.java:142)
    at com.a.amc.service.impl.CityServiceImpl.addCity(CityServiceImpl.java:38)
    at com.a.amc.web.actions.CityAction.addCity(CityAction.java:50)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)

14:28:37,869 ERROR [JDBCTransaction] JDBC rollback failed
java.sql.SQLException: Connection is not associated with a managed connection.org.jboss.resource.adapter.jdbc.jdk6.WrappedConnectionJDK6@1269ca1
    at org.jboss.resource.adapter.jdbc.WrappedConnection.lock(WrappedConnection.java:81)
    at org.jboss.resource.adapter.jdbc.WrappedConnection.rollback(WrappedConnection.java:496)
    at org.hibernate.transaction.JDBCTransaction.rollbackAndResetAutoCommit(JDBCTransaction.java:217)
    at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:196)
    at com.a.amc.dao.utils.HibernateUtil.executeQuery(HibernateUtil.java:159)
    at com.a.amc.service.impl.CityServiceImpl.isCityExists(CityServiceImpl.java:142)
    at com.a.amc.service.impl.CityServiceImpl.addCity(CityServiceImpl.java:38)
    at com.a.amc.web.actions.CityAction.addCity(CityAction.java:50)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)

14:28:37,869 ERROR [CityServiceImpl] Exception  occurred in isCityExists method in  CityServiceImpl
org.hibernate.TransactionException: JDBC rollback failed
    at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:204)
    at com.a.amc.dao.utils.HibernateUtil.executeQuery(HibernateUtil.java:159)
    at com.a.amc.service.impl.CityServiceImpl.isCityExists(CityServiceImpl.java:142)
    at com.a.amc.service.impl.CityServiceImpl.addCity(CityServiceImpl.java:38)
    at com.a.amc.web.actions.CityAction.addCity(CityAction.java:50)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
</code>```

What could be the cause, and how do I solve this situation?

答:
This can happen when closing a connection, and afterwards using that connection again.

Imagine a scenario where for a bean call, at the start the connection is created and at the very end the connection is closed. The operation itself uses the connection, for all sorts of CRUD operations on a database. Somewhere during the operation the connection is closed and then used again.

In pseudo code:

```<code>try( Connection c = createConnection(); ) { // the very start
    doOperations( c );
}
</code>```

Now suppose somewhere in doOperations you do something like:

```<code>void doOperations( Connection c ) {
    String sql = ""; // an actual SQL statement
    try( Connection c2 = c;
         PreparedStatement ps = c2.prepareStatement( sql ); ) {
        // ...
        ps.executeUpdate( );
    } // <<< the connection will be closed here

    String sql2 = ""; // an actual SQL statement
    try( PreparedStatement ps2 = c.prepareStatement( sql2 ); ) { // <<< exception thrown here, connection is already closed
        // ...
    }
}
</code>```

The exception thrown is:

```<code>java.sql.SQLException: Connection is not associated with a managed connection.org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6@2cc0951e
at org.jboss.jca.adapters.jdbc.WrappedConnection.lock(WrappedConnection.java:154)
at org.jboss.jca.adapters.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:394)
</code>```

Bottom line: don't close a Connection and then use it again.

Body:
I am using Hibernate on a JBoss server. I get the error below.

The error happens when I try to connect to the database for the second time in the same sesssion.

Also I get the error "Closing connection for you. Please close your connection".

    14:28:37,869 ERROR [HibernateUtil] HibernateException  occurred in executeQuery  method   in  HibernateUtil class
    org.hibernate.exception.GenericJDBCException: could not execute query
    at   org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
    at org.hibernate.loader.Loader.doList(Loader.java:2231)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
    at org.hibernate.loader.Loader.list(Loader.java:2120)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
    at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)
    at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)
    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
    at com.a.amc.dao.utils.HibernateUtil.executeQuery(HibernateUtil.java:154)
    at com.a.amc.service.impl.CityServiceImpl.isCityExists(CityServiceImpl.java:142)
    at com.a.amc.service.impl.CityServiceImpl.addCity(CityServiceImpl.java:38)
    at com.a.amc.web.actions.CityAction.addCity(CityAction.java:50)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)

14:28:37,869 ERROR [JDBCTransaction] Could not toggle autocommit
java.sql.SQLException: Connection is not associated with a managed connection.org.jboss.resource.adapter.jdbc.jdk6.WrappedConnectionJDK6@1269ca1
    at org.jboss.resource.adapter.jdbc.WrappedConnection.lock(WrappedConnection.java:81)
    at org.jboss.resource.adapter.jdbc.WrappedConnection.setAutoCommit(WrappedConnection.java:454)
    at org.hibernate.transaction.JDBCTransaction.toggleAutoCommit(JDBCTransaction.java:228)
    at org.hibernate.transaction.JDBCTransaction.rollbackAndResetAutoCommit(JDBCTransaction.java:220)
    at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:196)
    at com.a.amc.dao.utils.HibernateUtil.executeQuery(HibernateUtil.java:159)
    at com.a.amc.service.impl.CityServiceImpl.isCityExists(CityServiceImpl.java:142)
    at com.a.amc.service.impl.CityServiceImpl.addCity(CityServiceImpl.java:38)
    at com.a.amc.web.actions.CityAction.addCity(CityAction.java:50)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)

14:28:37,869 ERROR [JDBCTransaction] JDBC rollback failed
java.sql.SQLException: Connection is not associated with a managed connection.org.jboss.resource.adapter.jdbc.jdk6.WrappedConnectionJDK6@1269ca1
    at org.jboss.resource.adapter.jdbc.WrappedConnection.lock(WrappedConnection.java:81)
    at org.jboss.resource.adapter.jdbc.WrappedConnection.rollback(WrappedConnection.java:496)
    at org.hibernate.transaction.JDBCTransaction.rollbackAndResetAutoCommit(JDBCTransaction.java:217)
    at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:196)
    at com.a.amc.dao.utils.HibernateUtil.executeQuery(HibernateUtil.java:159)
    at com.a.amc.service.impl.CityServiceImpl.isCityExists(CityServiceImpl.java:142)
    at com.a.amc.service.impl.CityServiceImpl.addCity(CityServiceImpl.java:38)
    at com.a.amc.web.actions.CityAction.addCity(CityAction.java:50)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)

14:28:37,869 ERROR [CityServiceImpl] Exception  occurred in isCityExists method in  CityServiceImpl
org.hibernate.TransactionException: JDBC rollback failed
    at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:204)
    at com.a.amc.dao.utils.HibernateUtil.executeQuery(HibernateUtil.java:159)
    at com.a.amc.service.impl.CityServiceImpl.isCityExists(CityServiceImpl.java:142)
    at com.a.amc.service.impl.CityServiceImpl.addCity(CityServiceImpl.java:38)
    at com.a.amc.web.actions.CityAction.addCity(CityAction.java:50)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)

What could be the cause, and how do I solve this situation?

Body:
This can happen when closing a connection, and afterwards using that connection again.

Imagine a scenario where for a bean call, at the start the connection is created and at the very end the connection is closed. The operation itself uses the connection, for all sorts of CRUD operations on a database. Somewhere during the operation the connection is closed and then used again.

In pseudo code:

try( Connection c = createConnection(); ) { // the very start
    doOperations( c );
}

Now suppose somewhere in doOperations you do something like:

void doOperations( Connection c ) {
    String sql = ""; // an actual SQL statement
    try( Connection c2 = c;
         PreparedStatement ps = c2.prepareStatement( sql ); ) {
        // ...
        ps.executeUpdate( );
    } // <<< the connection will be closed here

    String sql2 = ""; // an actual SQL statement
    try( PreparedStatement ps2 = c.prepareStatement( sql2 ); ) { // <<< exception thrown here, connection is already closed
        // ...
    }
}

The exception thrown is:

java.sql.SQLException: Connection is not associated with a managed connection.org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6@2cc0951e
at org.jboss.jca.adapters.jdbc.WrappedConnection.lock(WrappedConnection.java:154)
at org.jboss.jca.adapters.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:394)

Bottom line: don't close a Connection and then use it again.


问:
Check condition when Add to car Button is clicked Prestashop
In my Prestashop web there are 3 types  of products (In stock, On demand and Coming soon). When a user clicks on Add to cart button in product page, it should shows an alert saying the products cannot be mixed (you cannot buy a product in stock and a product on demand). I use BlockCart module but I cant find the file which I have to edit. Also, I have looked in CartController or ProductController but nothing.

Can you help me?

答: You Can check in controllers/front/CartController.php for processChangeProductInCart Function.


答:
Personally I find the reshape package easier to work with, and it automatically handles having multiple countries/however many types of labels/data types you have.

```<code>library(reshape)
mydf <- data.frame(
date=c("2016-01-01","2016-02-01","2016-03-01","2016-04-01","2016-05-01", "2016-02-01", "2016-03-01", "2016-04-01", "2016-05-01",
       "2016-06-01", "2016-02-01", "2016-03-01", "2016-04-01", "2016-05-01","2016-05-01"),
value=c(1,2,3,4,5,1,2,3,4,5,2,1.5,1.33,1.2, 2),
country=c("US", "US", "US", "US", "US", "US", "US", "US", "US", "US", "US", "US", "US", "US", 'AU'),
indicator=c("gdp", "gdp", "gdp", "gdp", "gdp", "population", "population", "population",
            "population", "population", "gdp per capita", "gdp per capita", "gdp per capita", "gdp per capita", 'gdp'))
</code>```

To get the new indicator, first make your data into wide format so that the relevant columns are next to each other. This is so you can do simple column wise operations

```<code>df_wide = cast(mydf, date+country~indicator, sum)
</code>```

You want the countries and dates as columns that uniquely define rows (left side of the formula), with differnet indicators as columns (right side of formula)

```<code>        date country gdp gdp per capita population
1 2016-01-01      US   1           0.00          0
2 2016-02-01      US   2           2.00          1
3 2016-03-01      US   3           1.50          2
4 2016-04-01      US   4           1.33          3
5 2016-05-01      AU   2           0.00          0
6 2016-05-01      US   5           1.20          4
7 2016-06-01      US   0           0.00          5
</code>```

Now make a new column and set this to whatever you want

```<code>df_wide['g_p_ratio'] = df_wide['gdp'] / df_wide['population']
</code>```

Then use Melt to get this back to your long format

```<code>df_new = melt(df_wide, id=c('date'))
</code>```

Voila!

```<code>                       date country value      indicator
gdp              2016-01-01      US  1.00            gdp
gdp.1            2016-02-01      US  2.00            gdp
gdp.2            2016-03-01      US  3.00            gdp
gdp.3            2016-04-01      US  4.00            gdp
gdp.4            2016-05-01      AU  2.00            gdp
gdp.5            2016-05-01      US  5.00            gdp
gdp.6            2016-06-01      US  0.00            gdp
gdp.per.capita   2016-01-01      US  0.00 gdp per capita
gdp.per.capita.1 2016-02-01      US  2.00 gdp per capita
gdp.per.capita.2 2016-03-01      US  1.50 gdp per capita
gdp.per.capita.3 2016-04-01      US  1.33 gdp per capita
gdp.per.capita.4 2016-05-01      AU  0.00 gdp per capita
gdp.per.capita.5 2016-05-01      US  1.20 gdp per capita
gdp.per.capita.6 2016-06-01      US  0.00 gdp per capita
population       2016-01-01      US  0.00     population
population.1     2016-02-01      US  1.00     population
population.2     2016-03-01      US  2.00     population
population.3     2016-04-01      US  3.00     population
population.4     2016-05-01      AU  0.00     population
population.5     2016-05-01      US  4.00     population
population.6     2016-06-01      US  5.00     population
</code>```

You may or may not want your new row labels, but you can fix that

```<code>rownames(df_new) <- 1:nrow(df_new)
</code>```

Title: Create new ratio indicator in long data

Body:
I have a long data frame

mydf <- data.frame(
+     date=c("2016-01-01","2016-02-01","2016-03-01","2016-04-01","2016-05-01", "2016-02-01", "2016-03-01", "2016-04-01", "2016-05-01", "2016-06-01"),
+     value=c(1,2,3,4,5,1,2,3,4,5),
+     country=c("US", "US", "US", "US", "US", "US", "US", "US", "US", "US"),
+     indicator=c("gdp", "gdp", "gdp", "gdp", "gdp", "population", "population", "population", "population", "population"))

         date value country  indicator
1  2016-01-01     1      US        gdp
2  2016-02-01     2      US        gdp
3  2016-03-01     3      US        gdp
4  2016-04-01     4      US        gdp
5  2016-05-01     5      US        gdp
6  2016-02-01     1      US population
7  2016-03-01     2      US population
8  2016-04-01     3      US population
9  2016-05-01     4      US population
10 2016-06-01     5      US population

I want to create specific new indicators that come from ratios, e.g. GDP/population*1000

It would look something like this, it has to match the right dates for each respective indicator

mydf <- data.frame(
+     date=c("2016-01-01","2016-02-01","2016-03-01","2016-04-01","2016-05-01", "2016-02-01", "2016-03-01", "2016-04-01", "2016-05-01", "2016-06-01", "2016-02-01", "2016-03-01", "2016-04-01", "2016-05-01"),
+     value=c(1,2,3,4,5,1,2,3,4,5,2,1.5,1.33,1.2),
+     country=c("US", "US", "US", "US", "US", "US", "US", "US", "US", "US", "US", "US", "US", "US"),
+     indicator=c("gdp", "gdp", "gdp", "gdp", "gdp", "population", "population", "population", "population", "population", "gdp per capita", "gdp per capita", "gdp per capita", "gdp per capita"))

         date value country      indicator
1  2016-01-01  1.00      US            gdp
2  2016-02-01  2.00      US            gdp
3  2016-03-01  3.00      US            gdp
4  2016-04-01  4.00      US            gdp
5  2016-05-01  5.00      US            gdp
6  2016-02-01  1.00      US     population
7  2016-03-01  2.00      US     population
8  2016-04-01  3.00      US     population
9  2016-05-01  4.00      US     population
10 2016-06-01  5.00      US     population
11 2016-02-01  2.00      US gdp per capita
12 2016-03-01  1.50      US gdp per capita
13 2016-04-01  1.33      US gdp per capita
14 2016-05-01  1.20      US gdp per capita

Is there an easy way to do this in R?

Body:
Personally I find the reshape package easier to work with, and it automatically handles having multiple countries/however many types of labels/data types you have.

library(reshape)
mydf <- data.frame(
date=c("2016-01-01","2016-02-01","2016-03-01","2016-04-01","2016-05-01", "2016-02-01", "2016-03-01", "2016-04-01", "2016-05-01",
       "2016-06-01", "2016-02-01", "2016-03-01", "2016-04-01", "2016-05-01","2016-05-01"),
value=c(1,2,3,4,5,1,2,3,4,5,2,1.5,1.33,1.2, 2),
country=c("US", "US", "US", "US", "US", "US", "US", "US", "US", "US", "US", "US", "US", "US", 'AU'),
indicator=c("gdp", "gdp", "gdp", "gdp", "gdp", "population", "population", "population",
            "population", "population", "gdp per capita", "gdp per capita", "gdp per capita", "gdp per capita", 'gdp'))

To get the new indicator, first make your data into wide format so that the relevant columns are next to each other. This is so you can do simple column wise operations

df_wide = cast(mydf, date+country~indicator, sum)

You want the countries and dates as columns that uniquely define rows (left side of the formula), with differnet indicators as columns (right side of formula)

        date country gdp gdp per capita population
1 2016-01-01      US   1           0.00          0
2 2016-02-01      US   2           2.00          1
3 2016-03-01      US   3           1.50          2
4 2016-04-01      US   4           1.33          3
5 2016-05-01      AU   2           0.00          0
6 2016-05-01      US   5           1.20          4
7 2016-06-01      US   0           0.00          5

Now make a new column and set this to whatever you want

df_wide['g_p_ratio'] = df_wide['gdp'] / df_wide['population']

Then use Melt to get this back to your long format

df_new = melt(df_wide, id=c('date'))

Voila!

                       date country value      indicator
gdp              2016-01-01      US  1.00            gdp
gdp.1            2016-02-01      US  2.00            gdp
gdp.2            2016-03-01      US  3.00            gdp
gdp.3            2016-04-01      US  4.00            gdp
gdp.4            2016-05-01      AU  2.00            gdp
gdp.5            2016-05-01      US  5.00            gdp
gdp.6            2016-06-01      US  0.00            gdp
gdp.per.capita   2016-01-01      US  0.00 gdp per capita
gdp.per.capita.1 2016-02-01      US  2.00 gdp per capita
gdp.per.capita.2 2016-03-01      US  1.50 gdp per capita
gdp.per.capita.3 2016-04-01      US  1.33 gdp per capita
gdp.per.capita.4 2016-05-01      AU  0.00 gdp per capita
gdp.per.capita.5 2016-05-01      US  1.20 gdp per capita
gdp.per.capita.6 2016-06-01      US  0.00 gdp per capita
population       2016-01-01      US  0.00     population
population.1     2016-02-01      US  1.00     population
population.2     2016-03-01      US  2.00     population
population.3     2016-04-01      US  3.00     population
population.4     2016-05-01      AU  0.00     population
population.5     2016-05-01      US  4.00     population
population.6     2016-06-01      US  5.00     population

You may or may not want your new row labels, but you can fix that

rownames(df_new) <- 1:nrow(df_new)


问:
reading two integers in one line using C#
i know how to make a console read two integers but each integer by it self like this

```<code>int a = int.Parse(Console.ReadLine());
int b = int.Parse(Console.ReadLine());
</code>```

if i entered two numbers, i.e (1 2), the value (1 2), cant be parse to integers
what i want is if i entered 1 2 then it will take it as two integers

答:
```<code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SortInSubSet
{
    class Program
    {

        static int N, K;
        static Dictionary<int, int> dicElements = new Dictionary<int, int>();
        static void Main(string[] args)
        {

            while (!ReadNK())
            {
                Console.WriteLine("***************** PLEASE RETRY*********************");
            }

            var sortedDict = from entry in dicElements orderby entry.Key/3 , entry.Value ascending select entry.Value;

            foreach (int ele in sortedDict)
            {
                Console.Write(ele.ToString() + "  ");
            }

            Console.ReadKey();
        }

        static bool ReadNK()
        {
            dicElements = new Dictionary<int, int>();
            Console.WriteLine("Please entere the No. of element 'N' ( Between 2 and 9999) and Subset Size 'K' Separated by space.");

            string[] NK = Console.ReadLine().Split();

            if (NK.Length != 2)
            {
                Console.WriteLine("Please enter N and K values correctly.");
                return false;
            }

            if (int.TryParse(NK[0], out N))
            {
                if (N < 2 || N > 9999)
                {
                    Console.WriteLine("Value of 'N' Should be Between 2 and 9999.");
                    return false;
                }
            }
            else
            {
                Console.WriteLine("Invalid number: Value of 'N' Should be greater than 1 and lessthan 10000.");
                return false;
            }

            if (int.TryParse(NK[1], out K))
            {
                Console.WriteLine("Enter all elements Separated by space.");
                string[] kElements = Console.ReadLine().Split();

                for (int i = 0; i < kElements.Length; i++)
                {
                    int ele;

                    if (int.TryParse(kElements[i], out ele))
                    {
                        if (ele < -99999 || ele > 99999)
                        {
                            Console.WriteLine("Invalid Range( " + kElements[i] + "): Element value should be Between -99999 and 99999.");
                            return false;
                        }

                        dicElements.Add(i, ele);
                    }
                    else
                    {
                        Console.WriteLine("Invalid number( " + kElements[i] + "): Element value should be Between -99999 and 99999.");
                        return false;
                    }

                }

            }
            else
            {
                Console.WriteLine(" Invalid number ,Value of 'K'.");
                return false;
            }

            return true;
        }
    }
}
</code>```

Body:
i know how to make a console read two integers but each integer by it self like this

int a = int.Parse(Console.ReadLine());
int b = int.Parse(Console.ReadLine());

if i entered two numbers, i.e (1 2), the value (1 2), cant be parse to integers
what i want is if i entered 1 2 then it will take it as two integers


问:
PL/SQL How to compare an expression in a trigger?
I'm trying to output a message each time a student's new GPA is lower than their old GPA by 1 or more.

```<code>Create or Replace TRIGGER AUGPA
  after update on students
  for each row -- or should I put 'for GPA' the column name
begin
  if (:new.gpa - :old.gpa) >= 1 -- How do I compare these expressions? I get an error here.
    THEN
      dbms_output.put_line ('Old GPA is lower than previous GPA by at least 1 point.')
  End if;
End;
/
</code>```

Students Table

```<code>SNUM  SNAME  STANDING  MAJOR  GPA  MAJORGPA
****  *****  ********  *****  ***  ********
121   Liz      2       FIN   2.8     3.2
</code>```

答:
You can try following changes :

1) you can use

AFTER UPDATE OF GPA ON students

2) you can compare like

```<code>IF :new.gpa < :old.gpa  THEN
      dbms_output.put_line ('Old GPA is lower than previous GPA by at least 1
       point.')
    END IF;
</code>```

Body:
I'm trying to output a message each time a student's new GPA is lower than their old GPA by 1 or more.

Create or Replace TRIGGER AUGPA
  after update on students
  for each row -- or should I put 'for GPA' the column name
begin
  if (:new.gpa - :old.gpa) >= 1 -- How do I compare these expressions? I get an error here.
    THEN
      dbms_output.put_line ('Old GPA is lower than previous GPA by at least 1 point.')
  End if;
End;
/

Students Table

SNUM  SNAME  STANDING  MAJOR  GPA  MAJORGPA
****  *****  ********  *****  ***  ********
121   Liz      2       FIN   2.8     3.2

Body:
You can try following changes :

1) you can use

AFTER UPDATE OF GPA ON students

2) you can compare like

IF :new.gpa < :old.gpa  THEN
      dbms_output.put_line ('Old GPA is lower than previous GPA by at least 1
       point.')
    END IF;


问:
Install Angular CLI offline
Im a very beginner with Angular and getting into it as part of a project. The version we are using is Angular 4.

They are using Angular CLI. But on the remote PC we are working, there is no internet due to security reason. Node and NPM installed. The packages required for the application is installed using some nupkg files, so internet not required that time. But when we tried to execute the application it only shows a blank page. So I tried this command in powershell and also in PackageManager Console. Im using Visual Studio 2017

ng --version

It says ng is not recognized. Attaching a screenshot

But Angular is showing under npm folder of the project.

@angular/cli

Am I missing anything??

答: If you have your package on your computer (direct download), you may use "npm link" in the package folder, this will link the package globally. And you can use "ng" in your bash/shell</p>

Title: Install Angular CLI offline


问:
Load a hidden div with jquery - detect which div
I have a page with some hidden divs and they will show only when their links are clicked.

It will start with this blank summary page

And when About is click it will load about content

And so on.. however, my script right now is not as dynamic as I want it to be. How can I hide which ever div that's currently showing and load the div that is being clicked by user? As for now the script is as if each link is  going to be first clicked by user when page is loaded...

$(function() {
  $.ajaxSetup({
    cache: false
  });

  var ajax_load = "";

  $("#abt-ctrl").click(function() {
    $('#content-services a').removeClass('active');
    $(this).addClass('active');

    $("#service-content").fadeOut('fast', function() {
      $("#service-content").html(ajax_load);
      $("#service-content").fadeIn('slow', function() {
        $("#loader").hide();
        $('#about-content').fadeIn();
      });
    });
  });

  $("#more").click(function() {
    $('#content-services a').removeClass('active');
    $(this).addClass('active');
    $("#service-content").fadeOut('fast', function() {
      $("#service-content").html(ajax_load);
      $("#service-content").fadeIn('slow', function() {
        $("#loader").hide();
        $('#more-content').fadeIn();
      });
    });
  });
});```
<pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="wrapper wrapper-content content-bg content-left-padding">
  <div id="service-content" class="row">
    <h2 style="margin-top: 22px; margin-left: 40px;max-width: 700px;margin-right: 50px;">Summary</h2>
    <p style="margin-left: 40px;max-width: 700px;margin-right: 50px;"></p>

  </div>
  <div id="about-content" class="hideme row">
    <div class="col-lg-12">
      <h2 style="margin-top: 22px; margin-left: 40px;max-width: 700px;margin-right: 50px;">About </h2>
      <p style="margin-top: 41px; margin-left: 40px;max-width: 700px;margin-right: 50px;">
        Gummi bears chocolate caramels biscuit bonbon. Candy donut apple pie. Bear claw apple pie sugar plum tiramisu jelly donut. Liquorice marzipan biscuit gummi bears dragée marshmallow. Jelly-o marshmallow candy pie gummi bears jujubes candy canes pie. Pastry
        gummi bears gummies cheesecake biscuit fruitcake candy canes soufflé soufflé. Chocolate bar apple pie jelly. Jelly croissant chocolate bar icing tart apple pie candy bonbon jelly beans. Chocolate lollipop soufflé tiramisu carrot cake danish sesame
        snaps soufflé.

      </p>
    </div>
  </div>
  <div id="more-content" class="hideme row">
    <div class="col-lg-12">
      <h2 style="margin-top: 22px; margin-left: 40px;max-width: 700px;margin-right: 50px;">More</h2>
      <p style="margin-top: 41px; margin-left: 40px;max-width: 700px;margin-right: 50px;">
        Croissant tart donut bear claw soufflé halvah. Brownie croissant chocolate. Pudding fruitcake gingerbread biscuit chocolate croissant gummi bears. Jujubes powder sugar plum tootsie roll caramels carrot cake tart icing. Cake oat cake chocolate cake gummies
        carrot cake jujubes carrot cake. Sweet cake chocolate cake fruitcake cookie pie gingerbread cupcake cookie. Marshmallow tiramisu wafer croissant tootsie roll. Wafer sweet roll cupcake chocolate cake apple pie croissant marshmallow muffin.
      </p>
    </div>
  </div>
</div></code>```

答:
Do something like this

```<code>$(".wrapper a").on("click",function(){
        // without using any unique/id. We detect based on their index position. link index = hideme index
    var ind = $(this).index('a');
    $(".wrapper a").removeClass("active");
    $(this).addClass("active");

    $(".wrapper-content .hideme").hide();
    $(".wrapper-content .hideme").eq(ind).show();
});
</code>```

And jsfiddle : https://jsfiddle.net/synz/fdq6f35z/

Body:
I have a page with some hidden divs and they will show only when their links are clicked.

It will start with this blank summary page

And when About is click it will load about content

And so on.. however, my script right now is not as dynamic as I want it to be. How can I hide which ever div that's currently showing and load the div that is being clicked by user? As for now the script is as if each link is  going to be first clicked by user when page is loaded...

$(function() {
  $.ajaxSetup({
    cache: false
  });

  var ajax_load = "";

  $("#abt-ctrl").click(function() {
    $('#content-services a').removeClass('active');
    $(this).addClass('active');

    $("#service-content").fadeOut('fast', function() {
      $("#service-content").html(ajax_load);
      $("#service-content").fadeIn('slow', function() {
        $("#loader").hide();
        $('#about-content').fadeIn();
      });
    });
  });

  $("#more").click(function() {
    $('#content-services a').removeClass('active');
    $(this).addClass('active');
    $("#service-content").fadeOut('fast', function() {
      $("#service-content").html(ajax_load);
      $("#service-content").fadeIn('slow', function() {
        $("#loader").hide();
        $('#more-content').fadeIn();
      });
    });
  });
});

Summary

About

        Gummi bears chocolate caramels biscuit bonbon. Candy donut apple pie. Bear claw apple pie sugar plum tiramisu jelly donut. Liquorice marzipan biscuit gummi bears dragée marshmallow. Jelly-o marshmallow candy pie gummi bears jujubes candy canes pie. Pastry
        gummi bears gummies cheesecake biscuit fruitcake candy canes soufflé soufflé. Chocolate bar apple pie jelly. Jelly croissant chocolate bar icing tart apple pie candy bonbon jelly beans. Chocolate lollipop soufflé tiramisu carrot cake danish sesame
        snaps soufflé.

More

        Croissant tart donut bear claw soufflé halvah. Brownie croissant chocolate. Pudding fruitcake gingerbread biscuit chocolate croissant gummi bears. Jujubes powder sugar plum tootsie roll caramels carrot cake tart icing. Cake oat cake chocolate cake gummies
        carrot cake jujubes carrot cake. Sweet cake chocolate cake fruitcake cookie pie gingerbread cupcake cookie. Marshmallow tiramisu wafer croissant tootsie roll. Wafer sweet roll cupcake chocolate cake apple pie croissant marshmallow muffin.

Body:
Do something like this

$(".wrapper a").on("click",function(){
        // without using any unique/id. We detect based on their index position. link index = hideme index
    var ind = $(this).index('a');
    $(".wrapper a").removeClass("active");
    $(this).addClass("active");

    $(".wrapper-content .hideme").hide();
    $(".wrapper-content .hideme").eq(ind).show();
});

And jsfiddle : https://jsfiddle.net/synz/fdq6f35z/


问:
calling axios in vue get Network Error
I working on one small project. Server side realized on Python as RESTFul server. Front-end I try do with Vue. I'm new in Vue. And when I try to fetch data fro service I get Error: Network Error. And I can't found mistake.

Irony is that I see fetched data in browser in network->Response tab. But not on HTML page. On the page I see Error: Network Error only.

I can fetch data with browser directly, by url.
I can fetch data with CURL
Also I can fetch data with this Vue code from third-part services! But not from local URL.

FLASK SERVER CODE

```<code>@app.route('/', methods=['GET'])
def get_data_list():
   return 'Test'
</code>```

VUE code

```<code>var app = new Vue({
    el: '#app',
    data: {
        data_list: '...',
        url_A: "#home",
        url_B: '#page2',
        url_C: '#settings'
    },

    created: function () {
        this.loadData()
    },

    methods:
        {
            loadData: function () {
                this.data_list = "Loading...."
                var app = this
                axios.get('http://127.0.0.1:5000/')
                    .then(function (response) {
                        app.data_list = response.data[0]
                    })
                    .catch(function (error) {
                        app.data_list = "An error occurred. "+error+" / Error ststus: "+error.response
                    })
            }
        }
})
</code>```

I'm a little bit confused. What is wrong with my code?

答:
You have mentioned that you are getting this error:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at 127.0.0.1:5000. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

This means you have a CORS (Cross Origin Resource Sharing). Which means you are trying to send and/or receive request from two different domains/ports.

So, for example if you send a GET request from localhost:8080 to localhost:5000 you'll get the same error, because you are trying to share resources across different origins:

So, one way to fix this problem is to instruct your back-end server (127.0.0.1:5000) which I assume is running a flask app to allow you to send it a GET request from (127.0.0.1:8080).

So, configure your flask app with this CORS guide http://flask-cors.readthedocs.io/en/latest/

Title: calling axios in vue get Network Error

Body:
I working on one small project. Server side realized on Python as RESTFul server. Front-end I try do with Vue. I'm new in Vue. And when I try to fetch data fro service I get Error: Network Error. And I can't found mistake.

Irony is that I see fetched data in browser in network->Response tab. But not on HTML page. On the page I see Error: Network Error only.

I can fetch data with browser directly, by url.
I can fetch data with CURL
Also I can fetch data with this Vue code from third-part services! But not from local URL.

FLASK SERVER CODE

@app.route('/', methods=['GET'])
def get_data_list():
   return 'Test'

VUE code

var app = new Vue({
    el: '#app',
    data: {
        data_list: '...',
        url_A: "#home",
        url_B: '#page2',
        url_C: '#settings'
    },

    created: function () {
        this.loadData()
    },

    methods:
        {
            loadData: function () {
                this.data_list = "Loading...."
                var app = this
                axios.get('http://127.0.0.1:5000/')
                    .then(function (response) {
                        app.data_list = response.data[0]
                    })
                    .catch(function (error) {
                        app.data_list = "An error occurred. "+error+" / Error ststus: "+error.response
                    })
            }
        }
})

I'm a little bit confused. What is wrong with my code?