<commit_before>---
title: "对齐操作"
bg: orange
color: black
fa-icon: toggle-on
---

## C语言小代码：用于对齐，检查对齐

### 用于对齐：向上对齐和向下对齐
- #define ROUND_UP(x, align) (((int) (x) + (align - 1)) & ~(align - 1))
- #define ROUND_DOWN(x, align) ((int)(x) & ~(align - 1))
### 用于检查是否已经对齐
- #define ALIGNED(x, align) (((int)(x) & (align - 1)) == 0)
** 其中，x为要计算或者检查的值，align是要对齐的单位**
 
### align与末尾的关系
- align = 16 ：：末尾4位清零
- align =  8 ：：末尾3为清零
- align =  4 ：：末尾2为清零
**注：向上对齐的时候，末尾清零后，会相应的增加数值**

-------------------------


## Setup as standalone project page

- Go click **fork** on the [github project page](https://github.com/t413/SinglePaged)
- Rename your new repository to `whatever you want`. (click settings in the right column)
  * It will go live at yourusername.github.io/**WhateverYouWant**
- Clone your repository, cd into the project
- Run `git checkout publish && git branch -D gh-pages && git branch -m gh-pages && git push -uf origin gh-pages` to swap the *publish* and *gh-pages* branch.

Now hop over to [Usage](#usage) to get it running with your own stuff!

**When you publish changes use `git push -u origin gh-pages`**

-------------------------


## Setup inside existing project

This is the most complicated use-case .. but it's the coolest.
Say you've got your kickass project `github.com/t413/kicker` and want to have<commit_msg>update2<commit_after>---
title: "对齐操作"
bg: orange
color: black
fa-icon: toggle-on
---

## C语言小代码：用于对齐，检查对齐

### 用于对齐：向上对齐和向下对齐
- #define ROUND_UP(x, align) (((int) (x) + (align - 1)) & ~(align - 1))
- #define ROUND_DOWN(x, align) ((int)(x) & ~(align - 1))
### 用于检查是否已经对齐
- #define ALIGNED(x, align) (((int)(x) & (align - 1)) == 0)
**其中，x为要计算或者检查的值，align是要对齐的单位**
 
### align与末尾的关系
- align = 16 ：：末尾4位清零
- align =  8 ：：末尾3为清零
- align =  4 ：：末尾2为清零
**注：向上对齐的时候，末尾清零后，会相应的增加数值**

-------------------------


## Setup as standalone project page

- Go click **fork** on the [github project page](https://github.com/t413/SinglePaged)
- Rename your new repository to `whatever you want`. (click settings in the right column)
  * It will go live at yourusername.github.io/**WhateverYouWant**
- Clone your repository, cd into the project
- Run `git checkout publish && git branch -D gh-pages && git branch -m gh-pages && git push -uf origin gh-pages` to swap the *publish* and *gh-pages* branch.

Now hop over to [Usage](#usage) to get it running with your own stuff!

**When you publish changes use `git push -u origin gh-pages`**

-------------------------


## Setup inside existing project

This is the most complicated use-case .. but it's the coolest.
Say you've got your kickass project `github.com/t413/kicker` and want to have
{'fraction_non_alphanumeric': 0.18352764197066565, 'fraction_numerical': 0.013915005641218503, 'mean_word_length': 3.2903225806451615, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2733267', 'n_tokens_mistral': 1067, 'n_tokens_neox': 1098, 'n_words': 315}