When merging an operation O, there may be several operations scattered through the local history that are concurrent to O. We need to rearrange our history so that all of these concurrent operations are moved to the end of the history. Then we can transform O against each of these concurrent operations and append it to the end.
Say we're adding O a history with the following suffix. The operations surrounded by vertical bars are concurrent to O. Otherwise the operations causally precede O.
EO0 |EO1| EO2 EO3 |EO4| |EO5| EO6
We need to rearrange this history so it looks like this.
This file contains 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
// frontend with abstract backend | |
void parse_expr(expr_t *expr); | |
void parse_base_expr(expr_t *expr) { | |
if (token == NUMBER) { | |
do_number_expr(expr, token_value); | |
next_token(); | |
} else if (match_token('(')) { | |
parse_expr(expr); |
Edit: This list is now maintained in the rust-anthology repo.
This file contains 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
use std::collections::HashMap; | |
use std::rc::Rc; | |
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
struct Component { | |
events: HashMap<Event, Box<StateCallback>>, | |
children: Vec<Component>, | |
} |
This file contains 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
#pragma comment(lib, "SDL2") | |
#pragma comment(lib, "SDL2main") | |
#include "SDL.h" | |
#include <vector> | |
#include <unordered_map> | |
#include <assert.h> | |
#include <algorithm> |
This file contains 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
# Get releases for your repository (change the URL and add user/password if necessary) | |
# If there's more than one page, you might have to do more requests with `?page=2` etc | |
curl https://api.github.com/repos/:owner/:repo/releases > releases.json | |
# Use jq! https://stedolan.github.io/jq/ | |
# "v" is a prefix to strip from the release names, might not be necessary | |
jq -r '.[] | "## [" + (.name | ltrimstr("v")) + "] - " + .created_at[:10] + "\n" + .body' releases.json >> CHANGELOG.md | |
# Now edit the CHANGELOG.md, see here: http://keepachangelog.com/en/1.0.0/ |
This file contains 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
// works as of 2019-03-02 | |
(function() { | |
// This function forces rustdoc to collapse documentation for all items, | |
// except for the methods defined in an impl block and the primary type's | |
// declaration. This is the most natural view IMO, since it provides the | |
// primary type along with an easy to scan overview of available methods. | |
// | |
// rustdoc does seemingly have user settings that purport to make this the | |
// default, but I could never cause them to work in a reliably consistent | |
// way. This is especially useful when writing documents, where you commonly |
This file contains 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
// CHANGE the clock prescale in mcpwm.c file to make possible get 30000hz of pwm frequency (15Khz in center aligned mode) | |
#define MCPWM_BASE_CLK (2 * APB_CLK_FREQ) //2*APB_CLK_FREQ 160Mhz | |
#define MCPWM_CLK_PRESCL 1 //MCPWM clock prescale Original = 15 <--------------------- | |
#define TIMER_CLK_PRESCALE 1 //MCPWM timer prescales Original = 9 <--------------------- | |
#define MCPWM_CLK (MCPWM_BASE_CLK/(MCPWM_CLK_PRESCL +1)) | |
#define MCPWM_PIN_IGNORE (-1) | |
#define OFFSET_FOR_GPIO_IDX_1 6 | |
#define OFFSET_FOR_GPIO_IDX_2 75 |