Skip to content

Instantly share code, notes, and snippets.

@sehugg
sehugg / gist:7894677
Created December 10, 2013 17:36
VTUIUtils.h/m - spinner overlay
// VTUIUtils.h
#import <Foundation/Foundation.h>
@interface VTUIUtils : NSObject {
}
+ (void)fadeInOverlay: (UIView*)parentView;
@sehugg
sehugg / gist:37b28646f119859dd27e
Created October 13, 2014 22:25
iOS setContinuousRendering() potential fix
diff --git a/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSGraphics.java b/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSGraphics.java
index 330b7fb..fe9bd53 100644
--- a/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSGraphics.java
+++ b/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSGraphics.java
@@ -65,7 +65,8 @@ public class IOSGraphics extends NSObject implements Graphics, GLKViewDelegate,
@Override
public void viewWillAppear (boolean arg0) {
super.viewWillAppear(arg0);
- setPaused(!graphics.isContinuous);
+ // start GLKViewController even though we may only draw a single frame
##
## Android/iOS icon and default image resizer
## Requirements: apt-get install imagemagick pngquant
##
## 512x512 square Android icon
SRCICON=art/icon-512.png
## 512x512 icon for iOS
@sehugg
sehugg / FoundationLogPrintStream.java
Created November 3, 2014 18:09
Console logging for RoboVM
import org.robovm.apple.foundation.Foundation;
public class FoundationLogPrintStream extends LoggingPrintStream
{
@Override
public void log(String text)
{
Foundation.log(text);
}
@sehugg
sehugg / nietz_stateful.py
Last active October 16, 2017 19:45
Stateful LSTM text generation with Keras 1.0
#!/usr/bin/env python
from __future__ import print_function
from keras.models import Sequential
from keras.layers import TimeDistributed
from keras.layers.core import Dense, Activation, Dropout, RepeatVector, TimeDistributedDense
from keras.layers.recurrent import LSTM
from keras.utils.data_utils import get_file
import numpy as np
import random,string
import sys
@sehugg
sehugg / attractmode.py
Last active May 20, 2016 23:36
Random MAME launcher script for RetroPie
#!/usr/bin/python
import random, subprocess, time, sys, os, os.path
roms = os.listdir(os.path.expanduser('~/RetroPie/roms/mame-mame4all/'))
roms = [x.split('.')[0] for x in roms]
random.shuffle(roms)
MAME4ALL = '/opt/retropie/emulators/mame4all/mame'
'''Test of stateful LSTM.
This trains a LSTM to convert a frequency-modulated signal to a sine wave.
The period of the signal is greater than the temporal dimension of the LSTM,
so in theory the stateful version should have an advantage.
'''
from __future__ import print_function
import os
os.environ['KERAS_BACKEND'] = 'tensorflow'
@sehugg
sehugg / CPU.ASM
Created January 7, 2017 14:06
An Apple ][ emulator in 8086 assembler
name cpu
.model large
EXTRN _rwts
.data
EXTRN _memseg:DWORD
.code
; *** EQUATES
acc equ cl
// duplicates static variable bug for CC65
#include <stdio.h>
#include <limits.h>
unsigned char success=0;
unsigned char failures=0;
unsigned char dummy=0;
#define COUNT 256 /* Up to what number? */
;----------------------
; Star Castle
; By Scott Williamson
; Started 2/6/2008
; CX2655
;----------------------
;
; TODO
;
;----------------------