The use of exceptions isn't a viable error handling approach in all cases and returning codes for error handling is sometimes preferable. However, using integral types for error identification is problematic as there is no good mechanism to guarantee that each value uniquely
| using bfs = boost::filesystem; | |
| void recursive_copy(const bfs::path &src, const bfs::path &dst) | |
| { | |
| if (bfs::exists(dst)){ | |
| throw std::runtime_error(dst.generic_string() + " exists"); | |
| } | |
| if (bfs::is_directory(src)) { | |
| bfs::create_directories(dst); |
An example that shows the difference between creating a JavaScript class and subclass in ES5 and ES6.
The use of exceptions isn't a viable error handling approach in all cases and returning codes for error handling is sometimes preferable. However, using integral types for error identification is problematic as there is no good mechanism to guarantee that each value uniquely
The use of exceptions isn't a viable error handling approach in all cases and returning codes for error handling is sometimes preferable. However, using integral types for error identification is problematic as there is no good mechanism to guarantee that each value uniquely
| ;; material-ui.macros.clj | |
| (ns material-ui.macros) | |
| (def material-tags | |
| '[AppBar | |
| AppCanvas | |
| Circle | |
| Checkbox | |
| DatePicker | |
| DialogWindow |
This is the example that comes with the reagent template converted to use HTML5 based history. This means there are no # in the urls.
I just got this working, so there might be better approaches
The changes are
- use
goog.history.Html5historyinstead ofgoog.History - listen to clicks on the page, extract the path from them, and push them onto the history
- listen to history changes, and have secretary do its thing in response
| # nginx.conf | |
| http { | |
| client_max_body_size 20M; #上传文件的大小 | |
| } | |
| ------------------------------------------------------------------------------------ | |
| #Nginx应用配置 | |
| upstream app-name { | |
| # 配置unicorn服务器器 | |
| server unix:/opt/app-name/tmp/sockets/unicorn.sock |