问:
How to refer a view inside include layout in android
Hi i have coded the following to get the view from include layout. But i am getting null pointer exception. Where i am wrong?

My Java Code:

```<code>View actionbar = findViewById(R.id.actionbar);
                RelativeLayout actionRRl = (RelativeLayout)actionbar.findViewById(R.id.actionRR);
                actionRRl.setEnabled(false);
                actionRRl.setClickable(false);
</code>```

In my Activity.xml,

```<code>   <include
            android:id="@+id/actionbar"
            layout="@layout/actionbar" />
</code>```

Layout that is included, ie., actionbar.xml

```<code>  <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/header"
        android:focusable="false"
        android:focusableInTouchMode="false"
        android:clickable="false"
        android:id="@+id/actionRR"
        android:orientation="vertical">

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:clickable="false"
            android:padding="@dimen/logo_size"
            android:src="@drawable/logo" />

    </RelativeLayout>
</code>```

Error Stack:

```<code>Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setEnabled(boolean)' on a null object reference
</code>```

答:
Giving id to your included layout like below:

```<code><include android:id="@+id/actionbar"
</code>```

overrides your parent id in your included layout.

In your case, changing your code to this should fix the problem:

```<code>View actionbar = findViewById(R.id.actionbar);
actionbar.setEnabled(false);
actionbar.setClickable(false);
</code>```

Body:
Hi i have coded the following to get the view from include layout. But i am getting null pointer exception. Where i am wrong?

My Java Code:

View actionbar = findViewById(R.id.actionbar);
                RelativeLayout actionRRl = (RelativeLayout)actionbar.findViewById(R.id.actionRR);
                actionRRl.setEnabled(false);
                actionRRl.setClickable(false);

In my Activity.xml,

   <include
            android:id="@+id/actionbar"
            layout="@layout/actionbar" />

Layout that is included, ie., actionbar.xml

  <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/header"
        android:focusable="false"
        android:focusableInTouchMode="false"
        android:clickable="false"
        android:id="@+id/actionRR"
        android:orientation="vertical">

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:clickable="false"
            android:padding="@dimen/logo_size"
            android:src="@drawable/logo" />

    </RelativeLayout>

Error Stack:

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setEnabled(boolean)' on a null object reference

Body:
Giving id to your included layout like below:

<include android:id="@+id/actionbar"

overrides your parent id in your included layout.

In your case, changing your code to this should fix the problem:

View actionbar = findViewById(R.id.actionbar);
actionbar.setEnabled(false);
actionbar.setClickable(false);


来源: stackexchange

问:
Get data from database with PHP
I have the following PHP code but it doesn't work:

```<code><?php
$pid = "test123";
$conn = mysql_connect('localhost', 'user', 'password');
mysql_select_db('database');
$result = mysql_query('SELECT name FROM my_table WHERE
channel=$pid', $conn);
$content = mysql_result($result, 0);
echo $content;
?>
</code>```

I just get a blank page...

Can someone pls help me?! Thank's!

答:
This is how I would do it, in mysql and PDO.

Mysql

```<code>/*In the deprecated mysql extension*/
$pid = "test123";
/*connecting*/
$conn = mysql_connect('localhost', 'user', 'password');
mysql_select_db('database');
/*If this comes from outside you need to escape it*/
$pid = mysql_real_escape_string($pid, $conn);

/*Putting backtick around columns that are reserved words*/
$result = mysql_query("SELECT `name` FROM my_table WHERE
            `channel`= '$pid'", $conn);
$content = mysql_result($result, 0);
echo $content;
</code>```

PDO

```<code>/*In PDO*/
$pid = "test123";
$pdo = new PDO("mysql:host=localhost;dbname=database", 'user', 'password');
/*Putting backtick around columns that are reserved words*/
$query = "SELECT `name` FROM my_table WHERE
            `channel`= :pid";
$pdo_stmt = $pdo->prepare($query);
/*Prepared statements escape it for you*/
$pdo_stmt->bindValue(":pid", $pid);
$pdo_stmt->execute();

echo $pdo_stmt->fetchColumn();
</code>```

ContentLicense: CC BY-SA 4.0

Title: Get data from database with PHP

Body:
I have the following PHP code but it doesn't work:

<?php
$pid = "test123";
$conn = mysql_connect('localhost', 'user', 'password');
mysql_select_db('database');
$result = mysql_query('SELECT name FROM my_table WHERE
channel=$pid', $conn);
$content = mysql_result($result, 0);
echo $content;
?>

I just get a blank page...

Can someone pls help me?! Thank's!

Body:
This is how I would do it, in mysql and PDO.

Mysql

/*In the deprecated mysql extension*/
$pid = "test123";
/*connecting*/
$conn = mysql_connect('localhost', 'user', 'password');
mysql_select_db('database');
/*If this comes from outside you need to escape it*/
$pid = mysql_real_escape_string($pid, $conn);

/*Putting backtick around columns that are reserved words*/
$result = mysql_query("SELECT `name` FROM my_table WHERE
            `channel`= '$pid'", $conn);
$content = mysql_result($result, 0);
echo $content;

PDO

/*In PDO*/
$pid = "test123";
$pdo = new PDO("mysql:host=localhost;dbname=database", 'user', 'password');
/*Putting backtick around columns that are reserved words*/
$query = "SELECT `name` FROM my_table WHERE
            `channel`= :pid";
$pdo_stmt = $pdo->prepare($query);
/*Prepared statements escape it for you*/
$pdo_stmt->bindValue(":pid", $pid);
$pdo_stmt->execute();

echo $pdo_stmt->fetchColumn();


问:
Junit Testing for an Android Activity
Does any one have any experience with creating unit-test for the On Create and OnClick method in java, using Android Studio? I use data from my Firebasedatabase.
I think I have to use Mock-object, but I don't knot where to start.

Under is the code from my class LoginActivity

```<code>public class LoginActivity extends AppCompatActivity implements View.OnClickListener{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        mfireBaseAuth = FirebaseAuth.getInstance();
        mDatabase = FirebaseDatabase.getInstance().getReference();
        mProgressDialog = new ProgressDialog(this);
        editTextEmail = (EditText) findViewById(R.id.editTextEmail);
        editTextPassword = (EditText) findViewById(R.id.editTextPassword);
        buttonSignIn = (Button) findViewById(R.id.buttonSignIn);
        textViewSignUp = (TextView) findViewById(R.id.textViewSignUp);

        buttonSignIn.setOnClickListener(this);
        textViewSignUp.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        if(v == buttonSignIn){
            usersignin();

        }
        if(v==textViewSignUp){
            startActivity(new Intent(this, RegisterActivity.class));
        }
       }

    private void usersignin() {
        String email = editTextEmail.getText().toString().trim();
        String password = editTextPassword.getText().toString().trim();

        if(TextUtils.isEmpty(email)){
            Toast.makeText(this, "Please enter Email", Toast.LENGTH_SHORT).show();
            return;
        }

        if(TextUtils.isEmpty(password)){
            Toast.makeText(this, "Please enter password", Toast.LENGTH_SHORT).show();
            return;
        }

        mProgressDialog.setMessage("Logging in. Please wait...");
        mProgressDialog.show();
        mfireBaseAuth.signInWithEmailAndPassword(email, password).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
            @Override
            public void onComplete(@NonNull Task<AuthResult> task) {
                mProgressDialog.dismiss();
                if(task.isSuccessful()){
                    getSignedInUserProfile();
                }
            }
        });
    }

    private void getSignedInUserProfile() {

        DatabaseReference reference = mDatabase;//.child("eduback-2feef");
        firebaseUser = FirebaseAuth.getInstance().getCurrentUser();
        userID = firebaseUser.getUid();
        reference.child("Users").child(userID).child("User info").addListenerForSingleValueEvent(new ValueEventListener() {
            @Override
            public void onDataChange(DataSnapshot dataSnapshot) {
                User user = dataSnapshot.getValue(User.class);
                if(user != null) {
                    // Save if the user is student or prof in shared prefs.
                    PreferenceHelper helper = new PreferenceHelper(getBaseContext());
                    helper.setIsStudent(user.isStudent);
                    checkStudentOrProfessor(user);
                }

            }

            @Override
            public void onCancelled(DatabaseError databaseError) {
                // Ups vis error
            }
        });

    }

    private void checkStudentOrProfessor(User user) {

        Intent i;
        if (user.isStudent ) {
            i = new Intent(this, MainActivityStudent.class);
        } else {
            i = new Intent(this, MainActivityProfessor.class);
        }
        startActivity(i);

    }

}
</code>```

答:
The Mockito mocking framework for Java  offers compatibility with Android unit testing.

You can configure mock objects to return some specific value when invoked.

You don't need to test Firebasedatabass.

But you have to make Firebasedatabase wrapper class for yours view

Wrapper class have to include variable(userID, user.isStudent)

ContentLicense: CC BY-SA 3.0

Title: Junit Testing for an Android Activity

Body:
Does any one have any experience with creating unit-test for the On Create and OnClick method in java, using Android Studio? I use data from my Firebasedatabase.
I think I have to use Mock-object, but I don't knot where to start.

Under is the code from my class LoginActivity

public class LoginActivity extends AppCompatActivity implements View.OnClickListener{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        mfireBaseAuth = FirebaseAuth.getInstance();
        mDatabase = FirebaseDatabase.getInstance().getReference();
        mProgressDialog = new ProgressDialog(this);
        editTextEmail = (EditText) findViewById(R.id.editTextEmail);
        editTextPassword = (EditText) findViewById(R.id.editTextPassword);
        buttonSignIn = (Button) findViewById(R.id.buttonSignIn);
        textViewSignUp = (TextView) findViewById(R.id.textViewSignUp);

        buttonSignIn.setOnClickListener(this);
        textViewSignUp.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        if(v == buttonSignIn){
            usersignin();

        }
        if(v==textViewSignUp){
            startActivity(new Intent(this, RegisterActivity.class));
        }
       }

    private void usersignin() {
        String email = editTextEmail.getText().toString().trim();
        String password = editTextPassword.getText().toString().trim();

        if(TextUtils.isEmpty(email)){
            Toast.makeText(this, "Please enter Email", Toast.LENGTH_SHORT).show();
            return;
        }

        if(TextUtils.isEmpty(password)){
            Toast.makeText(this, "Please enter password", Toast.LENGTH_SHORT).show();
            return;
        }

        mProgressDialog.setMessage("Logging in. Please wait...");
        mProgressDialog.show();
        mfireBaseAuth.signInWithEmailAndPassword(email, password).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
            @Override
            public void onComplete(@NonNull Task<AuthResult> task) {
                mProgressDialog.dismiss();
                if(task.isSuccessful()){
                    getSignedInUserProfile();
                }
            }
        });
    }

    private void getSignedInUserProfile() {

        DatabaseReference reference = mDatabase;//.child("eduback-2feef");
        firebaseUser = FirebaseAuth.getInstance().getCurrentUser();
        userID = firebaseUser.getUid();
        reference.child("Users").child(userID).child("User info").addListenerForSingleValueEvent(new ValueEventListener() {
            @Override
            public void onDataChange(DataSnapshot dataSnapshot) {
                User user = dataSnapshot.getValue(User.class);
                if(user != null) {
                    // Save if the user is student or prof in shared prefs.
                    PreferenceHelper helper = new PreferenceHelper(getBaseContext());
                    helper.setIsStudent(user.isStudent);
                    checkStudentOrProfessor(user);
                }

            }

            @Override
            public void onCancelled(DatabaseError databaseError) {
                // Ups vis error
            }
        });

    }

    private void checkStudentOrProfessor(User user) {

        Intent i;
        if (user.isStudent ) {
            i = new Intent(this, MainActivityStudent.class);
        } else {
            i = new Intent(this, MainActivityProfessor.class);
        }
        startActivity(i);

    }

}


问:
How to update selected document in the backend using formula language?
In a view I have created a checkbox action button. The action button shows/hides the checkbox based on the formula I have set:

Form = "PrfForm" & AllotmentApprovalReq = "Yes"

Also I have checked "Evaluate actions for every document change" from the view properties. So based on the field "AllotmentApprovalReq" in the selected document the menu correctly shows/hides the checkbox on document selection.

Now what I want is that clicking this action button will do two things:

Set/Reset the field "AllotmentApprovalReq" which itself is a checkbox, in the selected document, depending upon its previous state.

Toggle the status of the checkbox menu, that is, show checkbox or hide it, again depending upon its previous state.

Any help will be highly appreciated.

答:
Setting a field is as easy as

```<code>FIELD AllotmentApprovalReq := "Yes";
</code>```

Or

FIELD AllotmentApprovalReq := "No";

If you want to toggle the value, then you would use

```<code>FIELD AllotmentApprovalReq := @If(AllotmentApprovalReq = "Yes";"No";"Yes");
</code>```

Since you have already set 'Evaluate actions for every document change', you should not have to do anything to refresh the action button. It should be automatic.

Body:
Setting a field is as easy as

FIELD AllotmentApprovalReq := "Yes";

Or

FIELD AllotmentApprovalReq := "No";

If you want to toggle the value, then you would use

FIELD AllotmentApprovalReq := @If(AllotmentApprovalReq = "Yes";"No";"Yes");

Since you have already set 'Evaluate actions for every document change', you should not have to do anything to refresh the action button. It should be automatic.


问:
Python OOP object instantiation
I am new to Python, and I have one dilemma concerning OOP (I am familiar with OOP concepts).

Basically, I have a class with a static class-variable (counter that shows how many objects I have instantiated):

```<code>class Employee:
   counter=0
   def __init__(self,name):
     self.name=name
     Employee.counter+=1
</code>```

So now I instantiate an object:

```<code>obj1=Employee("Alan")
</code>```

My question is: what happens when I have this call? What happens behind, because the static variable "counter" is incremented, but it is possible to access the object created like this?

```<code>Employee("foo")
</code>```

<__main__.Employee object at 0x02A16870>

Thanks

答:
```<code>Employee("foo")
</code>```

This object created above will be lost as soon as it is used and cannot be re-used whereas when you instantiate an object like

```<code>obj1=Employee("Alan")
</code>```

you have a reference of that object in obj1 and it can be re-used.

My question what happens when I have this call? What happens behind

The __init__ function is the constructor and it is called each time you create a new object of your class. As this __init__ function increments the counter variable, so each time an object is created, __init__ function is called and counter gets incremented.

Title: Python OOP object instantiation

Body:
I am new to Python, and I have one dilemma concerning OOP (I am familiar with OOP concepts).

Basically, I have a class with a static class-variable (counter that shows how many objects I have instantiated):

class Employee:
   counter=0
   def __init__(self,name):
     self.name=name
     Employee.counter+=1

So now I instantiate an object:

obj1=Employee("Alan")

My question is: what happens when I have this call? What happens behind, because the static variable "counter" is incremented, but it is possible to access the object created like this?

Employee("foo")

<__main__.Employee object at 0x02A16870>

Thanks

Body:
Employee("foo")

This object created above will be lost as soon as it is used and cannot be re-used whereas when you instantiate an object like

obj1=Employee("Alan")

you have a reference of that object in obj1 and it can be re-used.

My question what happens when I have this call? What happens behind

The __init__ function is the constructor and it is called each time you create a new object of your class. As this __init__ function increments the counter variable, so each time an object is created, __init__ function is called and counter gets incremented.


问:
Service Worker Offline mode
I created a service worker and it caches all the files and it works offline. What I want is to have on Android the Offline label like in image.

The github demo for that page is here. I read the code but didn't found anything that would set that Offline in the left of Url bar.

I cheked multiple websites that have service workers but this is the online one that that I found that has that label.

答:
The label is actually not related to service workers. Chrome for Android let's you download web pages for offline use, and the label is shown when you are viewing a downloaded version of a page.

See here for an example: https://www.quora.com/How-do-I-save-a-web-page-for-offline-reading-in-Chrome-Android

Title: Service Worker Offline mode


问:
Compiling and running in different containers
I have a project which compiles to a binary file, and running that binary file exposes some REST APIs.

To compile the project I need docker image A which has the compiler and and all the libraries required to produce the executable. To run the executable (ie. host the service) I can get away with a much smaller image B (just basic linux distro, no need for the compiler).

How does one use docker is such a situation?

答:
My thinking for this scenario is that you can prepare two base images:

The 1st one, which includes compiler and all libs for building your executable, call it base-image:build

The 2nd one, as the base image to build your final image to delivery, call it base-image:runtime

And then  break your build process into two steps:

Step 1: build your executable inside base-image:build, and then put your executable to some place, like NFS or any registry from where you can fetch it for later use;

Step 2: write your Dockerfile which FROM base-image:runtime, fetch your artifact/executable from wherever generated by Step 1, docker build your delivery image, and then docker push to your registry for release.

Hope this could be helpful :-)


问:
What is the maximum size of bars in a barchart?
I have a Bar chart in my crystal report. In one scenario I am getting 84 bars in a bar chart. Data values are overlapping with each other. I tried to increase chart size but didn't work. Can you tell me what is the maximum limit of bars so that I can limit my data to display bars with Data labels.</p>

答:
There is no maximum limit of bars. The display result of your chart depends on the modification of some parameters like the bar width, the gap between them, the width of your page, the orientation etc. For example here you can see a barchart with 269 bars

It has to do with what you want. I advise you to preview your chart and try many changes to your Chart Options until you have the needed result. You can also show us a snapshot with your result to give you more specific advice.


问:
get jackson to ignore a field in a map
I am combining Spring Boot and jongo/mongo to create a dynamic mongo app that does not use POJO's.  Everything in and out of the database is a Map<String, Object>.  I have everything working exactly the way I want, except one thing.  I don't want to send _id from mongo to the client.  This system uses a "mark obsolete and insert new record" style of updates so we can maintain a change history for the document.  therefore, I don't want any client to even be tempted to use the _id field, I have another I want them to use.

Now I find all kinds of examples on how to ignore fields in pojo's, but i want to write a Jackson Map serializer that ignores a specific value of the map.  I can't find anything like that yet.  I suppose gson would do as well, I just don't currently have spring configured for gson.

any idea how to write this serializer?

答:
I would not try to make Jackson make the work mongo can simply do.

The mongo documentation explicitly has a use case that is named Return All But the Excluded Fields which is exactly what you want:

```<code>db.inventory.find( { fieldA: "A" }, { _id: 0 } )
</code>```

Get all documents with fieldA set to "A", return all fields, except for the _id field.

You course the query above is the JavaScript Mongo query language, but you should not get problems to convert it to the Mongo Java api.

Title: get jackson to ignore a field in a map

Body:
I would not try to make Jackson make the work mongo can simply do.

The mongo documentation explicitly has a use case that is named Return All But the Excluded Fields which is exactly what you want:

db.inventory.find( { fieldA: "A" }, { _id: 0 } )

Get all documents with fieldA set to "A", return all fields, except for the _id field.

You course the query above is the JavaScript Mongo query language, but you should not get problems to convert it to the Mongo Java api.


问:
Why does my AWS instance have much less memory than listed in the specs?
I'm running a Cassandra cluster on a trio of EC2 i3.large instances.  When I run the linux command df, I get the following:

It says that I have 34,732,828 1K blocks in total.  That equals approximately 34 GB.  However, the AWS website lists the following specs:

Why do I only have 34 GB if the instance has a 475 GB SSD?

答:
Instance Store Volumes are not mounted by default. For i3.large instance type, it will be attached to the instance as device /dev/nvme01n1. It is the user's responsibility to format the device and mount it.

Use this command to list the attached devices

```<code>sudo fdisk -l
</code>```

Refer here on how to format and mount the device.

Body:
Instance Store Volumes are not mounted by default. For i3.large instance type, it will be attached to the instance as device /dev/nvme01n1. It is the user's responsibility to format the device and mount it.

Use this command to list the attached devices

sudo fdisk -l

Refer here on how to format and mount the device.


问:
How to configure nginx to run Wordpress and Django
I've looked at a couple similar question, but they didn't seem to be any help.  I've got a vultr.com instance running a Wordpress in the default 1 click configuration.  Centos6 if that matters. This is (and I would like it to remain) in the root (www.mysite.com).  I would like to have my Django app running in www.mysite.com/crossfaded/.  I don't want any downtime for my current server, so there is no domain name associated with the server yet. I'm trying to do this just using the IP.

The Wordpress site is working fine.

I've been following the guide here as then tried this one, but when I navigate to http://ip.add.re.ss/crossfaded/media/apple.jpg in my browser, I get a 404 from nginx. Going /crossfaded/media/ gives me a 403 from nginx and /crossfaded/invalidpath/ gives me a 404 served by Wordpress, so something is happening with the routing. I did chmod 777 apple.jpg on the off-chance it was a permissions issue, but that didn't do anything.

I have a hunch I've got the syntax of the location block muddled, but I'm really not sure.

wordpress_http.conf

```<code>upstream php-handler-http {
        server 127.0.0.1:9000;
        #server unix:/var/run/php5-fpm.sock;
}

server {
        listen 80 default_server;
        server_name _;
        #server_name wordpress.example.com;

        root /var/www/html/;
        index index.php;

        # set max upload size
        client_max_body_size 2G;
        fastcgi_buffers 64 4K;

        access_log /var/log/nginx/wordpress_http_access.log combined;
        error_log /var/log/nginx/wordpress_http_error.log;

        location = /favicon.ico {
                log_not_found off;
                access_log off;
        }

        location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
        }

        location / {
                try_files $uri $uri/ /index.php?$args ;
        }

        location ^~ /wp-admin/ {
                auth_basic "Restricted";
                auth_basic_user_file /etc/nginx/htpasswd/wpadmin;

                location ~* \.(htaccess|htpasswd) {
                        deny all;
                }

                location ~ \.php(?:$|/) {
                        fastcgi_split_path_info ^(.+\.php)(/.+)$;
                        include fastcgi_params;
                        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                        fastcgi_param PATH_INFO $fastcgi_path_info;
                        fastcgi_pass php-handler-http;
                        fastcgi_read_timeout 60s;
                }
        }

        location ~* \.(htaccess|htpasswd) {
                deny all;
        }

        location ~ \.php(?:$|/) {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                fastcgi_pass php-handler-http;
                fastcgi_read_timeout 60s;
        }

        # set long EXPIRES header on static assets
        location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
                expires 30d;
                access_log off;
        }

location ~ /crossfaded/static/ {
            alias /root/crossfaded/static/;
    }

    location ~ /crossfaded/media/ {
        alias /root/crossfaded/media/ ;
    }
}
</code>```

答:
There were two problems:

I needed a caret (^) in the location of the alias, so:

```<code>location ^~ /crossfaded/static/ {
            alias /root/crossfaded/static/;
        }

location ^~ /crossfaded/media/ {
        alias /root/crossfaded/media/ ;
      }
</code>```

The server defaulted ~/ to /root/.  Nginx needs r-x permissions to all directories from / to the file in question.  It did not have that.  Moved the project directory to /home/.

Body:
I've looked at a couple similar question, but they didn't seem to be any help.  I've got a vultr.com instance running a Wordpress in the default 1 click configuration.  Centos6 if that matters. This is (and I would like it to remain) in the root (www.mysite.com).  I would like to have my Django app running in www.mysite.com/crossfaded/.  I don't want any downtime for my current server, so there is no domain name associated with the server yet. I'm trying to do this just using the IP.

The Wordpress site is working fine.

I've been following the guide here as then tried this one, but when I navigate to http://ip.add.re.ss/crossfaded/media/apple.jpg in my browser, I get a 404 from nginx. Going /crossfaded/media/ gives me a 403 from nginx and /crossfaded/invalidpath/ gives me a 404 served by Wordpress, so something is happening with the routing. I did chmod 777 apple.jpg on the off-chance it was a permissions issue, but that didn't do anything.

I have a hunch I've got the syntax of the location block muddled, but I'm really not sure.

wordpress_http.conf

upstream php-handler-http {
        server 127.0.0.1:9000;
        #server unix:/var/run/php5-fpm.sock;
}

server {
        listen 80 default_server;
        server_name _;
        #server_name wordpress.example.com;

        root /var/www/html/;
        index index.php;

        # set max upload size
        client_max_body_size 2G;
        fastcgi_buffers 64 4K;

        access_log /var/log/nginx/wordpress_http_access.log combined;
        error_log /var/log/nginx/wordpress_http_error.log;

        location = /favicon.ico {
                log_not_found off;
                access_log off;
        }

        location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
        }

        location / {
                try_files $uri $uri/ /index.php?$args ;
        }

        location ^~ /wp-admin/ {
                auth_basic "Restricted";
                auth_basic_user_file /etc/nginx/htpasswd/wpadmin;

                location ~* \.(htaccess|htpasswd) {
                        deny all;
                }

                location ~ \.php(?:$|/) {
                        fastcgi_split_path_info ^(.+\.php)(/.+)$;
                        include fastcgi_params;
                        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                        fastcgi_param PATH_INFO $fastcgi_path_info;
                        fastcgi_pass php-handler-http;
                        fastcgi_read_timeout 60s;
                }
        }

        location ~* \.(htaccess|htpasswd) {
                deny all;
        }

        location ~ \.php(?:$|/) {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                fastcgi_pass php-handler-http;
                fastcgi_read_timeout 60s;
        }

        # set long EXPIRES header on static assets
        location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
                expires 30d;
                access_log off;
        }

location ~ /crossfaded/static/ {
            alias /root/crossfaded/static/;
    }

    location ~ /crossfaded/media/ {
        alias /root/crossfaded/media/ ;
    }
}

Body:
There were two problems:

I needed a caret (^) in the location of the alias, so:

location ^~ /crossfaded/static/ {
            alias /root/crossfaded/static/;
        }

location ^~ /crossfaded/media/ {
        alias /root/crossfaded/media/ ;
      }

The server defaulted ~/ to /root/.  Nginx needs r-x permissions to all directories from / to the file in question.  It did not have that.  Moved the project directory to /home/.


问:
Prolog why the following term doesn't unify?
In prolog = is used for unification, as far as I understand if the two terms can be matched maybe with the help if variable instantiation, they are unified.

So why the following query fails

```<code>?- 2+2 = 4.
</code>```

Although 2+2 yields into 4 which is the same number as the other term.

答:
What others have answered is correct, but here's a little more detail.

In Prolog, the term 2+2 is just a syntactical alternative to the term, '+'(2, 2). This is a term with functor + and with two arguments (2 and 2). The term 2 is just an interger and has no arguments. The =/2 operator attempts to unify terms. It does not perform arithmetic expression evaluation. These terms are clearly different and cannot be unified (they don't even have the same number of arguments).

There are operators in Prolog which will perform the expression evaluation. For expression equality, you can use =:=/2 or better, as @mat points out for reasoning over integers,  you can use #=/2. So the following will work:

```<code>| ?- 2+2 =:= 4.

yes
| ?- 2+2 #= 4.

yes
| ?-
</code>```

There is also is/2 which will evaluate the second argument only and determine if it's value is the same as the value of the first argument. Thus the following will happen:

```<code>| ?- 2+2 is 4.

no
| ?- 4 is 2+2.

yes
| ?-
</code>```

The above examples are in GNU prolog. Note that in SWI Prolog you must include the CLP(FD) library to use operators that reason over integers:

```<code>:- use_module(library(clpfd)).
</code>```

Body:
In prolog = is used for unification, as far as I understand if the two terms can be matched maybe with the help if variable instantiation, they are unified.

So why the following query fails

?- 2+2 = 4.

Although 2+2 yields into 4 which is the same number as the other term.

Body:
What others have answered is correct, but here's a little more detail.

In Prolog, the term 2+2 is just a syntactical alternative to the term, '+'(2, 2). This is a term with functor + and with two arguments (2 and 2). The term 2 is just an interger and has no arguments. The =/2 operator attempts to unify terms. It does not perform arithmetic expression evaluation. These terms are clearly different and cannot be unified (they don't even have the same number of arguments).

There are operators in Prolog which will perform the expression evaluation. For expression equality, you can use =:=/2 or better, as @mat points out for reasoning over integers,  you can use #=/2. So the following will work:

| ?- 2+2 =:= 4.

yes
| ?- 2+2 #= 4.

yes
| ?-

There is also is/2 which will evaluate the second argument only and determine if it's value is the same as the value of the first argument. Thus the following will happen:

| ?- 2+2 is 4.

no
| ?- 4 is 2+2.

yes
| ?-

The above examples are in GNU prolog. Note that in SWI Prolog you must include the CLP(FD) library to use operators that reason over integers:

:- use_module(library(clpfd)).


问:
JavaScript - Stop Bubbling
I wondered if someone could take a look at the following JS I need help on? What I want to happen is to be able to click the div and the alert box "Here" appear, which it does. I also want to be able to click the a and have the "Anchor" alert appear, which it does.

The problem is that the "Here" alert box then appears again. I've tried using .stopPropagation() but is not working as expected.

My code:

function testMessage() {
  alert("Here");
}

function anchorClick() {
  alert("Anchor");
  this.stopPropagation();
}

var products = document.getElementsByClassName('Wrapper')
var tags = document.getElementsByTagName('a')

for (let i = 0; i < products.length; i++) {
  products[i].onclick = function() {
    testMessage();
  }
}

for (let i = 0; i < tags.length; i++) {
  tags[i].onclick = function() {
    anchorClick();
  }
}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>#Wrapper,
#Wrapper2 {
  height: 250px;
  width: 250px;
  background: #fff;
  cursor: pointer;
}</code>```

  Link1
  Link2
  Link3

  Link1
  Link2
  Link3

```

Please can you advise?

Cheers
Chris

答:
You have to pass the event to your function, you are using this which refers to window.

function testMessage() {
  alert("Here");
}

function anchorClick(e) {
  alert("Anchor");
  e.stopPropagation();
}

var products = document.getElementsByClassName('Wrapper')
var tags = document.getElementsByTagName('a')

for (let i = 0; i < products.length; i++) {
  products[i].onclick = function() {
    testMessage();
  }
}

for (let i = 0; i < tags.length; i++) {
  tags[i].onclick = function(e) {
    anchorClick(e);
  }
}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>#Wrapper,
#Wrapper2 {
  height: 250px;
  width: 250px;
  background: #fff;
  cursor: pointer;
}</code>```

  Link1
  Link2
  Link3

  Link1
  Link2
  Link3

```
</div>
</div>
</p>

<p>BTW, it's not necessary to declare a function to call your event function, if you have this:</p>

```products[i].onclick = function() {
    testMessage();
}
```

<p>You can assign your <code>testMessage</code> function directly:</p>

```products[i].onclick = testMessage;
```

Title: JavaScript - Stop Bubbling

Body:
I wondered if someone could take a look at the following JS I need help on? What I want to happen is to be able to click the div and the alert box "Here" appear, which it does. I also want to be able to click the a and have the "Anchor" alert appear, which it does.

The problem is that the "Here" alert box then appears again. I've tried using .stopPropagation() but is not working as expected.

My code:

function testMessage() {
  alert("Here");
}

function anchorClick() {
  alert("Anchor");
  this.stopPropagation();
}

var products = document.getElementsByClassName('Wrapper')
var tags = document.getElementsByTagName('a')

for (let i = 0; i < products.length; i++) {
  products[i].onclick = function() {
    testMessage();
  }
}

for (let i = 0; i < tags.length; i++) {
  tags[i].onclick = function() {
    anchorClick();
  }
}

#Wrapper,
#Wrapper2 {
  height: 250px;
  width: 250px;
  background: #fff;
  cursor: pointer;
}

  Link1
  Link2
  Link3

  Link1
  Link2
  Link3

Please can you advise?

Cheers
Chris

Body:
You have to pass the event to your function, you are using this which refers to window.

function testMessage() {
  alert("Here");
}

function anchorClick(e) {
  alert("Anchor");
  e.stopPropagation();
}

var products = document.getElementsByClassName('Wrapper')
var tags = document.getElementsByTagName('a')

for (let i = 0; i < products.length; i++) {
  products[i].onclick = function() {
    testMessage();
  }
}

for (let i = 0; i < tags.length; i++) {
  tags[i].onclick = function(e) {
    anchorClick(e);
  }
}

#Wrapper,
#Wrapper2 {
  height: 250px;
  width: 250px;
  background: #fff;
  cursor: pointer;
}

<div class="Wrapper">
  <a href="#" class="anchor">Link1</a>
  <a href="#" class="anchor">Link2</a>
  <a href="#" class="anchor">Link3</a>
</div>

<div class="Wrapper">
  <a href="#" class="anchor">Link1</a>
  <a href="#" class="anchor">Link2</a>
  <a href="#" class="anchor">Link3</a>
</div>

BTW, it's not necessary to declare a function to call your event function, if you have this:

products[i].onclick = function() {
    testMessage();
}

You can assign your testMessage function directly:

products[i].onclick = testMessage;


问:
Using keystoneJS with another database
Currently I need to create admin ui, using google cloud datastore as user storage, and google functions as controllers.
I found the Keystone JS CMS platform, which uses mongoDB for storing user data, so I am looking for the chance to use it with google cloud datastore.

Is it possible to create some driver that will redirect all the keystone db requests not to mongodb, but in Google Datastore?

答: The core of Keystone is built on top of Mongo (and Mongoose) functions and code. At the moment, there isn't another way to use Keystone with another database type or provider. See this GitHub issue for some more information that may be of use.</p>

Title: Using keystoneJS with another database


问:
app.config file is not giving connection properly
I am on a desktop application and retrieving the list of databases on a local server
by this function

```<code>/// <summary>
/// This function populates the databases list in the drop down after the user is connected.
/// </summary>
public void BindDBDropDown()

        {

        //Create the connection object
        SqlConnection sConnection = new SqlConnection("Server=192.168.10.3;DataBase=GoalPlanNew;User Id=gp;Password=gp");

        //To Open the connection.
        sConnection.Open();

        //Query to select the list of databases.
        string selectDatabaseNames = @"SELECT
                                            NAME
                                        FROM
                                            MASTER..SYSDATABASES";

        //Create the command object
        SqlCommand sCommand = new SqlCommand(selectDatabaseNames, sConnection);

        try
            {
            //Create the data set
            DataSet sDataset = new DataSet("master..sysdatabases");

            //Create the dataadapter object
            SqlDataAdapter sDataAdapter = new SqlDataAdapter(selectDatabaseNames, sConnection);
            sDataAdapter.TableMappings.Add("Table", "master..sysdatabases");

            //Fill the dataset
            sDataAdapter.Fill(sDataset);

            //Bind the database names in combobox
            DataViewManager dsv = sDataset.DefaultViewManager;

            //Provides the master mapping between the sourcr table and system.data.datatable
            cmbDatabases.DataSource = sDataset.Tables["master..sysdatabases"];
            cmbDatabases.DisplayMember = "NAME";
            cmbDatabases.ValueMember = ("NAME");
            }
        catch(Exception ex)
            {
            //All the exceptions are handled and written in the EventLog.
            EventLog logException = new EventLog("Application");
            logException.Source = "MFDBAnalyser";
            logException.WriteEntry(ex.Message);
            }
        finally
            {
            //If connection is not closed then close the connection
            if(sConnection.State != ConnectionState.Closed)
                {
                sConnection.Close();
                }
            }
        }
</code>```

This function is working fine if I am letting it to be hardcoded but when I tried to use the connection string declared in the app.config file as

```<code><?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="ConnectionString" value="Server=192.168.10.3;DataBase=GoalPlanNew;User Id=gp;Password=gp"/>
  </appSettings>
</configuration>
</code>```

Then it is not working...

What I need to do??

答:
You can get easy access to app settings from the AppSettingsReader class in the System.Configuration namespace and library.

```<code>AppSettingsReader asr = new AppSettingsReader();
SqlConnection sConnection = new SqlConnection(asr.GetValue("ConnectionString", typeof(string)).ToString());
</code>```

But for a connection string, Microsoft have provided the ConnectionStringSection

You use that in your app.config file, similarly to the app settings section:

```<code><configuration>
  <connectionStrings>
    <add name="ConnectionString" connectionString="Server=192.168.10.3;DataBase=GoalPlanNew;User Id=gp;Password=gp"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
</configuration>
</code>```

and access it like this:

```<code>SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString)
</code>```

But, as MrEyes says, you need to make sure your app.config file is in your main application's project, otherwise it's not automatically used as the default configuration for your application.

ContentLicense: CC BY-SA 2.5

Body:
I am on a desktop application and retrieving the list of databases on a local server
by this function

///
/// This function populates the databases list in the drop down after the user is connected.
///
public void BindDBDropDown()

        {

        //Create the connection object
        SqlConnection sConnection = new SqlConnection("Server=192.168.10.3;DataBase=GoalPlanNew;User Id=gp;Password=gp");

        //To Open the connection.
        sConnection.Open();

        //Query to select the list of databases.
        string selectDatabaseNames = @"SELECT
                                            NAME
                                        FROM
                                            MASTER..SYSDATABASES";

        //Create the command object
        SqlCommand sCommand = new SqlCommand(selectDatabaseNames, sConnection);

        try
            {
            //Create the data set
            DataSet sDataset = new DataSet("master..sysdatabases");

            //Create the dataadapter object
            SqlDataAdapter sDataAdapter = new SqlDataAdapter(selectDatabaseNames, sConnection);
            sDataAdapter.TableMappings.Add("Table", "master..sysdatabases");

            //Fill the dataset
            sDataAdapter.Fill(sDataset);

            //Bind the database names in combobox
            DataViewManager dsv = sDataset.DefaultViewManager;

            //Provides the master mapping between the sourcr table and system.data.datatable
            cmbDatabases.DataSource = sDataset.Tables["master..sysdatabases"];
            cmbDatabases.DisplayMember = "NAME";
            cmbDatabases.ValueMember = ("NAME");
            }
        catch(Exception ex)
            {
            //All the exceptions are handled and written in the EventLog.
            EventLog logException = new EventLog("Application");
            logException.Source = "MFDBAnalyser";
            logException.WriteEntry(ex.Message);
            }
        finally
            {
            //If connection is not closed then close the connection
            if(sConnection.State != ConnectionState.Closed)
                {
                sConnection.Close();
                }
            }
        }

This function is working fine if I am letting it to be hardcoded but when I tried to use the connection string declared in the app.config file as

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="ConnectionString" value="Server=192.168.10.3;DataBase=GoalPlanNew;User Id=gp;Password=gp"/>
  </appSettings>
</configuration>

Then it is not working...

What I need to do??

Body:
You can get easy access to app settings from the AppSettingsReader class in the System.Configuration namespace and library.

AppSettingsReader asr = new AppSettingsReader();
SqlConnection sConnection = new SqlConnection(asr.GetValue("ConnectionString", typeof(string)).ToString());

But for a connection string, Microsoft have provided the ConnectionStringSection

You use that in your app.config file, similarly to the app settings section:

<configuration>
  <connectionStrings>
    <add name="ConnectionString" connectionString="Server=192.168.10.3;DataBase=GoalPlanNew;User Id=gp;Password=gp"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
</configuration>

and access it like this:

SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString)

But, as MrEyes says, you need to make sure your app.config file is in your main application's project, otherwise it's not automatically used as the default configuration for your application.


问:
ms-access shorten vba code
I'm using the following code alot in my project:

```<code>txtVoornaam.Locked = False
txtVoornaam.BorderStyle = 4
txtVoornaam.BorderColor = RGB(255, 165, 0

txtAchternaam.Locked = False
txtAchternaam.BorderStyle = 4
txtAchternaam.BorderColor = RGB(255, 165, 0)

txtAfdeling.Locked = False
txtAfdeling.BorderStyle = 4
txtAfdeling.BorderColor = RGB(255, 165, 0)
</code>```

I wonder if there is a way to not display this in my code or shorten this. The code gets very long if i use this a few times..

答:
```<code>function Lockdown(strControl)

with me(strControl)
   .locked = false
   .borderstyle = 4
   .bordercolor = RGB(255,165,0)
end with
</code>```

use me or forms!formname depending on where you're calling from

Title: ms-access shorten vba code

Body:
I'm using the following code alot in my project:

txtVoornaam.Locked = False
txtVoornaam.BorderStyle = 4
txtVoornaam.BorderColor = RGB(255, 165, 0

txtAchternaam.Locked = False
txtAchternaam.BorderStyle = 4
txtAchternaam.BorderColor = RGB(255, 165, 0)

txtAfdeling.Locked = False
txtAfdeling.BorderStyle = 4
txtAfdeling.BorderColor = RGB(255, 165, 0)

I wonder if there is a way to not display this in my code or shorten this. The code gets very long if i use this a few times..

Body:
function Lockdown(strControl)

with me(strControl)
   .locked = false
   .borderstyle = 4
   .bordercolor = RGB(255,165,0)
end with

use me or forms!formname depending on where you're calling from


问:
Can't install SQL Server 2014 on WIndows 7 - HRESULT 0x8007370B
I keep receiving the following errors:

```
TITLE: Microsoft SQL Server 2014 Setup
------------------------------

The following error has occurred:

An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.

For help, click: http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft%20SQL%20Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=0xDF039760%25401201%25401

------------------------------
BUTTONS:

OK
------------------------------
```

and then the following error:

Googling on HRESULT 8007370B doesn't yield much results except for people who are looking for "System Update Readiness".

I've run multiple "registry fix" programs;
sfc /SCANNOW gives me the error "windows resource protection could not perform the requested operation".

Anyone have any ideas?

Here is the log file:

```

    Overall summary:
      Final result:                  Failed: see details below
      Exit code (Decimal):           -2068052081
      Start time:                    2014-12-08 14:07:24
      End time:                      2014-12-08 14:16:06
      Requested action:              Install

    Setup completed with required actions for features.
    Troubleshooting information for those features:
      Next step for Adv_SSMS:        Use the following information to resolve the error, and then try the setup process again.
      Next step for Conn:            Use the following information to resolve the error, and then try the setup process again.
      Next step for SDK:             Use the following information to resolve the error, and then try the setup process again.
      Next step for BC:              Use the following information to resolve the error, and then try the setup process again.
      Next step for SSMS:            Use the following information to resolve the error, and then try the setup process again.
      Next step for RS:              Use the following information to resolve the error, and then try the setup process again.
      Next step for SQLEngine:       Use the following information to resolve the error, and then try the setup process again.
      Next step for FullText:        Use the following information to resolve the error, and then try the setup process again.
      Next step for Replication:     Use the following information to resolve the error, and then try the setup process again.
      Next step for Browser:         Use the following information to resolve the error, and then try the setup process again.
      Next step for BOL:             Use the following information to resolve the error, and then try the setup process again.
      Next step for ComponentUpdate: Use the following information to resolve the error, and then try the setup process again.

    Machine Properties:
      Machine name:                  DHW018661
      Machine processor count:       4
      OS version:                    Windows 7
      OS service pack:               Service Pack 1
      OS region:                     United States
      OS language:                   English (United States)
      OS architecture:               x64
      Process architecture:          64 Bit
      OS clustered:                  No

    Product features discovered:
      Product              Instance             Instance ID                    Feature                                  Language             Edition              Version         Clustered  Configured

    Package properties:
      Description:                   Microsoft SQL Server 2014
      ProductName:                   SQL Server 2014
      Type:                          RTM
      Version:                       12
      SPLevel:                       0
      Installation location:         E:\x64\setup\
      Installation edition:          Express

    Product Update Status:
      None discovered.

    User Input Settings:
      ACTION:                        Install
      ADDCURRENTUSERASSQLADMIN:      true
      AGTSVCACCOUNT:                 NT AUTHORITY\NETWORK SERVICE
      AGTSVCPASSWORD:                *****
      AGTSVCSTARTUPTYPE:             Disabled
      ASBACKUPDIR:                   Backup
      ASCOLLATION:                   Latin1_General_CI_AS
      ASCONFIGDIR:                   Config
      ASDATADIR:                     Data
      ASLOGDIR:                      Log
      ASPROVIDERMSOLAP:              1
      ASSERVERMODE:                  MULTIDIMENSIONAL
      ASSVCACCOUNT:
      ASSVCPASSWORD:
      ASSVCSTARTUPTYPE:              Automatic
      ASSYSADMINACCOUNTS:
      ASTEMPDIR:                     Temp
      BROWSERSVCSTARTUPTYPE:         Disabled
      CLTCTLRNAME:
      CLTRESULTDIR:
      CLTSTARTUPTYPE:                0
      CLTSVCACCOUNT:
      CLTSVCPASSWORD:
      CLTWORKINGDIR:
      COMMFABRICENCRYPTION:          0
      COMMFABRICNETWORKLEVEL:        0
      COMMFABRICPORT:                0
      CONFIGURATIONFILE:             C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\ConfigurationFile.ini
      CTLRSTARTUPTYPE:               0
      CTLRSVCACCOUNT:
      CTLRSVCPASSWORD:
      CTLRUSERS:
      ENABLERANU:                    true
      ENU:                           true
      ERRORREPORTING:                false
      FEATURES:                      SQLENGINE, REPLICATION, FULLTEXT, RS, CONN, BC, SDK, BOL, SSMS, ADV_SSMS, LOCALDB
      FILESTREAMLEVEL:               0
      FILESTREAMSHARENAME:
      FTSVCACCOUNT:                  NT Service\MSSQLFDLauncher$SQLEXPRESS
      FTSVCPASSWORD:
      HELP:                          false
      IACCEPTSQLSERVERLICENSETERMS:  true
      INDICATEPROGRESS:              false
      INSTALLSHAREDDIR:              C:\Program Files\Microsoft SQL Server\
      INSTALLSHAREDWOWDIR:           C:\Program Files (x86)\Microsoft SQL Server\
      INSTALLSQLDATADIR:
      INSTANCEDIR:                   C:\Program Files\Microsoft SQL Server\
      INSTANCEID:                    SQLEXPRESS
      INSTANCENAME:                  SQLEXPRESS
      ISSVCACCOUNT:                  NT AUTHORITY\Network Service
      ISSVCPASSWORD:
      ISSVCSTARTUPTYPE:              Automatic
      MATRIXCMBRICKCOMMPORT:         0
      MATRIXCMSERVERNAME:
      MATRIXNAME:
      NPENABLED:                     0
      PID:                           *****
      QUIET:                         false
      QUIETSIMPLE:                   false
      ROLE:                          AllFeatures_WithDefaults
      RSINSTALLMODE:                 DefaultNativeMode
      RSSHPINSTALLMODE:              DefaultSharePointMode
      RSSVCACCOUNT:                  NT Service\ReportServer$SQLEXPRESS
      RSSVCPASSWORD:
      RSSVCSTARTUPTYPE:              Automatic
      SAPWD:
      SECURITYMODE:
      SQLBACKUPDIR:
      SQLCOLLATION:                  Latin1_General_CI_AS
      SQLSVCACCOUNT:                 NT Service\MSSQL$SQLEXPRESS
      SQLSVCPASSWORD:
      SQLSVCSTARTUPTYPE:             Automatic
      SQLSYSADMINACCOUNTS:           HEAD_OFFICE\clozid1
      SQLTEMPDBDIR:
      SQLTEMPDBLOGDIR:
      SQLUSERDBDIR:
      SQLUSERDBLOGDIR:
      SQMREPORTING:                  false
      TCPENABLED:                    0
      UIMODE:                        Normal
      UpdateEnabled:                 true
      UpdateSource:                  MU
      USEMICROSOFTUPDATE:            false
      X86:                           false

      Configuration file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\ConfigurationFile.ini

    Detailed results:
      Feature:                       Management Tools - Complete
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

      Feature:                       Client Tools Connectivity
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

      Feature:                       Client Tools SDK
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

      Feature:                       Client Tools Backwards Compatibility
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

      Feature:                       Management Tools - Basic
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

      Feature:                       Reporting Services - Native
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

      Feature:                       Database Engine Services
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

      Feature:                       Full-Text and Semantic Extractions for Search
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

      Feature:                       SQL Server Replication
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

      Feature:                       SQL Browser
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

      Feature:                       Documentation Components
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

      Feature:                       LocalDB
      Status:                        Passed

      Feature:                       Setup Support Files
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred during the setup process of the feature.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

    Rules with failures:

    Global rules:

    Scenario specific rules:

    Rules report file:               C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SystemConfigurationCheck_Report.htm

```

EDIT: I installed 2008 R2 on the same machine with no problems. I then tried both a full install of 2014 and an "upgrade" install, both resulting in the same error above.

答: I downloaded the fresh copy from microsoft website for the installation and installation succeeded perfectly. As others are saying to check the prerequisites for the installation. It is by default tested by the setup of sql. I only proceed after completing the prerequisite. but there were errors. but with clean copy of iso downloaded from microsoft it resolved. </p>

Body:
I keep receiving the following errors:

TITLE: Microsoft SQL Server 2014 Setup
------------------------------

The following error has occurred:

An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.

For help, click: http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft%20SQL%20Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=0xDF039760%25401201%25401

------------------------------
BUTTONS:

OK
------------------------------

and then the following error:

Googling on HRESULT 8007370B doesn't yield much results except for people who are looking for "System Update Readiness".

I've run multiple "registry fix" programs;
sfc /SCANNOW gives me the error "windows resource protection could not perform the requested operation".

Anyone have any ideas?

Here is the log file:

    Overall summary:
      Final result:                  Failed: see details below
      Exit code (Decimal):           -2068052081
      Start time:                    2014-12-08 14:07:24
      End time:                      2014-12-08 14:16:06
      Requested action:              Install

    Setup completed with required actions for features.
    Troubleshooting information for those features:
      Next step for Adv_SSMS:        Use the following information to resolve the error, and then try the setup process again.
      Next step for Conn:            Use the following information to resolve the error, and then try the setup process again.
      Next step for SDK:             Use the following information to resolve the error, and then try the setup process again.
      Next step for BC:              Use the following information to resolve the error, and then try the setup process again.
      Next step for SSMS:            Use the following information to resolve the error, and then try the setup process again.
      Next step for RS:              Use the following information to resolve the error, and then try the setup process again.
      Next step for SQLEngine:       Use the following information to resolve the error, and then try the setup process again.
      Next step for FullText:        Use the following information to resolve the error, and then try the setup process again.
      Next step for Replication:     Use the following information to resolve the error, and then try the setup process again.
      Next step for Browser:         Use the following information to resolve the error, and then try the setup process again.
      Next step for BOL:             Use the following information to resolve the error, and then try the setup process again.
      Next step for ComponentUpdate: Use the following information to resolve the error, and then try the setup process again.

    Machine Properties:
      Machine name:                  DHW018661
      Machine processor count:       4
      OS version:                    Windows 7
      OS service pack:               Service Pack 1
      OS region:                     United States
      OS language:                   English (United States)
      OS architecture:               x64
      Process architecture:          64 Bit
      OS clustered:                  No

    Product features discovered:
      Product              Instance             Instance ID                    Feature                                  Language             Edition              Version         Clustered  Configured

    Package properties:
      Description:                   Microsoft SQL Server 2014
      ProductName:                   SQL Server 2014
      Type:                          RTM
      Version:                       12
      SPLevel:                       0
      Installation location:         E:\x64\setup\
      Installation edition:          Express

    Product Update Status:
      None discovered.

    User Input Settings:
      ACTION:                        Install
      ADDCURRENTUSERASSQLADMIN:      true
      AGTSVCACCOUNT:                 NT AUTHORITY\NETWORK SERVICE
      AGTSVCPASSWORD:                *****
      AGTSVCSTARTUPTYPE:             Disabled
      ASBACKUPDIR:                   Backup
      ASCOLLATION:                   Latin1_General_CI_AS
      ASCONFIGDIR:                   Config
      ASDATADIR:                     Data
      ASLOGDIR:                      Log
      ASPROVIDERMSOLAP:              1
      ASSERVERMODE:                  MULTIDIMENSIONAL
      ASSVCACCOUNT:
      ASSVCPASSWORD:
      ASSVCSTARTUPTYPE:              Automatic
      ASSYSADMINACCOUNTS:
      ASTEMPDIR:                     Temp
      BROWSERSVCSTARTUPTYPE:         Disabled
      CLTCTLRNAME:
      CLTRESULTDIR:
      CLTSTARTUPTYPE:                0
      CLTSVCACCOUNT:
      CLTSVCPASSWORD:
      CLTWORKINGDIR:
      COMMFABRICENCRYPTION:          0
      COMMFABRICNETWORKLEVEL:        0
      COMMFABRICPORT:                0
      CONFIGURATIONFILE:             C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\ConfigurationFile.ini
      CTLRSTARTUPTYPE:               0
      CTLRSVCACCOUNT:
      CTLRSVCPASSWORD:
      CTLRUSERS:
      ENABLERANU:                    true
      ENU:                           true
      ERRORREPORTING:                false
      FEATURES:                      SQLENGINE, REPLICATION, FULLTEXT, RS, CONN, BC, SDK, BOL, SSMS, ADV_SSMS, LOCALDB
      FILESTREAMLEVEL:               0
      FILESTREAMSHARENAME:
      FTSVCACCOUNT:                  NT Service\MSSQLFDLauncher$SQLEXPRESS
      FTSVCPASSWORD:
      HELP:                          false
      IACCEPTSQLSERVERLICENSETERMS:  true
      INDICATEPROGRESS:              false
      INSTALLSHAREDDIR:              C:\Program Files\Microsoft SQL Server\
      INSTALLSHAREDWOWDIR:           C:\Program Files (x86)\Microsoft SQL Server\
      INSTALLSQLDATADIR:
      INSTANCEDIR:                   C:\Program Files\Microsoft SQL Server\
      INSTANCEID:                    SQLEXPRESS
      INSTANCENAME:                  SQLEXPRESS
      ISSVCACCOUNT:                  NT AUTHORITY\Network Service
      ISSVCPASSWORD:
      ISSVCSTARTUPTYPE:              Automatic
      MATRIXCMBRICKCOMMPORT:         0
      MATRIXCMSERVERNAME:
      MATRIXNAME:
      NPENABLED:                     0
      PID:                           *****
      QUIET:                         false
      QUIETSIMPLE:                   false
      ROLE:                          AllFeatures_WithDefaults
      RSINSTALLMODE:                 DefaultNativeMode
      RSSHPINSTALLMODE:              DefaultSharePointMode
      RSSVCACCOUNT:                  NT Service\ReportServer$SQLEXPRESS
      RSSVCPASSWORD:
      RSSVCSTARTUPTYPE:              Automatic
      SAPWD:
      SECURITYMODE:
      SQLBACKUPDIR:
      SQLCOLLATION:                  Latin1_General_CI_AS
      SQLSVCACCOUNT:                 NT Service\MSSQL$SQLEXPRESS
      SQLSVCPASSWORD:
      SQLSVCSTARTUPTYPE:             Automatic
      SQLSYSADMINACCOUNTS:           HEAD_OFFICE\clozid1
      SQLTEMPDBDIR:
      SQLTEMPDBLOGDIR:
      SQLUSERDBDIR:
      SQLUSERDBLOGDIR:
      SQMREPORTING:                  false
      TCPENABLED:                    0
      UIMODE:                        Normal
      UpdateEnabled:                 true
      UpdateSource:                  MU
      USEMICROSOFTUPDATE:            false
      X86:                           false

      Configuration file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\ConfigurationFile.ini

    Detailed results:
      Feature:                       Management Tools - Complete
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

      Feature:                       Client Tools Connectivity
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

      Feature:                       Client Tools SDK
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

      Feature:                       Client Tools Backwards Compatibility
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

      Feature:                       Management Tools - Basic
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

      Feature:                       Reporting Services - Native
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

      Feature:                       Database Engine Services
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

      Feature:                       Full-Text and Semantic Extractions for Search
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

      Feature:                       SQL Server Replication
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

      Feature:                       SQL Browser
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

      Feature:                       Documentation Components
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

      Feature:                       LocalDB
      Status:                        Passed

      Feature:                       Setup Support Files
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred during the setup process of the feature.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Setup Support Files
      Component error code:          1935
      Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SqlSupport_Cpu64_1.log
      Error description:             An error occurred during the installation of assembly 'Microsoft.VC80.ATL,version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="amd64",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x8007370B.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=SqlSupport.msi%40CreateShortcuts%401935%3a0x8007370B

    Rules with failures:

    Global rules:

    Scenario specific rules:

    Rules report file:               C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20141208_140724\SystemConfigurationCheck_Report.htm

EDIT: I installed 2008 R2 on the same machine with no problems. I then tried both a full install of 2014 and an "upgrade" install, both resulting in the same error above.