- Restrict all code to very simple control flow constructs – do not use goto statements, setjmp or longjmp constructs, and direct or indirect recursion.
- All loops must have a fixed upper-bound. It must be trivially possible for a checking tool to prove statically that a preset upper-bound on the number of iterations of a loop cannot be exceeded. If the loop-bound cannot be proven statically, the rule is considered violated.
- Do not use dynamic memory allocation after initialization.
- No function should be longer than what can be printed on a single sheet of paper in a standard reference format with one line per statement and one line per declaration. Typically, this means no more than about 60 lines of code per function.
- The assertion density of the code should average to a minimum of two assertions per function. Assertions are used to check for anomalous conditions that should never happen in real-life executions. Assertions must always be side-effect free
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 I = x => x | |
const K = x => y => x | |
const A = f => x => f (x) | |
const T = x => f => f (x) | |
const W = f => x => f (x) (x) | |
const C = f => y => x => f (x) (y) | |
const B = f => g => x => f (g (x)) | |
const S = f => g => x => f (x) (g (x)) | |
const S_ = f => g => x => f (g (x)) (x) | |
const S2 = f => g => h => x => f (g (x)) (h (x)) |
Below are a small collection of React examples to get anyone started using React. They progress from simpler to more complex/full featured.
They will hopefully get you over the initial learning curve of the hard parts of React (JSX, props vs. state, lifecycle events, etc).
You will want to create an index.html
file and copy/paste the contents of 1-base.html
and then create a scripts.js
file and copy/paste the contents of one of the examples into it.
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
## start a droplet w/ debian installed | |
## ssh into your droplet | |
$ apt-get install tor tor-arm | |
$ cd /etc/tor | |
$ nano torrc | |
## replace the contents of your torrc file with the below: | |
SocksPort 9150 |
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
/** | |
* Demonstrating configuring a techanjs plot to accept and plot custom data types. | |
*/ | |
// Either, update the default plot accessor | |
// All plots have default accessors. Here we are updating the default and redefining how | |
// to get close from the data | |
candlestick.accessor().close(function(d) { | |
return d.currentBid; // Where d is an item in your supplied array | |
}); |
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
pi@rpi0 ~ $ sudo apt-get purge wolfram-engine | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
The following packages will be REMOVED: | |
wolfram-engine* | |
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. | |
After this operation, 454 MB disk space will be freed. | |
Do you want to continue [Y/n]? y | |
(Reading database ... 77272 files and directories currently installed.) |
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
/** | |
* Retrieves all the rows in the active spreadsheet that contain data and logs the | |
* values for each row. | |
* For more information on using the Spreadsheet API, see | |
* https://developers.google.com/apps-script/service_spreadsheet | |
*/ | |
function readRows() { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var rows = sheet.getDataRange(); | |
var numRows = rows.getNumRows(); |
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
4r5e | |
5h1t | |
5hit | |
a55 | |
anal | |
anus | |
ar5e | |
arrse | |
arse | |
ass |
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
{ | |
"1":{ | |
"name":"Bulbasaur", | |
"attack":49, | |
"defense":49, | |
"evolveLevel":16, | |
"evolveTo":"2", | |
"type":"grass", | |
"moves":[ | |
"tackle", |
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
sed -iE 's/upload_max_filesize = [0-9]\+M/upload_max_filesize = '$1'M/g' /etc/php.ini | |
sed -iE 's/post_max_size = [0-9]\+M/post_max_size = '$1'M/g' /etc/php.ini | |
grep -n upload_max_filesize /etc/php.ini | |
grep -n post_max_size /etc/php.ini | |
/sbin/service httpd restart |