Skip to content

Instantly share code, notes, and snippets.

View APIUM's full-sized avatar

Algy APIUM

  • Melbourne, Australia
View GitHub Profile
-antigen-parse-args () {
local spec="$1"
shift
spec="$(echo "$spec" | tr '\n' ' ' | sed 's/[[:space:]]//g')"
local code=''
--add-var () {
test -z "$code" || code="$code\n"
code="${code}local $1='$2'"
}
local positional_args="$(echo "$spec" | cut -d\; -f1)"
-antigen-parse-args () {
576 # An argument parsing functionality to parse arguments the *antigen* way :).
577 # Takes one first argument (called spec), which dictates how to parse and
578 # the rest of the arguments are parsed. Outputs a piece of valid shell code
579 # that can be passed to `eval` inside a function which creates the arguments
580 # and their values as local variables. Suggested use is to set the defaults
581 # to all arguments first and then eval the output of this function.
582
583 # Spec: Only long argument supported. No support for parsing short options.
584 # The spec must have two sections, separated by a `;`.
;
; ThinkingTask2.asm
;
; Created: 8/08/2018 12:41:57 PM
; Author : APIUM
;[pppp
; Define here the variables
.def inputval = r16
.def outputval = r17
; tableSearch.asm
;
; Created: 21/07/2018 6:49:15 PM
; Author : Glenn Matthews
;
; Define here the variables
.def temp =r16
.def small =r17
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct card {
char suit[10];
int value;
} card;
// hearts, clubs, spades, diamonds
@APIUM
APIUM / error
Created March 6, 2018 11:29
Matlab Error
com.jogamp.opengl.GLException: X11GLXDrawableFactory - Could not initialize shared resources for X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x6f37fa83, isOwner false, <3f72fc6, 609a0a57>[count 0, qsz 0, owner <NULL>]]]
at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:326)
at jogamp.opengl.SharedResourceRunner.run(SharedResourceRunner.java:297)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.jogamp.opengl.GLException: AWT-EventQueue-0-SharedResourceRunner: Error making temp context(1) current: display 0x7f40800ebe30, context 0x7f40801d4fc0, drawable X11OnscreenGLXDrawable[Realized true,
Factory jogamp.opengl.x11.glx.X11GLXDrawableFactory@13194b59,
Handle 0x2400002,
Surface WrappedSurface[ displayHandle 0x7f40800ebe30
, surfaceHandle 0x2400002
, size 64x64
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDPT6XKozeOYQB2HElFl6Wiw1HPloU/FhMlKif1zF/xeiWqfAaF/MCATggCwGusjNWRqiczldrO9jDjNWgY5Vq1ZtRLOX28hq72sUmLPGlnnKysE21J5xBcTgYEEzGr7tPdHxGS1LbU35AmTPnoeVJZ5KfYk2fjqgTZK4WnmBQ6VPTPiDoG093Dm3JbGaVlEorNE44lVmLbdbvbCs2Pb08xarcNoftVzKirYpeCo9gXyFCvETR08sT2wDW7FzkyotRo6nPfTrQQftpDdn3Fj1UD5nfK08f3nSBCEQwxvoXmClzgrvf/nc+SrIbLkmm2K0ZVd1f4s9755AOVgqiRxmoh apium@slegestor
@APIUM
APIUM / gist:ca1fa9e5dbbccb2a99de26e85d1cbfd0
Last active March 2, 2017 13:09
dailyProgrammer 303 Easy
# Daily Programmer 303
hwv = input("Please enter h, w and v seperated by space > ").split(' ')
height,width,velocity = int(hwv[0]),int(hwv[1]),int(hwv[2])
position = [0,height]
moves = 0
bounces = 0
plain = list('abcdefghijklmnopqrstuvwxyz .!@#$%^&*()_+|~,/<>?~|\'\:\=1234567890')
cipher = list('ZYXWVUTSRQPONMLKJIHGFEDCBA .!@#$%^&*()_+|~,/<>?~|\'\:\=1234567890')
answer = []
atBash = input('What do you want to encode? => ').lower()
for i in atBash:
index = plain.index(i)
answer.append(cipher[int(index)])
#! /usr/bin/python3
# Reddit Daily Programming Challenge 277 - Fake Coins
# The challenge input
challenge = """abcd efgh equal
abci efjk left
abij efgl equal
mnopqrs tuvwxyz equal"""
# Global variables