Skip to content

Instantly share code, notes, and snippets.

View Forkk's full-sized avatar
📖
Archive all the things!

Forkk Forkk

📖
Archive all the things!
View GitHub Profile
@Forkk
Forkk / Gloss.hs
Last active August 29, 2015 13:56
import Graphics.Gloss
import Hypercubes
import PVector
import qualified Data.Vector as DVector
import GHC.Float
import Data.Fixed
@Forkk
Forkk / gist:527e95ca12c6c251b01f
Last active August 29, 2015 14:14
repoman2 Design

With the repository manager, the GoUpdate spec will be somewhat overhauled, but the goal is to do so in a manner which is backwards compatible.

Firstly, in repoman2, we are introducing the concept of a "collection". A collection is simply one big folder containing a folder for each platform the application runs on.

A platform directory, or platform, refers to a folder containing GoUpdate repositories (or channels) for a particular platform. Inside this platform directory is a channels.json file, which contains information about all of the

-- | Sample an auto's output when a blip stream outputs something.
--
-- Takes two autos, one which outputs a some value, and another which outputs a
-- blip stream. Produces an auto which outputs a blip with the contents of the
-- first auto whenever the blip stream outputs.
sample :: forall m a b c. (Monad m) =>
Auto m a c
-> Auto m a (Blip b)
-> Auto m a (Blip (b, c))
sample valueAuto blipAuto = onJusts <<< arr extractMaybe <<< ((asMaybes <<< blipAuto) &&& valueAuto)
@Forkk
Forkk / Copy.java
Created January 7, 2012 19:08
Copy file
public static void copyFile(File source, File dest, boolean overwrite)
throws IOException
{
if (!overwrite && dest.exists())
throw new IOException("Can't copy " + source + " to " + dest + ". " +
"The file already exists.");
if (source.isDirectory())
throw new IOException("Can't copy directories! Use recursiveCopy() " +
"instead.");
@Forkk
Forkk / CopyFile.java
Created January 7, 2012 18:51
For some reason, this doesn't actually copy any data.
public static void copyFile(File source, File dest, boolean overwrite)
throws IOException
{
if (!overwrite && dest.exists())
throw new IOException("Can't copy " + source + " to " + dest + ". " +
"The file already exists.");
if (source.isDirectory())
throw new IOException("Can't copy directories! Use recursiveCopy() " +
"instead.");
String path = AccessController.doPrivileged(new PrivilegedExceptionAction()
{
public Object run() throws Exception
{
return Util.getWorkingDirectory() + File.separator + "bin" + File.separator;
}
});
public Applet createApplet() throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
Class<?> appletClass = classLoader
.loadClass("net.minecraft.client.MinecraftApplet");
try
{
Class<?> mcClass = classLoader.loadClass("net.minecraft.client.Minecraft");
Field mcDirField = null;
java.lang.NoSuchMethodError: lu.<init>(IZ)V
at mod_Arrows.load(mod_Arrows.java:115)
at ModLoader.init(ModLoader.java:824)
at ModLoader.AddAllRenderers(ModLoader.java:189)
at afq.<init>(afq.java:80)
at afq.<clinit>(afq.java:9)
at net.minecraft.client.Minecraft.a(SourceFile:265)
at net.minecraft.client.Minecraft.run(SourceFile:648)
at java.lang.Thread.run(Unknown Source)
package net.minecraft.src;
public class ItemCrossbow extends ItemBow
{
private int cooldownTime;
private long lastShotTime;
float powerMult;
// Renderers
HashMap<Class<? extends Entity>, Render> renderMap =
new HashMap<Class<? extends Entity>, Render>();
// Bolt renderer
renderMap.put(EntityBolt.class, new RenderBolt());
// Add the render map
AddRenderer(renderMap);