Skip to content

Instantly share code, notes, and snippets.

View AsafFisher's full-sized avatar

Asaf Fisher AsafFisher

  • IL
View GitHub Profile
@AsafFisher
AsafFisher / gist:769006f1d889daadf0d095af747da44d
Created August 4, 2016 00:08
Error... Have no idea why....
In file included from /home/asaf/GitHub/Assembler/lineparser.c:6:0:
/home/asaf/GitHub/Assembler/protocols.h:3:15: error: redefinition of ‘union Word’
typedef union Word{
^
In file included from /home/asaf/GitHub/Assembler/lineparser.h:1:0,
from /home/asaf/GitHub/Assembler/lineparser.c:5:
/home/asaf/GitHub/Assembler/protocols.h:3:15: note: originally defined here
typedef union Word{
^
#ifndef STARTIF
#include <string.h>
typedef union Word{
/*Binary structure: 15 bits basic cell*/
struct{
unsigned int cell:15;
}fullword;
/*Binary structure: |DUMY|GRP|OPCODE|SRCAR|DESTAR|ERA|*/
/9j/4AAQSkZJRgABAQAASABIAAD/4QBYRXhpZgAATU0AKgAAAAgAAgESAAMAAAABAAEAAIdpAAQA
AAABAAAAJgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAE16ADAAQAAAABAAAE2gAAAAD/7QA4
UGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAAA4QklNBCUAAAAAABDUHYzZjwCyBOmACZjs+EJ+/8AA
EQgE2gTXAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIB
AwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBka
JSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SV
lpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX2
9/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAEC
dwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4
OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWm
import java.util.TreeMap;
public class MyClass {
static TreeMap<Integer, String> a = new TreeMap<Integer, String>();public static void main(String args[]) {a.put(1000, "M");a.put(900, "CM");a.put(500, "D");a.put(400, "CD");a.put(100, "C");a.put(90, "XC");a.put(50, "L");a.put(40, "XL");a.put(10, "X");a.put(9, "IX");a.put(5, "V");a.put(4, "IV");a.put(1, "I");System.out.print(b(44));}static String b(int n){int n1=a.floorKey(n);if(n==n1)return a.get(n);return(a.get(n1) + b(n-n1));}
}
@AsafFisher
AsafFisher / server.cpp
Created March 24, 2018 05:18
LOOK AT LINE 70.
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <string>
#include "FS.h"
using namespace std;
//std::string
char payload[] = "<img src='im.png' height='2000' width='1500'/>";
/* Set these to your desired credentials. */
@AsafFisher
AsafFisher / mod.rs
Last active October 9, 2020 21:06
cool
macro_rules! concurrent {
(
[ $($pass_rc:ident),* ];$($x:expr);*;
) => {
{
{
$(
let $pass_rc = Arc::new($pass_rc);
let $pass_rc = &$pass_rc.clone();
@AsafFisher
AsafFisher / xonsh_aliases_dot_xsh.py
Last active March 17, 2022 22:15
xonsh aliases
#!/usr/bin/env xonsh
from packaging import version as ver
# Git version checking
git_version = $(git version 2>/dev/null).split()[2]
#
# Functions
#