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
| #!/usr/bin/env python3 | |
| """ | |
| Download and extract Trivy Windows binary (trivy.exe) into a "trivy" folder. | |
| Usage: | |
| python download_trivy_windows.py [--version X.Y.Z] | |
| If --version is omitted the script queries the GitHub API for the latest release. | |
| """ | |
| import argparse |
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
| #[bench] | |
| fn game_of_life(b: &mut Bencher) { | |
| // naive Vec implementation | |
| const size_board_side: usize = 1024 * 8; | |
| // 1d vec | |
| let mut board = vec![0u8; size_board_side * size_board_side]; | |
| let mut next_state: Vec<u8> = vec![0; size_board_side * size_board_side]; | |
| // random initialization | |
| // outermost ring is invalid | |
| for i in 1..size_board_side - 1 { |
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
| # game of life | |
| import cupy as cp | |
| import cudf | |
| import time | |
| dim_x = 1024 * 8 | |
| dim_y = 1024 * 8 | |
| df = cudf.DataFrame({ |
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
| Set-NetConnectionProfile -Name "Network" -NetworkCategory Private |
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
| Get-NetConnectionProfile |
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
| module Main | |
| import Data.List | |
| data Creep : Type where [external] | |
| data Flag : Type where [external] | |
| moveTo : (HasIO io) => Creep -> Flag -> io () | |
| moveTo creep flag = pure () |
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
| import std/num/random | |
| effect control eat-icecream() : () | |
| effect control check-cost() : int // returns the cost in int | |
| fun my-eat-icecream() { | |
| eat-icecream(); | |
| val cost = check-cost(); | |
| if (cost > 2) | |
| { |
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
| import * as R from 'ramda' | |
| let points = [31000, 31000, 31000, 7000] | |
| let uma = [30000, 10000, -10000, -30000] | |
| let points_and_uma = R.zip(points, uma) | |
| let grouped_by_tie = R.groupWith((a, b) => a[0] == b[0], points_and_uma) | |
| let process_ties = (ties: [number, number][]) => { | |
| let total_uma = R.sum(R.map(t => t[1], ties)) | |
| let average_uma = total_uma / ties.length |
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
| [10:56:33 PM][spawn Spawn1] | |
| [10:56:33 PM]room | |
| [10:56:33 PM][room W4N8] | |
| [10:56:33 PM]name | |
| [10:56:33 PM]([(Right "Bella")] : Nil) | |
| [10:56:33 PM][structure (controller) #946b07739d98cb7] | |
| [10:56:33 PM]structureType | |
| [10:56:33 PM][spawn Spawn1] | |
| [10:56:33 PM]structureType | |
| [10:56:33 PM][spawn Spawn1] |
NewerOlder