问:
Angular 2 data not binding to

I was trying to bind simple JSON data to
. But, my html page is showing empty data, but the row count is showing as per data. The data inside each
 is empty. Not sure what's wrong with my code.

Can someone help me if I am doing anything wrong here?

Pay.Component.ts

```<code>@Component({
moduleId: module.id,
templateUrl: './pay.component.html'
})

export class PayComponent  {

myData: any[] = [
    {
        "Col1": "120f2dcf-d4a4-4b3c-994a-e4e0c79bd642",
        "Col2": "2017-03-27T00:00:00-07:00",
        "Col3": "Testing1"
    },
    {
        "Col1": "320f2dcf-d4a4-4b3c-994a-e4e0c79bd642",
        "Col2": "2018-03-27T00:00:00-07:00",
        "Col3": "Testing2"
    }]
}
</code>```

pay.component.html

```<code><div class="content table-responsive table-full-width">
                    <table class="table table-hover table-striped">
                        <thead>
                            <tr>
                                <th>Col1</th>
                                <th>Col2</th>
                                <th>Col3</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr *ngFor='let pay of myData'>
                                <td>{{ pay.col1 }}</td>
                                <td>{{ pay.col2 }}</td>
                                <td>{{ pay.col3 }}</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
</code>```

Not sure what's going wrong with code.

答:
My bad. I found the issue as i was using lower case when the data was binding to the table.

Fixed the issue after changing to UPPER Case {{ pay.Col1 }}

Title: Angular 2 data not binding to <table>

Body:
I was trying to bind simple JSON data to
. But, my html page is showing empty data, but the row count is showing as per data. The data inside each
 is empty. Not sure what's wrong with my code.

Can someone help me if I am doing anything wrong here?

Pay.Component.ts

@Component({
moduleId: module.id,
templateUrl: './pay.component.html'
})

export class PayComponent  {

myData: any[] = [
    {
        "Col1": "120f2dcf-d4a4-4b3c-994a-e4e0c79bd642",
        "Col2": "2017-03-27T00:00:00-07:00",
        "Col3": "Testing1"
    },
    {
        "Col1": "320f2dcf-d4a4-4b3c-994a-e4e0c79bd642",
        "Col2": "2018-03-27T00:00:00-07:00",
        "Col3": "Testing2"
    }]
}

pay.component.html

                                Col1
                                Col2
                                Col3

                                {{ pay.col1 }}
                                {{ pay.col2 }}
                                {{ pay.col3 }}

Not sure what's going wrong with code.


来源: stackexchange

问:
Facebook Graph API : Parsing the output
I am trying to get the names of my friends using FB Graph API with this call :

```<code>$friends = file_get_contents('https://graph.facebook.com/me/friendsaccess_token='.$session["access_token"]);

echo "Friends : $friends\n";
</code>```

This gives me a list of the form :

```<code>{"data":[{"name":"ABC XYZ","id":"12212839"},{"name":"PQR GHI","id":"5004678"}]}
</code>```

I want to be able to store only the NAMES in an array. How do I use $friends to get the names ? Something like $friends['name'] doesn't seem to work.

Please help.
Thank you.

答:
```<code>$friends = json_decode($friends);
foreach($friends['data'] as $friend)
{
     echo $friend['name'];
}
</code>```

The return is a json object, you need to decode it.  Although I strongly urge you to use an SDK such as http://github.com/facebook/php-sdk/

If this doesn't work try:

```<code>$friends = json_decode($friends);
foreach($friends->data as $friend)
{
     echo $friend->name;
}
</code>```

ContentLicense: CC BY-SA 2.5

Title: Facebook Graph API : Parsing the output

Body:
I am trying to get the names of my friends using FB Graph API with this call :

$friends = file_get_contents('https://graph.facebook.com/me/friendsaccess_token='.$session["access_token"]);

echo "Friends : $friends\n";

This gives me a list of the form :

{"data":[{"name":"ABC XYZ","id":"12212839"},{"name":"PQR GHI","id":"5004678"}]}

I want to be able to store only the NAMES in an array. How do I use $friends to get the names ? Something like $friends['name'] doesn't seem to work.

Please help.
Thank you.

Body:
$friends = json_decode($friends);
foreach($friends['data'] as $friend)
{
     echo $friend['name'];
}

The return is a json object, you need to decode it.  Although I strongly urge you to use an SDK such as http://github.com/facebook/php-sdk/

If this doesn't work try:

$friends = json_decode($friends);
foreach($friends->data as $friend)
{
     echo $friend->name;
}


问:
Updating dictionary values of keys from a .txt file
So I've created a dictionary off the txt file "PM.txt" where the key is the player and the value is their penalty minutes. I know dictionary keys have to be unique so how would I update the value of the key adding it to the current value, as the key exists more than once in the txt file.

```<code>    "PM.txt"
    Neil,2
    Paul,5
    Neil,10
    Santos,2
    Neil,2
    Santos,10
    Paul,2
    Alex,2
</code>```

So far I have this which returns:

{'Alex': 2, 'Santos': 10, 'Paul': 2, 'Neil': 2}

```<code>    def pm_dict(filename):
        f = open(filename, 'r')
        dict = {}
        for line in f:
            x = line.split(",")
            player = x[0]
            minutes = x[1]
            c = len(minutes)-2
            minutes = minutes[0:c]
            dict[player] = minutes

        return dict
</code>```

But how would I create a function or a helper for it to return:

{'Alex': 2, 'Santos': 12, 'Paul': 7, 'Neil': 14}

答:
Just use defaultdict:

```<code>def pm_dict(filename):
    f = open(filename, 'r')
    dict = defaultdict(int)
    for line in f:
        x = line.split(",")
        player = x[0]
        minutes = x[1]
        c = len(minutes)-2
        minutes = minutes[0:c]
        dict[player] += int(minutes)

    return dict
</code>```

After refactoring:

```<code>import csv
from collections import defaultdict
</code>```

...

```<code>def get_penalty_minutes_dict(filename):
    result_dict = defaultdict(int)
    with open(filename, 'r') as f:
       for player, minutes in csv.reader(f):
           result_dict[player] += int(minutes)

    return result_dict
</code>```

ContentLicense: CC BY-SA 3.0

Body:
So I've created a dictionary off the txt file "PM.txt" where the key is the player and the value is their penalty minutes. I know dictionary keys have to be unique so how would I update the value of the key adding it to the current value, as the key exists more than once in the txt file.

    "PM.txt"
    Neil,2
    Paul,5
    Neil,10
    Santos,2
    Neil,2
    Santos,10
    Paul,2
    Alex,2

So far I have this which returns:

{'Alex': 2, 'Santos': 10, 'Paul': 2, 'Neil': 2}

    def pm_dict(filename):
        f = open(filename, 'r')
        dict = {}
        for line in f:
            x = line.split(",")
            player = x[0]
            minutes = x[1]
            c = len(minutes)-2
            minutes = minutes[0:c]
            dict[player] = minutes

        return dict

But how would I create a function or a helper for it to return:

{'Alex': 2, 'Santos': 12, 'Paul': 7, 'Neil': 14}

Body:
Just use defaultdict:

def pm_dict(filename):
    f = open(filename, 'r')
    dict = defaultdict(int)
    for line in f:
        x = line.split(",")
        player = x[0]
        minutes = x[1]
        c = len(minutes)-2
        minutes = minutes[0:c]
        dict[player] += int(minutes)

    return dict

After refactoring:

import csv
from collections import defaultdict

...

def get_penalty_minutes_dict(filename):
    result_dict = defaultdict(int)
    with open(filename, 'r') as f:
       for player, minutes in csv.reader(f):
           result_dict[player] += int(minutes)

    return result_dict


问:
Not understanding this recursive python code
I recently was trying to figure out the answer to a question on code fights.  I eventually found a solution that works from this website:
https://statyang.wordpresults.com/python-practice-51-combination-sum/

However, no matter how many print statements or debugging I do, I can't seem to figure out how

```<code>target
</code>```

is changing value somewhere in the

```<code>if target < candidates[i]:
    return
</code>```

The whole purpose of the program is to have an input of an array, and including duplicates, output the different combinations of sums that add up to the target.

here is the code with all of the debugging print statements

```<code>class Solution2:
# @param candidates, a list of integers
# @param target, integer
# @return a list of lists of integers
def combinationSum(self, candidates, target):
    candidates.sort()
    result=[]
    self.DFS(candidates,target,0,result,[])
    return result

def DFS(self,candidates,target,start,result,intermedia):
    print "===== inside DFS method ============="
    print "candidates {0}".format(candidates)
    print "target: {0}".format(target)
    print "start {0}".format(start)
    print "result {0}".format(result)
    print "intermedia {0}".format(intermedia)
    if target==0:
        print ">>> inside if target==0"
        print "target==0 appending {0}".format(intermedia)
        result.append(intermedia)
        return
    for i in range(start,len(candidates)):
        print "=====inside for loop ========: i= {0}".format(i)
        print "target={0}, cadidates[i]={1}".format(target, candidates[i])
        if target<candidates[i]:
            print ">>> target < candidates[i] {0} < {1}".format(target, candidates[i])
            print "i before return {0}".format(i)
            return
        print "i after return {0}".format(i)
        print "======== preparing for recursion ========:"
        print "candidates {0}".format(candidates)
        print "new target: target - candidates[i]: {0} - {1} = {2}".format(target, candidates[i], target-candidates[i])
        print "new start: {0}".format(i)
        print "result {0}".format(result)
        print "new intermedia: intermedia + candidates[i]: {0} + {1} = {2}".format(intermedia, [candidates[i]], intermedia + [candidates[i]])
        print "i= {0} start= {1}".format(i, start)
        print "about to call recursion again!"
        self.DFS(candidates,target-candidates[i],i,result,intermedia+[candidates[i]])

test2=Solution2()
print(test2.combinationSum([2, 4, 6, 8], 8))
</code>```

here is the ending output

```<code>[[2, 2, 2, 2], [2, 2, 4], [2, 6], [4, 4], [8]]
</code>```

as you can see, each of these pairs add up to 8

so really confused as to how the value for target seems to change somewhere inside of the loop and always to a positive number even though it is always inserting

```<code> target - candidates[i]
</code>```

inside of the recursive function

答:
target is only changing via the recursive call on this line:

self.DFS(candidates,target-candidates[i],i,result,intermedia+[candidates[i]])

It's always positive because the program does this check before making the recursive call:

```<code>    if target<candidates[i]:
        ...
        return
</code>```

Body:
I recently was trying to figure out the answer to a question on code fights.  I eventually found a solution that works from this website:
https://statyang.wordpresults.com/python-practice-51-combination-sum/

However, no matter how many print statements or debugging I do, I can't seem to figure out how

target

is changing value somewhere in the

if target < candidates[i]:
    return

The whole purpose of the program is to have an input of an array, and including duplicates, output the different combinations of sums that add up to the target.

here is the code with all of the debugging print statements

class Solution2:
# @param candidates, a list of integers
# @param target, integer
# @return a list of lists of integers
def combinationSum(self, candidates, target):
    candidates.sort()
    result=[]
    self.DFS(candidates,target,0,result,[])
    return result

def DFS(self,candidates,target,start,result,intermedia):
    print "===== inside DFS method ============="
    print "candidates {0}".format(candidates)
    print "target: {0}".format(target)
    print "start {0}".format(start)
    print "result {0}".format(result)
    print "intermedia {0}".format(intermedia)
    if target==0:
        print ">>> inside if target==0"
        print "target==0 appending {0}".format(intermedia)
        result.append(intermedia)
        return
    for i in range(start,len(candidates)):
        print "=====inside for loop ========: i= {0}".format(i)
        print "target={0}, cadidates[i]={1}".format(target, candidates[i])
        if target<candidates[i]:
            print ">>> target < candidates[i] {0} < {1}".format(target, candidates[i])
            print "i before return {0}".format(i)
            return
        print "i after return {0}".format(i)
        print "======== preparing for recursion ========:"
        print "candidates {0}".format(candidates)
        print "new target: target - candidates[i]: {0} - {1} = {2}".format(target, candidates[i], target-candidates[i])
        print "new start: {0}".format(i)
        print "result {0}".format(result)
        print "new intermedia: intermedia + candidates[i]: {0} + {1} = {2}".format(intermedia, [candidates[i]], intermedia + [candidates[i]])
        print "i= {0} start= {1}".format(i, start)
        print "about to call recursion again!"
        self.DFS(candidates,target-candidates[i],i,result,intermedia+[candidates[i]])

test2=Solution2()
print(test2.combinationSum([2, 4, 6, 8], 8))

here is the ending output

[[2, 2, 2, 2], [2, 2, 4], [2, 6], [4, 4], [8]]

as you can see, each of these pairs add up to 8

so really confused as to how the value for target seems to change somewhere inside of the loop and always to a positive number even though it is always inserting

 target - candidates[i]

inside of the recursive function

Body:
target is only changing via the recursive call on this line:

self.DFS(candidates,target-candidates[i],i,result,intermedia+[candidates[i]])

It's always positive because the program does this check before making the recursive call:

    if target<candidates[i]:
        ...
        return


问:
select varchar as date in mySQL
I have a date column in the format

25 Mar 2017 07:19 pm

I want to select date in the format dd/mm/yyyy

I have tried: cast(date as DATE), STR_TO_DATE(date, '%d/%m/%Y') but everything returns null

any help will be appreciated.

答:
You can parse the date using following format:

```<code>SELECT STR_TO_DATE('25 Mar 2017 07:19 pm', '%d %M %Y %h:%i %p');
</code>```

Here's the SQL Fiddle.

Title: select varchar as date in mySQL

Body:
You can parse the date using following format:

SELECT STR_TO_DATE('25 Mar 2017 07:19 pm', '%d %M %Y %h:%i %p');

Here's the SQL Fiddle.


答:
A couple of standard libraries make this problem straightforward.  A defaultdict creates a key if it doesn't already exist of its default type, so you can use D[key] += value even when the key doesn't exist yet.  The csv module automatically parses .csv files.  the default separator is comma.  Also make sure not to use dict as a variable name.  It overwrites the dict type.

```<code>from collections import defaultdict
import csv

def pm_dict(filename):
    D = defaultdict(int)
    with open(filename, 'r', newline='') as f:
        r = csv.reader(f)
        for key,value in r:
            D[key] += int(value)
    return dict(D) # converts back to a standard dict, but not required.

print(pm_dict('PM.txt'))
</code>```

Output:

```<code>{'Neil': 14, 'Paul': 7, 'Alex': 2, 'Santos': 12}
</code>```

The values make more sense as numbers, but if you want value strings as in your example the last line of the function can be the following to convert values back to strings.  This is a dictionary comprehension.

```<code>return {k:str(v) for k,v in D.items()}
</code>```

Title: Updating dictionary values of keys from a .txt file

Body:
A couple of standard libraries make this problem straightforward.  A defaultdict creates a key if it doesn't already exist of its default type, so you can use D[key] += value even when the key doesn't exist yet.  The csv module automatically parses .csv files.  the default separator is comma.  Also make sure not to use dict as a variable name.  It overwrites the dict type.

from collections import defaultdict
import csv

def pm_dict(filename):
    D = defaultdict(int)
    with open(filename, 'r', newline='') as f:
        r = csv.reader(f)
        for key,value in r:
            D[key] += int(value)
    return dict(D) # converts back to a standard dict, but not required.

print(pm_dict('PM.txt'))

Output:

{'Neil': 14, 'Paul': 7, 'Alex': 2, 'Santos': 12}

The values make more sense as numbers, but if you want value strings as in your example the last line of the function can be the following to convert values back to strings.  This is a dictionary comprehension.

return {k:str(v) for k,v in D.items()}


问:
Creating "background running" children with fork() and kill each of them with signals
I need to create n children from the same parent, and have them running while the parent asks infinitely for a signal to send to some child. I made the parent create those n children, but they finished executing, so I made them enter a while(1) loop. The problem is, when I try to kill any child, it  becomes a zombie process instead of actually terminating its execution. I'm guessing that's because the parent is still waiting for the children to terminate execution and they don't send the exit status. So... First of all, do I really need to make the children enter an infinite while loop to make them be running while the parent is asking for the signals? If I do, how do I avoid this "never terminating execution" problem? I need to find a way for the children to exit that while loop and send the actual "finished execution" signal since I think I can't use wait() because the children never actually finish running, they are just terminated by the parent.

Thanks.
PS: Running in Linux. This is my code

```<code>int main(){
    int i;
    pid_t parent = getpid();
    pid_t pid[4];
    printf("parent with pid %d\n", parent);

    for(i = 0; i < 5; i++){
        pid[i] = fork();
        if(pid[i] < 0){
            perror("Error in fork.");
            exit(1);
        } else if(pid[i] == 0 && getppid() == padre) {
            printf("Number: %d   pid %d, parent: %d\n", i, getpid(), getppid());
            while(1);
        }
    }

    if(getpid() == padre){
        while(1){
            printf("Enter pid and signal:\n");
            int x, y;
            scanf("%d", &x); // pid
            scanf("%d", &y); // signal
            printf("you did: kill(%d, %d)\n", x, y);
            kill(x, y);
        }
    }
    return 0;
}
</code>```

EDIT:
Final code with answer implemented: https://github.com/sebasura/sistope

答:
Thank you everyone, I did it.
I used pause() instead of while(1).

And after the kill, I used this:

```<code>int state;
waitpid(pid, &state, 0);
</code>```

This is part of a homework so I will upload the code after the due date so they don't penalize me for sharing it or something.

Thanks again.
EDIT:
Here is the final code https://github.com/sebasura/sistope

Body:
I need to create n children from the same parent, and have them running while the parent asks infinitely for a signal to send to some child. I made the parent create those n children, but they finished executing, so I made them enter a while(1) loop. The problem is, when I try to kill any child, it  becomes a zombie process instead of actually terminating its execution. I'm guessing that's because the parent is still waiting for the children to terminate execution and they don't send the exit status. So... First of all, do I really need to make the children enter an infinite while loop to make them be running while the parent is asking for the signals? If I do, how do I avoid this "never terminating execution" problem? I need to find a way for the children to exit that while loop and send the actual "finished execution" signal since I think I can't use wait() because the children never actually finish running, they are just terminated by the parent.

Thanks.
PS: Running in Linux. This is my code

int main(){
    int i;
    pid_t parent = getpid();
    pid_t pid[4];
    printf("parent with pid %d\n", parent);

    for(i = 0; i < 5; i++){
        pid[i] = fork();
        if(pid[i] < 0){
            perror("Error in fork.");
            exit(1);
        } else if(pid[i] == 0 && getppid() == padre) {
            printf("Number: %d   pid %d, parent: %d\n", i, getpid(), getppid());
            while(1);
        }
    }

    if(getpid() == padre){
        while(1){
            printf("Enter pid and signal:\n");
            int x, y;
            scanf("%d", &x); // pid
            scanf("%d", &y); // signal
            printf("you did: kill(%d, %d)\n", x, y);
            kill(x, y);
        }
    }
    return 0;
}

EDIT:
Final code with answer implemented: https://github.com/sebasura/sistope

Body:
Thank you everyone, I did it.
I used pause() instead of while(1).

And after the kill, I used this:

int state;
waitpid(pid, &state, 0);

This is part of a homework so I will upload the code after the due date so they don't penalize me for sharing it or something.

Thanks again.
EDIT:
Here is the final code https://github.com/sebasura/sistope


问:
Bash - how to count number of instructions?
I have a number of *.s assembly files. I would like to count how many instructions they contain. For example, to count all mul instructions I do:

```<code>cat *.s | grep -P '\t'"mul" | wc -l
</code>```

which gives me a compound number of all mul instructions.

I would like to have an output like:

```<code>mul: 893
add: 12054
sub: 2356
...
</code>```

The problem is that there is no table of instructions supported by a target platform. Each target platform has different set of instructions. The supported instructions must be deduced from existed assembly files. Can I do it in Bash only without Perl/Python foundry?

答: grep -Eo '\w+' /source.file | uniq -c</p>

Body:
I have a number of *.s assembly files. I would like to count how many instructions they contain. For example, to count all mul instructions I do:

cat *.s | grep -P '\t'"mul" | wc -l

which gives me a compound number of all mul instructions.

I would like to have an output like:

mul: 893
add: 12054
sub: 2356
...

The problem is that there is no table of instructions supported by a target platform. Each target platform has different set of instructions. The supported instructions must be deduced from existed assembly files. Can I do it in Bash only without Perl/Python foundry?

Body: grep -Eo '\w+' /source.file | uniq -c


问:
Spring Boot with h2 database
I currently try to follow a tutorial, but having issues at the point I add some in memory persistence with h2 to the application. I found some comments on the autoconfiguration of h2 in Spring Boot which say, that the only thing to do is to add the dependency to the pom. Is there any further configuration I have to do manually?
I get the following exceptions:

```<code>  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.5.1.RELEASE)

2017-02-26 23:53:08.854  INFO 30704 --- [           main] com.example.GuestbookBackendApplication  : Starting GuestbookBackendApplication on Deniss-MacBook-Pro.local with PID 30704 (/Users/denisholdeew/Documents/workspace/eclipseneon/guestbook-backend/target/classes started by denisholdeew in /Users/denisholdeew/Documents/workspace/eclipseneon/guestbook-backend)
2017-02-26 23:53:08.860  INFO 30704 --- [           main] com.example.GuestbookBackendApplication  : No active profile set, falling back to default profiles: default
2017-02-26 23:53:08.984  INFO 30704 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@2145433b: startup date [Sun Feb 26 23:53:08 CET 2017]; root of context hierarchy
2017-02-26 23:53:11.114  INFO 30704 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration' of type [class org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-02-26 23:53:11.246  INFO 30704 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'validator' of type [class org.springframework.validation.beanvalidation.LocalValidatorFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-02-26 23:53:11.327  INFO 30704 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$7dab0267] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-02-26 23:53:11.861  INFO 30704 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
2017-02-26 23:53:11.890  INFO 30704 --- [           main] o.apache.catalina.core.StandardService   : Starting service Tomcat
2017-02-26 23:53:11.892  INFO 30704 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.11
2017-02-26 23:53:12.121  INFO 30704 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2017-02-26 23:53:12.121  INFO 30704 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 3144 ms
2017-02-26 23:53:12.333  INFO 30704 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Mapping servlet: 'dispatcherServlet' to [/]
2017-02-26 23:53:12.339  INFO 30704 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2017-02-26 23:53:12.340  INFO 30704 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2017-02-26 23:53:12.340  INFO 30704 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2017-02-26 23:53:12.340  INFO 30704 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2017-02-26 23:53:12.406  WARN 30704 --- [           main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.tomcat.jdbc.pool.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).
2017-02-26 23:53:12.420  INFO 30704 --- [           main] utoConfigurationReportLoggingInitializer :

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-02-26 23:53:12.427 ERROR 30704 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :

***************************
APPLICATION FAILED TO START
***************************

Description:

Cannot determine embedded database driver class for database type NONE

Action:

If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).
</code>```

pom.xml:

```<code><?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.example</groupId>
    <artifactId>guestbook-backend</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>guestbook-backend</name>
    <description>Second demo project for Spring Boot</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.1.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
    <groupId>com.h2database</groupId>
    <artifactId>h2</artifactId>
    <scope>runtime</scope>
</dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
          <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>
</code>```

Entity:

```<code>@Entity
public class GuestbookEntry {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    private String title;

    private String comment;

    private String commenter;

    private Date date = new Date();

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getCommenter() {
        return commenter;
    }

    public void setCommenter(String commenter) {
        this.commenter = commenter;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

}
</code>```

Repository:

```<code>package com.example;

import org.springframework.data.jpa.repository.JpaRepository;

public interface GuestbookRepository extends JpaRepository<GuestbookEntry, Long> {

}
</code>```

Rest Controller:

```<code>@Controller
@RequestMapping("/guestbook")
public class GuestbookController {

    @Autowired
    private GuestbookRepository repository;

    @RequestMapping(value="/", method=RequestMethod.GET, produces=MediaType.APPLICATION_JSON_VALUE)
    public ResponseEntity<?> getEntries() {
        // 1. Daten laden
        List<GuestbookEntry> entries = repository.findAll();

        // 2. Daten zurückgeben
        return ResponseEntity.ok(entries);
    }

    @RequestMapping(value="/",
            method=RequestMethod.PUT,
            consumes=MediaType.APPLICATION_JSON_VALUE,
            produces=MediaType.APPLICATION_JSON_VALUE)
    public ResponseEntity<?> create(@RequestBody GuestbookEntry entry) {
        // 1. Speichern
        entry = repository.save(entry);

        // 2. Zurückgeben
        return ResponseEntity.ok(entry);
    }

}
</code>```

+++++++++++++++++++
UPDATE:

When commenting out the explicit hibernate dependencies in the pom.xml and run maven clean install, it still doesn't work.
I get the following output with maven clean install (unfortunately I had to delete parts of it because it has over 90000 characters and only 30k are allowed here):

```<code>  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.5.1.RELEASE)

2017-02-27 21:48:27.161  INFO 31629 --- [           main] c.e.GuestbookBackendApplicationTests     : Starting GuestbookBackendApplicationTests on somes-MacBook-Pro.local with PID 31629 (started by somename in /Users/somename/Documents/workspace/eclipseneon/guestbook-backend)
2017-02-27 21:48:27.162  INFO 31629 --- [           main] c.e.GuestbookBackendApplicationTests     : No active profile set, falling back to default profiles: default
2017-02-27 21:48:29.225  INFO 31629 --- [           main] o.s.w.c.s.GenericWebApplicationContext   : Refreshing org.springframework.web.context.support.GenericWebApplicationContext@1cbb87f3: startup date [Mon Feb 27 21:48:29 CET 2017]; root of context hierarchy
2017-02-27 21:48:51.004  INFO 31629 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration' of type [class org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-02-27 21:48:54.527  INFO 31629 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'validator' of type [class org.springframework.validation.beanvalidation.LocalValidatorFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-02-27 21:48:54.650  INFO 31629 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$a59e0480] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-02-27 21:48:55.256  WARN 31629 --- [           main] o.s.w.c.s.GenericWebApplicationContext   : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.tomcat.jdbc.pool.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).
2017-02-27 21:48:55.280  INFO 31629 --- [           main] utoConfigurationReportLoggingInitializer :

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-02-27 21:48:55.295 ERROR 31629 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :

***************************
APPLICATION FAILED TO START
***************************

Description:

Cannot determine embedded database driver class for database type NONE

Action:

If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).

2017-02-27 21:48:55.576 ERROR 31629 --- [           main] o.s.test.context.TestContextManager      : Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@8b96fde] to prepare test instance [com.example.GuestbookBackendApplicationTests@4f8caaf3]

java.lang.IllegalStateException: Failed to load ApplicationContext
    at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124) ~[spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83) ~[spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:189) ~[spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:131) ~[spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:230) ~[spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:228) [spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:287) [spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:289) [spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:247) [spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94) [spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
    at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) [spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) [spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191) [spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283) [surefire-junit4-2.18.1.jar:2.18.1]
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173) [surefire-junit4-2.18.1.jar:2.18.1]
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) [surefire-junit4-2.18.1.jar:2.18.1]
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128) [surefire-junit4-2.18.1.jar:2.18.1]
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203) [surefire-booter-2.18.1.jar:2.18.1]
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155) [surefire-booter-2.18.1.jar:2.18.1]
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103) [surefire-booter-2.18.1.jar:2.18.1]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.tomcat.jdbc.pool.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:372) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1081) ~[spring-context-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:856) ~[spring-context-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) ~[spring-context-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) ~[spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370) ~[spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) ~[spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
    at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:120) ~[spring-boot-test-1.5.1.RELEASE.jar:1.5.1.RELEASE]
    at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98) ~[spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116) ~[spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    ... 26 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.tomcat.jdbc.pool.DataSource]: Factory method 'dataSource' threw exception; nested exception is ....

Results :

Tests in error:
  GuestbookBackendApplicationTests.contextLoads » IllegalState Failed to load Ap...

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:58 min
[INFO] Finished at: 2017-02-27T21:48:56+01:00
[INFO] Final Memory: 26M/120M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project guestbook-backend: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/somename/Documents/workspace/eclipseneon/guestbook-backend/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
somes-MacBook-Pro:guestbook-backend somename$
</code>```

答:
Looks to me that you're missing the H2 dependency itself. You don't need to include the version using spring-boot as you will inherit it from the spring-boot parent pom. Just include the following in your pom.xml.</p>

```<code><dependency>
    <groupId>com.h2database</groupId>
    <artifactId>h2</artifactId>
</dependency>
</code>```

Title: Spring Boot with h2 database

Body:
I currently try to follow a tutorial, but having issues at the point I add some in memory persistence with h2 to the application. I found some comments on the autoconfiguration of h2 in Spring Boot which say, that the only thing to do is to add the dependency to the pom. Is there any further configuration I have to do manually?
I get the following exceptions:

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.5.1.RELEASE)

2017-02-26 23:53:08.854  INFO 30704 --- [           main] com.example.GuestbookBackendApplication  : Starting GuestbookBackendApplication on Deniss-MacBook-Pro.local with PID 30704 (/Users/denisholdeew/Documents/workspace/eclipseneon/guestbook-backend/target/classes started by denisholdeew in /Users/denisholdeew/Documents/workspace/eclipseneon/guestbook-backend)
2017-02-26 23:53:08.860  INFO 30704 --- [           main] com.example.GuestbookBackendApplication  : No active profile set, falling back to default profiles: default
2017-02-26 23:53:08.984  INFO 30704 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@2145433b: startup date [Sun Feb 26 23:53:08 CET 2017]; root of context hierarchy
2017-02-26 23:53:11.114  INFO 30704 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration' of type [class org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-02-26 23:53:11.246  INFO 30704 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'validator' of type [class org.springframework.validation.beanvalidation.LocalValidatorFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-02-26 23:53:11.327  INFO 30704 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$7dab0267] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-02-26 23:53:11.861  INFO 30704 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
2017-02-26 23:53:11.890  INFO 30704 --- [           main] o.apache.catalina.core.StandardService   : Starting service Tomcat
2017-02-26 23:53:11.892  INFO 30704 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.11
2017-02-26 23:53:12.121  INFO 30704 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2017-02-26 23:53:12.121  INFO 30704 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 3144 ms
2017-02-26 23:53:12.333  INFO 30704 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Mapping servlet: 'dispatcherServlet' to [/]
2017-02-26 23:53:12.339  INFO 30704 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2017-02-26 23:53:12.340  INFO 30704 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2017-02-26 23:53:12.340  INFO 30704 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2017-02-26 23:53:12.340  INFO 30704 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2017-02-26 23:53:12.406  WARN 30704 --- [           main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.tomcat.jdbc.pool.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).
2017-02-26 23:53:12.420  INFO 30704 --- [           main] utoConfigurationReportLoggingInitializer :

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-02-26 23:53:12.427 ERROR 30704 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :

***************************
APPLICATION FAILED TO START
***************************

Description:

Cannot determine embedded database driver class for database type NONE

Action:

If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).

pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.example</groupId>
    <artifactId>guestbook-backend</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>guestbook-backend</name>
    <description>Second demo project for Spring Boot</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.1.RELEASE</version>
        <relativePath/>
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
    <groupId>com.h2database</groupId>
    <artifactId>h2</artifactId>
    <scope>runtime</scope>
</dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
          <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>

Entity:

@Entity
public class GuestbookEntry {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    private String title;

    private String comment;

    private String commenter;

    private Date date = new Date();

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getCommenter() {
        return commenter;
    }

    public void setCommenter(String commenter) {
        this.commenter = commenter;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

}

Repository:

package com.example;

import org.springframework.data.jpa.repository.JpaRepository;

public interface GuestbookRepository extends JpaRepository<GuestbookEntry, Long> {

}

Rest Controller:

@Controller
@RequestMapping("/guestbook")
public class GuestbookController {

    @Autowired
    private GuestbookRepository repository;

    @RequestMapping(value="/", method=RequestMethod.GET, produces=MediaType.APPLICATION_JSON_VALUE)
    public ResponseEntity<?> getEntries() {
        // 1. Daten laden
        List<GuestbookEntry> entries = repository.findAll();

        // 2. Daten zurückgeben
        return ResponseEntity.ok(entries);
    }

    @RequestMapping(value="/",
            method=RequestMethod.PUT,
            consumes=MediaType.APPLICATION_JSON_VALUE,
            produces=MediaType.APPLICATION_JSON_VALUE)
    public ResponseEntity<?> create(@RequestBody GuestbookEntry entry) {
        // 1. Speichern
        entry = repository.save(entry);

        // 2. Zurückgeben
        return ResponseEntity.ok(entry);
    }

}

+++++++++++++++++++
UPDATE:

When commenting out the explicit hibernate dependencies in the pom.xml and run maven clean install, it still doesn't work.
I get the following output with maven clean install (unfortunately I had to delete parts of it because it has over 90000 characters and only 30k are allowed here):

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.5.1.RELEASE)

2017-02-27 21:48:27.161  INFO 31629 --- [           main] c.e.GuestbookBackendApplicationTests     : Starting GuestbookBackendApplicationTests on somes-MacBook-Pro.local with PID 31629 (started by somename in /Users/somename/Documents/workspace/eclipseneon/guestbook-backend)
2017-02-27 21:48:27.162  INFO 31629 --- [           main] c.e.GuestbookBackendApplicationTests     : No active profile set, falling back to default profiles: default
2017-02-27 21:48:29.225  INFO 31629 --- [           main] o.s.w.c.s.GenericWebApplicationContext   : Refreshing org.springframework.web.context.support.GenericWebApplicationContext@1cbb87f3: startup date [Mon Feb 27 21:48:29 CET 2017]; root of context hierarchy
2017-02-27 21:48:51.004  INFO 31629 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration' of type [class org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-02-27 21:48:54.527  INFO 31629 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'validator' of type [class org.springframework.validation.beanvalidation.LocalValidatorFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-02-27 21:48:54.650  INFO 31629 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$a59e0480] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-02-27 21:48:55.256  WARN 31629 --- [           main] o.s.w.c.s.GenericWebApplicationContext   : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.tomcat.jdbc.pool.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).
2017-02-27 21:48:55.280  INFO 31629 --- [           main] utoConfigurationReportLoggingInitializer :

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-02-27 21:48:55.295 ERROR 31629 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :

***************************
APPLICATION FAILED TO START
***************************

Description:

Cannot determine embedded database driver class for database type NONE

Action:

If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).

2017-02-27 21:48:55.576 ERROR 31629 --- [           main] o.s.test.context.TestContextManager      : Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@8b96fde] to prepare test instance [com.example.GuestbookBackendApplicationTests@4f8caaf3]

java.lang.IllegalStateException: Failed to load ApplicationContext
    at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124) ~[spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83) ~[spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:189) ~[spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:131) ~[spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:230) ~[spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:228) [spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:287) [spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:289) [spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:247) [spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94) [spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
    at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) [spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) [spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191) [spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283) [surefire-junit4-2.18.1.jar:2.18.1]
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173) [surefire-junit4-2.18.1.jar:2.18.1]
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) [surefire-junit4-2.18.1.jar:2.18.1]
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128) [surefire-junit4-2.18.1.jar:2.18.1]
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203) [surefire-booter-2.18.1.jar:2.18.1]
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155) [surefire-booter-2.18.1.jar:2.18.1]
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103) [surefire-booter-2.18.1.jar:2.18.1]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.tomcat.jdbc.pool.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:372) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1081) ~[spring-context-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:856) ~[spring-context-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) ~[spring-context-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) ~[spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370) ~[spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) ~[spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
    at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:120) ~[spring-boot-test-1.5.1.RELEASE.jar:1.5.1.RELEASE]
    at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98) ~[spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116) ~[spring-test-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    ... 26 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.tomcat.jdbc.pool.DataSource]: Factory method 'dataSource' threw exception; nested exception is ....

Results :

Tests in error:
  GuestbookBackendApplicationTests.contextLoads » IllegalState Failed to load Ap...

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:58 min
[INFO] Finished at: 2017-02-27T21:48:56+01:00
[INFO] Final Memory: 26M/120M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project guestbook-backend: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/somename/Documents/workspace/eclipseneon/guestbook-backend/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
somes-MacBook-Pro:guestbook-backend somename$

Body:
Looks to me that you're missing the H2 dependency itself. You don't need to include the version using spring-boot as you will inherit it from the spring-boot parent pom. Just include the following in your pom.xml.

<dependency>
    <groupId>com.h2database</groupId>
    <artifactId>h2</artifactId>
</dependency>


问:
Ionic : first loading of my android application is abnormally slow
the first loading of my android application is abnormally slow, if someone has already encountered this problem, I already try removing all plugins and reinstall them, and remove the android platform and create it again, the loading time does not changed, here are the messages that the application shows me

Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.

main.js:115328 Ionic Storage driver: cordovaSQLiteDriver

plugins/cordova-sqlite-storage/www/SQLitePlugin.js:175 OPEN database: _ionicstorage

plugins/cordova-sqlite-storage/www/SQLitePlugin.js:106 new transaction is waiting for open operation

plugins/cordova-sqlite-storage/www/SQLitePlugin.js:179 OPEN database: _ionicstorage - OK

plugins/cordova-sqlite-storage/www/SQLitePlugin.js:80 DB opened: _ionicstorage

cordova.js:1223 deviceready has not fired after 5 seconds.

main.js:7881 Native: deviceready did not fire within 2000ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.
- main.js:7876 DEVICE READY FIRED AFTER 14273 ms

And here is the list of my plugins

Com.googlemaps.ios 2.1.1 "Google Maps SDK for iOS"

Com.synconset.imagepicker 2.1.7 "ImagePicker"

Cordova-plugin-compat 1.1.0 "Compat"

Cordova-plugin-console 1.0.5 "Console"

Cordova-plugin-crosswalk-webview 2.1.0 "Crosswalk WebView Engine"

Cordova-plugin-device 1.1.4 "Device"

Cordova-plugin-file 4.3.2 "File"

Cordova-plugin-file-transfer 1.6.2 "File Transfer"

Cordova-plugin-filepath 1.0.2 "FilePath"

Cordova-plugin-geolocation 2.4.1 "Geolocation"

Cordova-plugin-googlemaps 1.4.0 "phonegap-googlemaps-plugin"

Cordova-plugin-mauron85-background-geolocation 2.2.5 "CDVBackgroundGeolocation"

Cordova-plugin-network-information 1.3.1 "Network Information"

Cordova-plugin-splashscreen 4.0.1 "Splashscreen"

Cordova-plugin-statusbar 2.2.1 "StatusBar"

Cordova-plugin-whitelist 1.3.1 "Whitelist"

Cordova-sqlite-storage 2.0.0 "Cordova sqlite storage plugin"

Ionic-plugin-keyboard 2.2.1 "Keyboard"

Onesignal-cordova-plugin 2.0.10 "OneSignal Push Notifications"

system information:

Cordova CLI: 6.5.0

Ionic Framework Version: 2.0.0-rc.4

Ionic CLI Version: 2.1.17

Ionic App Lib Version: 2.1.7

Ionic App Scripts Version: 0.0.47

ios-deploy version: 1.9.0

ios-sim version: 5.0.8

OS: macOS Sierra

Node Version: v7.2.1

Xcode version: Xcode 8.2 Build version 8C38

答:
I found the solution, you have to put these line of code in main.ts of the application

```<code>import {enableProdMode} from '@angular/core';
enableProdMode();
</code>```

and the flag --prod when you build your app

```<code>ionic build android --prod
</code>```

now my DEVICE READY FIRED AFTER 2415 ms

Body:
I found the solution, you have to put these line of code in main.ts of the application

import {enableProdMode} from '@angular/core';
enableProdMode();

and the flag --prod when you build your app

ionic build android --prod

now my DEVICE READY FIRED AFTER 2415 ms


问:
Nested / Compounded roles: apply multiple roles to overlapping text
In my custom.css file I have,

```<code>.bold {
    font-weight: bold;
}

.red {
    color:red;
}
</code>```

And in my _.rst file,

```<code>.. role:: bold

.. role:: red
</code>```

But if I try to nest/compound them, only the outermost role takes effect, e.g.

:bold:`:red:`This is only bold``

This is only bold

Is there a way to combine these effects without defining a new (combined) role?

答:
Roles are defined that the can not be nested.

Neither HTML nor LaTeX, as backends, support overlapping of styles.

Body:
In my custom.css file I have,

.bold {
    font-weight: bold;
}

.red {
    color:red;
}

And in my _.rst file,

.. role:: bold

.. role:: red

But if I try to nest/compound them, only the outermost role takes effect, e.g.

:bold:`:red:`This is only bold``

This is only bold

Is there a way to combine these effects without defining a new (combined) role?


问:
Download and save PDF file with Python requests module
I am trying to download a PDF file from a website and save it to disk. My attempts either fail with encoding errors or result in blank PDFs.

```<code>In [1]: import requests

In [2]: url = 'http://www.hrecos.org//images/Data/forweb/HRTVBSH.Metadata.pdf'

In [3]: response = requests.get(url)

In [4]: with open('/tmp/metadata.pdf', 'wb') as f:
   ...:     f.write(response.text)
---------------------------------------------------------------------------
UnicodeEncodeError                        Traceback (most recent call last)
<ipython-input-4-4be915a4f032> in <module>()
      1 with open('/tmp/metadata.pdf', 'wb') as f:
----> 2     f.write(response.text)
      3

UnicodeEncodeError: 'ascii' codec can't encode characters in position 11-14: ordinal not in range(128)

In [5]: import codecs

In [6]: with codecs.open('/tmp/metadata.pdf', 'wb', encoding='utf8') as f:
   ...:     f.write(response.text)
   ...:
</code>```

I know it is a codec problem of some kind but I can't seem to get it to work.

答:
regarding Kevin answer to write in a folder tmp, it should be like this:

```<code>with open('./tmp/metadata.pdf', 'wb') as f:
    f.write(response.content)
</code>```

he forgot . before the address and of-course your folder tmp should have been created already

Body:
I am trying to download a PDF file from a website and save it to disk. My attempts either fail with encoding errors or result in blank PDFs.

In [1]: import requests

In [2]: url = 'http://www.hrecos.org//images/Data/forweb/HRTVBSH.Metadata.pdf'

In [3]: response = requests.get(url)

In [4]: with open('/tmp/metadata.pdf', 'wb') as f:
   ...:     f.write(response.text)
---------------------------------------------------------------------------
UnicodeEncodeError                        Traceback (most recent call last)
<ipython-input-4-4be915a4f032> in <module>()
      1 with open('/tmp/metadata.pdf', 'wb') as f:
----> 2     f.write(response.text)
      3

UnicodeEncodeError: 'ascii' codec can't encode characters in position 11-14: ordinal not in range(128)

In [5]: import codecs

In [6]: with codecs.open('/tmp/metadata.pdf', 'wb', encoding='utf8') as f:
   ...:     f.write(response.text)
   ...:

I know it is a codec problem of some kind but I can't seem to get it to work.

Body:
regarding Kevin answer to write in a folder tmp, it should be like this:

with open('./tmp/metadata.pdf', 'wb') as f:
    f.write(response.content)

he forgot . before the address and of-course your folder tmp should have been created already


问:
Decimal KeyPad for iphone in hybrid app
I have a number field with no restriction on amount that can be entered. Business requirement is to show a decimal keypad. We are using input type="number". This works fine in android. I tested in Edge and this works like a charm. But the default keypad comes up in iphone. I did search on internet before coming here. But I could not find a way out. There is no existing custom cordova plugin for this as well.
FYI- We are using ionic to build this app.</p>

答:
I dont think Showing decimal keypad is even possible in cordova iOS.

i finally wrote a new plugin
  https://github.com/mrchandoo/cordova-plugin-decimal-keyboard

Title: Decimal KeyPad for iphone in hybrid app


问:
install gigablast. make file not working
I am trying to install gigablast on a server. I have not been able to get past the make file part. I have used it to create other programs but I also don't have a degree in server or computer programming, and thats why I need help.

I am running ubunto 14.04 and have updated everything. I unzipped the file in the root folder. Was I supposed to move it the the var folder? I have not found a install file or a make file for initill construction and have done make -f and make -i
I get that it is a directory but can't find the file to point it to.
This is the list of files on github
https://github.com/gigablast/open-source-search-engine

THis has the install guide.
https://www.gigablast.com/faq.html#src

Thank you for helping me out

答:
Try this</p>

```<code>$ mkdir gigablast
$ cd gigablast
$ wget --no-check-certificate "https://github.com/gigablast/open-source-search-engine/archive/master.zip"
$ unzip master.zip
$ cd open-source-search-engine-master/
$ make
</code>```

Body:
Try this

$ mkdir gigablast
$ cd gigablast
$ wget --no-check-certificate "https://github.com/gigablast/open-source-search-engine/archive/master.zip"
$ unzip master.zip
$ cd open-source-search-engine-master/
$ make


问:
Is there a way (script ?) to redirect a first visitor of my website to, say welcomepage.html instead of index.html?
Hello I'm learning html/css by doing my own website. I'm curious as I want my website to show a different page than index.html for a first time visitor. I know it involve something like cookies and I've seen scripts in similar thread in php, but I don't now where should I put it. I don't know nothing about php, should I put it in a .php page? or Can someone suggest me a ressource to learn to do it comprehensively? </p>

答:
Cookies are indeed your way to go.

from w3schools:

A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user's computer. Each time the same computer requests a page with a browser, it will send the cookie too. With PHP, you can both create and retrieve cookie values.

If you set a cookie when someone visits your website, after that you can then check if the cookie (or a value in your cookie) is set. If it isn't set, they're most likely a new user.

I'd recommend to put the cookie check at the top of your .php page so you redirect the user before any of your html is loaded.

If you've never done anything with PHP before I'd recommend starting with a simple PHP tutorial first.


问:
Extracting multiple RDS MySQL tables to S3
Rather new to AWS Data Pipeline so any help will be appreciated. I have used the pipeline template RDStoS3CopyActivity to extract all contents of a table in RDS MySQL. Seems to be working good. But there are 90 other tables to be extracted and dumped to S3. I cannot imagine craeting 90 pipelines or one for each table.

What is the best approach to resolving this task? How could pipeline be instructed to iterate though a list of the table names?

答:
If the tables are all in the same RDS Why not use a SQLActivity pipeline with a SQL statement containing multiple unload commands to S3?

You can just write one query and use one pipeline.


问:
R: applying function on individual csv's in a directory, saving them as one large csv
So I have a directory of folders (each a year, from 1990-2015), that each have over 100+ csv's:

```<code>data/1990/alabama.csv
data/1990/alaska.csv
data/1990/arizona.csv
...
data/1991/alabama.csv
data/1991/alaska.csv
data/1991/arizona.csv
...etc.
</code>```

I'm applying a function that cleans up each of those csv's, and save it out into another folder.

So far I have this for loop that grabs all the file names and puts them in a data frame, where each row is a new year:

```<code>filepath <- "~/Desktop/project/data"
setwd(dir = filepath)
top_file_dir = dir()
indi_file_name = sapply(top_file_dir, dir)

filename = as.data.frame("", nrow = length(top_file_dir), ncol = 5000, stringsAsFactors = FALSE )
for (i in 1:length(top_file_dir)){
  indi_file_name = sapply(top_file_dir[i], dir)
  for (j in 1:length(indi_file_name))
filename[i,j] = paste(top_file_dir[i],indi_file_name[j],sep="/")
}
</code>```

Then I have a fairly simple function that goes through and tidies up the dataset:

```<code>general_clean <- function(currfile=filename) {
  geo <- read.csv(file=paste(filepath,currfile,sep="/") , stringsAsFactors=FALSE, colClasses = c("area_fips"="character"))

# remove unwanted columns
keep <- c("area_fips", "year", "area_title")
geoClean <- geo[keep]

# export new data into csv
save_file = paste("~/Desktop/project/output",substring(currfile,21,last=1000),sep="/")
write.csv(geoClean, file=save_file)
}

# apply function, input each year by hand...[1,]=1990, [2,]=1991, etc.
sapply(filename[1,], general_clean)
</code>```

Which works ok, but I'd like to add a step that puts each of these smaller csv's into a new one for each year. This seems to involve creating an empty list and using rbind within the "general_clean" function to keep adding new data? But this is beyond my R abilities and everything I've tried so far is mostly guesswork. Any advice?

答:
This should get you close. Taking advantage of list.file(..., full.names = TRUE) to save a bunch of the paste() calls.

```<code>years <- list.dirs("~/Desktop/project/data", full.names = T, recursive = F)
# list only the folders in this folder "data"

general_clean <- function(file) {
    geo <- read.csv(file = file,
                    stringsAsFactors = FALSE,
                    colClasses = c("area_fips"="character"))
    keep <- c("area_fips", "year", "area_title") # move all cleaning into your fxn
    geoClean <- geo[keep]
    return(geoClean)
}
# move all your cleaning steps into your fxn

for (y in years) {
    year_name <- gsub(".*data/(\\d{4}/.*", "//1", y) # make a year name chr vector
    states <- dir(y, full.names = T) # now list all files in each year
    readin_list <- lapply(states, geoClean) # list of small data frames
    readin_dataframe <- do.call(rbind, readin_list) # make it into a big one
    write.csv(readin_dataframe, paste0("output/", year_name, "/")) # write it out
}
</code>```

I'm 99% sure this won't work perfectly the first time, but since I can't see all of your data it's my best guess and a good place to start. Let me know what goes wrong and we can get it working on your data :)

Body:
So I have a directory of folders (each a year, from 1990-2015), that each have over 100+ csv's:

data/1990/alabama.csv
data/1990/alaska.csv
data/1990/arizona.csv
...
data/1991/alabama.csv
data/1991/alaska.csv
data/1991/arizona.csv
...etc.

I'm applying a function that cleans up each of those csv's, and save it out into another folder.

So far I have this for loop that grabs all the file names and puts them in a data frame, where each row is a new year:

filepath <- "~/Desktop/project/data"
setwd(dir = filepath)
top_file_dir = dir()
indi_file_name = sapply(top_file_dir, dir)

filename = as.data.frame("", nrow = length(top_file_dir), ncol = 5000, stringsAsFactors = FALSE )
for (i in 1:length(top_file_dir)){
  indi_file_name = sapply(top_file_dir[i], dir)
  for (j in 1:length(indi_file_name))
filename[i,j] = paste(top_file_dir[i],indi_file_name[j],sep="/")
}

Then I have a fairly simple function that goes through and tidies up the dataset:

general_clean <- function(currfile=filename) {
  geo <- read.csv(file=paste(filepath,currfile,sep="/") , stringsAsFactors=FALSE, colClasses = c("area_fips"="character"))

# remove unwanted columns
keep <- c("area_fips", "year", "area_title")
geoClean <- geo[keep]

# export new data into csv
save_file = paste("~/Desktop/project/output",substring(currfile,21,last=1000),sep="/")
write.csv(geoClean, file=save_file)
}

# apply function, input each year by hand...[1,]=1990, [2,]=1991, etc.
sapply(filename[1,], general_clean)

Which works ok, but I'd like to add a step that puts each of these smaller csv's into a new one for each year. This seems to involve creating an empty list and using rbind within the "general_clean" function to keep adding new data? But this is beyond my R abilities and everything I've tried so far is mostly guesswork. Any advice?

Body:
This should get you close. Taking advantage of list.file(..., full.names = TRUE) to save a bunch of the paste() calls.

years <- list.dirs("~/Desktop/project/data", full.names = T, recursive = F)
# list only the folders in this folder "data"

general_clean <- function(file) {
    geo <- read.csv(file = file,
                    stringsAsFactors = FALSE,
                    colClasses = c("area_fips"="character"))
    keep <- c("area_fips", "year", "area_title") # move all cleaning into your fxn
    geoClean <- geo[keep]
    return(geoClean)
}
# move all your cleaning steps into your fxn

for (y in years) {
    year_name <- gsub(".*data/(\\d{4}/.*", "//1", y) # make a year name chr vector
    states <- dir(y, full.names = T) # now list all files in each year
    readin_list <- lapply(states, geoClean) # list of small data frames
    readin_dataframe <- do.call(rbind, readin_list) # make it into a big one
    write.csv(readin_dataframe, paste0("output/", year_name, "/")) # write it out
}

I'm 99% sure this won't work perfectly the first time, but since I can't see all of your data it's my best guess and a good place to start. Let me know what goes wrong and we can get it working on your data :)