This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const showPasswordInput = () => <input type="password" />; // "password" means that characters are hidden when they're typed, for ex behind stars ********** | |
const showCommentInput = () => <input type="text" />; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Page = ({ user, children, onLogin, onAddComment }) => { | |
if (!user.isLoggedIn) { | |
return ( | |
<Layout> | |
<h3>Please log in to see and post comments</h3> | |
{showPasswordInput()} | |
<button onClick={onLogin}>Login!</button> | |
</Layout> | |
); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <iterator> | |
#include <vector> | |
template<typename InputIterator1, typename InputIterator2, typename OutputIterator> | |
OutputIterator my_set_difference(InputIterator1 first1, InputIterator1 last1, | |
InputIterator2 first2, InputIterator2 last2, | |
OutputIterator out) | |
{ | |
auto current1 = first1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <queue> | |
size_t leftChild(size_t index) | |
{ | |
return (index + 1) * 2 - 1; | |
} | |
size_t rightChild(size_t index) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <queue> | |
size_t leftChild(size_t index) | |
{ | |
return (index + 1) * 2 - 1; | |
} | |
size_t rightChild(size_t index) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <boost/parameter.hpp> | |
BOOST_PARAMETER_NAME(firstName) | |
BOOST_PARAMETER_NAME(lastName) | |
BOOST_PARAMETER_NAME(age) | |
BOOST_PARAMETER_NAME(email) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <boost/parameter.hpp> | |
BOOST_PARAMETER_NAME(firstName) | |
BOOST_PARAMETER_NAME(lastName) | |
BOOST_PARAMETER_NAME(age) | |
BOOST_PARAMETER_NAME(email) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <boost/parameter.hpp> | |
BOOST_PARAMETER_NAME(firstName) | |
BOOST_PARAMETER_NAME(lastName) | |
BOOST_PARAMETER_NAME(age) | |
BOOST_PARAMETER_NAME(email) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <boost/parameter.hpp> | |
BOOST_PARAMETER_NAME(firstName) | |
BOOST_PARAMETER_NAME(lastName) | |
BOOST_PARAMETER_NAME(age) | |
BOOST_PARAMETER_NAME(email) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <boost/spirit/include/karma.hpp> | |
int main() | |
{ | |
using boost::spirit::karma::int_; | |
using boost::spirit::karma::generate; | |