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
# Lookup shell on explainshell | |
function explain() { | |
# Example url: http://explainshell.com/explain/tar?args=xzvf+archive.tar.gz | |
URL="http://explainshell.com/explain" | |
FIRST=0 | |
for i; do | |
if [ $FIRST -eq 0 ]; then | |
URL="${URL}/$i?args=" | |
FIRST=1 | |
elif [ $FIRST -eq 1 ]; then |
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
(venv) (base) [jkoppel@MacBook-Pro-173:tmp/trustfall]$ cargo build (01-19 04:53) | |
warning: output filename collision. | |
The lib target `trustfall` in package `trustfall v0.7.1 (/Users/jkoppel/tmp/trustfall/trustfall)` has the same output filename as the lib target `trustfall` in package `pytrustfall v0.1.6 (/Users/jkoppel/tmp/trustfall/pytrustfall)`. | |
Colliding filename is: /Users/jkoppel/tmp/trustfall/target/debug/libtrustfall.rlib | |
The targets should have unique names. | |
Consider changing their names to be unique or compiling them separately. | |
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>. | |
Compiling demo-hytradboi v0.1.0 (/Users/jkoppel/tmp/trustfall/demo-hytradboi) | |
Compiling pytrustfall v0.1.6 (/Users/jkoppel/tmp/trustfall/pytrustfall) |
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
############################# /*##########################\ -- ############################# -- | |
############################# ############################# -- ############################# -- | |
#### #### #### #### -- #### #### -- | |
#### Section Heading #### #### Section Heading #### -- #### Section Heading #### -- | |
#### #### #### #### -- #### #### -- | |
############################# ############################# -- ############################# -- | |
############################# \##########################*/ -- ############################# -- | |
| |
####################### /*###################*\ -- ####################### -- | |
# # # # -- # # -- |
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.15; | |
import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol"; | |
import {ERC20} from "solmate/tokens/ERC20.sol"; | |
import {Clone} from "clones/Clone.sol"; | |
import {IDelegate} from "interfaces/IDelegate.sol"; | |
import {CoolerFactory} from "src/CoolerFactory.sol"; | |
import {CoolerCallback} from "src/CoolerCallback.sol"; |
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
// SPDX-License-Identifier: AGPL-3.0-only | |
pragma solidity 0.8.19; | |
// External Libraries | |
import "solady/src/auth/Ownable.sol"; | |
import "openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol"; | |
import "openzeppelin-contracts-upgradeable/contracts/token/ERC20/IERC20Upgradeable.sol"; | |
import "openzeppelin-contracts/contracts/access/AccessControl.sol"; | |
import "openzeppelin-contracts-upgradeable/contracts/security/ReentrancyGuardUpgradeable.sol"; | |
// Interfaces |
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
void __thiscall army::Walk(army *ecx0, signed int dir, int last, int notFirst) | |
{ | |
int v4; // ST3C_4@78 | |
int v6; // [sp+1Ch] [bp-24h]@26 | |
int v7; // [sp+20h] [bp-20h]@80 | |
int i; // [sp+24h] [bp-1Ch]@47 | |
int v9; // [sp+28h] [bp-18h]@77 | |
signed int targCell; // [sp+30h] [bp-10h]@1 | |
int offsetY; // [sp+34h] [bp-Ch]@26 | |
int v12; // [sp+38h] [bp-8h]@26 |
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
# From "Raymond Hettinger - Beyond PEP 8 -- Best practices for beautiful intelligible code - PyCon 2015" | |
# Bad code | |
import jnettools.toolselements.NetworkElement, \ | |
jnettools.tools.Routing, \ | |
jnettools.tools.RouteInspector | |
ne=jnettools.tools.elements.NetworkElement( '171.0.2.45' ) | |
try: |
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
This is one of the simpler examples from a series of examples designed to be challenging to analyze by method of combining many featuress. | |
The goal of this analyzer is to verify the assertions. This example involves interplay between integer constraints and aliasing, and also requires models for the Urn functions. | |
------------------------------ | |
void func() { | |
Urn u1 = new Urn(); | |
Urn u2 = new Urn(); |
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
Inductive val := | |
| ValConst (n : nat) | |
| Closure (e1 : list val) (e2 : exp) | |
with | |
exp := | |
| Var (v : var) | |
| Plus (e1 e2 : exp) |
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
generator int exp([int nvars, int nconsts], int bnd, int[nvars] vars, int[nconsts] consts){ | |
//In this generator, nvars is the number of variables and nconsts is the number of constants. | |
//the array vars contains the values of all the variables and the array consts of all the constants. | |
//Note that unlike problem 1, where you were generating ASTs, here you are synthesizing the actual function. | |
//Also note that you will probably need a separate generator for the boolean expressions. | |
if (bnd == 0) { | |
return {| vars[??] | consts[??] |}; | |
} |
NewerOlder