nasm -f elf64 -g rpn.asm -o rpn.o
ld rpn.o -o rpn
./rpn
Output
--[[ | |
===================================================================== | |
==================== READ THIS BEFORE CONTINUING ==================== | |
===================================================================== | |
Kickstart.nvim is *not* a distribution. | |
Kickstart.nvim is a template for your own configuration. | |
The goal is that you can read every line of code, top-to-bottom, understand |
# ruby 3+ | |
# gem install test-unit | |
require 'test/unit/assertions' | |
include Test::Unit::Assertions | |
def balanced?(input) | |
delimiters = { | |
"(" => ")", | |
"{" => "}", | |
"[" => "]" |
FROM --platform=linux/amd64 ubuntu | |
RUN apt-get update | |
RUN apt-get install make binutils build-essential -y | |
RUN apt-get install nasm gdb strace -y | |
WORKDIR /app |
use std::{thread, sync::{Arc, Mutex, Condvar}}; | |
struct BlockingQueue<T> { | |
store: Mutex<Vec<T>>, | |
emitter: Condvar, | |
} | |
impl<T> BlockingQueue<T> { | |
fn new() -> BlockingQueue<T> { | |
Self { |
fn main() { | |
// 1. Singly Linked List (using Box) | |
{ | |
println!("1. Singly Linked List (using Box)"); | |
struct Node<T> { | |
value: T, | |
next: Option<Box<Node<T>>>, | |
} | |
let mut head = Box::new(Node { value: 1, next: None }); |
fn main() { | |
println!("This is a demonstration of ownership, borrowing and smart pointers in Rust."); | |
// 1. Data on the stack (fixed size) | |
{ | |
println!("Data on the stack (fixed size):"); | |
let age: i32 = 42; | |
println!("Age: {}", age); | |
// Transfer ownership: Copy |
$ docker build -t localhost:5000/myapp . --push
use std::sync::{Arc, Mutex}; | |
use std::sync::Condvar; | |
use std::thread; | |
use std::collections::HashMap; | |
use std::time::Duration; | |
struct Node<T> { | |
value: T, | |
next: Option<Arc<Mutex<Node<T>>>>, | |
previous: Option<Arc<Mutex<Node<T>>>>, |
// A UNIX socket server written in pure Rust | |
use std::io::Read; | |
use std::os::unix::net::{UnixListener, UnixStream}; | |
use std::path::Path; | |
fn main() { | |
let socket = Path::new("/tmp/echo.sock"); | |
if socket.exists() { |