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
import java.util.HashMap; | |
class Program { | |
public static void main(String[] args) { | |
char[] variables = {'p', 'q'}; | |
int variableCount = variables.length; | |
int possibleCases = (int)Math.pow(2, variableCount); | |
Eval expression = new Impl(new Var('p'), new Var('q')); // p -> q | |
HashMap<Character, Boolean> env = new HashMap<>(); |
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 google.colab import drive | |
drive.mount('/content/gdrive') | |
import requests | |
file_url ="https://download.fedoraproject.org/pub/fedora/linux/releases/39/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-39-1.5.iso" | |
r = requests.get(file_url, stream = True) | |
with open("/content/gdrive/My Drive/fedora.iso", "wb") as file: | |
for block in r.iter_content(chunk_size = 1024): |
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
echo "Hello world!" | nc -U /tmp/test-socket/socket.sock | |
# Hi! |
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
local M = {} | |
local code_action = vim.lsp.buf.code_action | |
--- Applies the code action with the given prefix | |
--- Example: `actions.apply("Wrap in Some")` | |
--- @param prefix string | |
M.apply = function(prefix) | |
code_action({ | |
apply = true, |
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
open_help_float = function() | |
local ui = vim.api.nvim_list_uis()[1] | |
local width = 80 | |
local height = 25 | |
local row = (ui.height - height) * 0.4 | |
local col = (ui.width - width) * 0.5 | |
local win = vim.api.nvim_get_current_win() | |
local buf = vim.api.nvim_win_get_buf(win) | |
vim.api.nvim_win_set_config(win, { |
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
[package] | |
name = "snake-term" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies] | |
crossterm = "0.26.1" | |
rand = "0.8.5" |
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 crate::opcodes::CPU_OPCODES; | |
use self::{AddressMode::*, AsmInstr::*, StatusFlag::*}; | |
#[rustfmt::skip] | |
#[derive(Debug, Clone, Copy)] | |
pub enum AsmInstr { | |
LDA, LDX, LDY, | |
STA, STX, STY, | |
TAX, TAY, TSX, TXA, TXS, TYA, |
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
/** | |
* @fileoverview Brute force algorithm for solving a 2x2 cube | |
* @author LIOKA Ranarison Fiderana | |
*/ | |
// These constants represent the corner pieces (see the picture in the comment) | |
const UBL = 0; | |
const UBR = 1; | |
const UFR = 2; | |
const UFL = 3; |