1<!doctype html>
2<html lang="en">
3 <head>
4 <!-- Required meta tags -->
5 <meta charset="utf-8">
6 <meta name="viewport" content="width=device-width, initial-scale=1">
7
8 <!-- Bootstrap CSS -->
9 <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
10
11 <title>Hello, world!</title>
12 </head>
13 <body>
14 <h1>Hello, world!</h1>
15
16 <!-- Optional JavaScript; choose one of the two! -->
17
18 <!-- Option 1: Bootstrap Bundle with Popper -->
19 <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
20
21 <!-- Option 2: Separate Popper and Bootstrap JS -->
22 <!--
23 <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
24 <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>
25 -->
26 </body>
27</html>
28
1>> tmpl = URITemplate.new('/notifications{?since,all,participating}')
2>> tmpl.expand
3=> "/notifications"
4
5>> tmpl.expand :all => 1
6=> "/notifications?all=1"
7
8>> tmpl.expand :all => 1, :participating => 1
9=> "/notifications?all=1&participating=1"
10
1// function template
2#include <iostream>
3using namespace std;
4
5template <class T>
6T sum (T a, T b)
7{
8 T result;
9 result = a + b;
10 return result;
11}
12
13int main () {
14 int i=5, j=6, k;
15 double f=2.0, g=0.5, h;
16 k=sum<int>(i,j);
17 h=sum<double>(f,g);
18 cout << k << '\n';
19 cout << h << '\n';
20 return 0;
21}
1// function templates
2#include <iostream>
3using namespace std;
4
5template <class T, class U>
6bool are_equal (T a, U b)
7{
8 return (a==b);
9}
10
11int main ()
12{
13 if (are_equal(10,10.0))
14 cout << "x and y are equal\n";
15 else
16 cout << "x and y are not equal\n";
17 return 0;
18}