This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
main(argc, argv) | |
int argc; | |
char *argv[]; | |
{ | |
int i; | |
argc--; | |
for(i=1; i<=argc; i++) | |
printf("%s%c", argv[i], i==argc? '\n': ' '); | |
} |
/* ******************************************************** | |
* Copyright ©2024 Rundata Systems. All rights reserved. | |
* This project is licensed under the GPLv3 License. You | |
* can find a copy of this license at: | |
* https://www.gnu.org/licenses/gpl-3.0.en.html | |
* | |
* More detail (1m read): | |
* https://www.rundata.co.za/rundata/products/verbose_proxy | |
* | |
* Example usage (3m video): |
// Copyright (C) 2023 dasshiva | |
#include <stdlib.h> | |
// Compiles on GCC 11.4.0 ubuntu idk about other systems | |
// Abusing macros to make C look a tiny bit better (maybe worse for some) | |
#define class(x, contents) typedef struct x x; struct x contents; // declare a class x | |
#define var(ty, name) ty name; // declare a variable | |
#define func(ty, x, ...) ty (*##x) (__VA_ARGS__); // declare a member function maybe static or non-static | |
#define static_func_def(ty, x, ...) ty x (__VA_ARGS__) // declare a static function | |
#define func_defnp(class, ty, x) ty x (class* self) // define a non-static function taking no parameters |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
#!/usr/bin/env ruby | |
def pop; $stack.pop || raise(StackUnderflow); end | |
def push(expression); $stack << expression; end | |
def unary; -> { push(yield pop) }; end | |
def binary; -> { push(yield pop, pop) }; end | |
def unary_boolean; -> { push(if yield pop then 1 else 0 end) }; end | |
def binary_boolean; -> { push(if yield pop, pop then 1 else 0 end) }; end | |
def swap; $stack[-2,2] = $stack[-2,2].reverse; end | |
$stack = [] |
Red Team versus the Agents
At a nuclear weapons lab, a team of elite hackers matches wits with undefeated autonomous defenders
ALBUQUERQUE, N.M.--By the time my escort steers me past the armed guards, key-coded doors, and bags of shredded paper into the heart of Sandia National Laboratories, the rematch has already begun. Inside the Advanced Information Systems Lab, six men sit around a large table loaded with laptops and network cables, which snake over to a rack of high-powered machines labeled BORG SERVER CLUSTER. These men are the defense--the Blue Team in this high-tech version of capture the flag--and they lean back in their chairs confidently. This past March, they claim, their "agents"--computer programs that autonomously cooperate to protect a networked system--became the first defenders ever to thwart Sandia's esteemed Red Team of professional hackers. But that was in a two-day skirmish. Now Steven Y. Goldsmith, the research group's lead scientist, has invited the Red Team to spend this entire we
; Ruby has an awesome feature -- string interpolation. Read about it on the internet. | |
; On the other hand, Clojure only has cumbersome Java string formatting, which can not be | |
; used without pain after you've tried Ruby. | |
; So here's this simple macro that basically allows you to do most things you could do | |
; with Ruby string interpolation in Clojure. | |
(ns eis.stuff | |
(:require [clojure.string])) |
;; Big thanks to Christophe Grand - https://groups.google.com/d/msg/clojure/L1GiqSyQVVg/m-WJogaqU8sJ | |
(defn scaffold [iface] | |
(doseq [[iface methods] (->> iface .getMethods | |
(map #(vector (.getName (.getDeclaringClass %)) | |
(symbol (.getName %)) | |
(count (.getParameterTypes %)))) | |
(group-by first))] | |
(println (str " " iface)) | |
(doseq [[_ name argcount] methods] | |
(println |