Skip to content

Instantly share code, notes, and snippets.

@Mailaender
Mailaender / ReplayBrowserLogic.cs
Created April 22, 2013 22:21
Only show compatible replays when browsing them.
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
@Mailaender
Mailaender / map.yaml
Created March 31, 2013 19:12
How to use spawn MP units
Rules:
World:
SpawnMPUnits@allies:
InitialUnit: mcv,jeep
Faction: allies
SpawnMPUnits@soviets:
InitialUnit: mcv,ftrk
Faction: soviets
@Mailaender
Mailaender / Main.cs
Created March 25, 2013 09:11
Try to calculate machine epsilon
using System;
namespace MachineEpsilon
{
class MainClass
{
public static void Main (string[] args)
{
double machEps = 1.0d;
@Mailaender
Mailaender / index.html
Created March 17, 2013 11:29
Another failed attempt to get jQuery.getJSON() to work
<!DOCTYPE html>
<html>
<head>
<title>OpenRA Master Server</title>
</head>
<body>
<h1>OpenRA Master Server</h1>
<script type="text/javascript" src="jquery-1.9.1.js"></script>
@Mailaender
Mailaender / index.html
Created March 17, 2013 09:18
OpenRA Master Server server list display
<!DOCTYPE html>
<html>
<head>
<title>OpenRA Master Server</title>
</head>
<body>
<h1>OpenRA Master Server</h1>
<div id="list"></div>
<script type="text/javascript" src="jquery.js"></script>
@Mailaender
Mailaender / ClassicProductionQueue.cs
Created March 12, 2013 11:29
optional ProductionQueueSpeedup with integer math to avoid potential desyncs
public class ClassicProductionQueueInfo : ProductionQueueInfo, Requires<TechTreeInfo>, Requires<PowerManagerInfo>, Requires<PlayerResourcesInfo>
{
public readonly bool SpeedUp = false;
public readonly int BuildTimeSpeedUpDivisor = 2;
public readonly int MaxBuildTimeReductionSteps = 6;
public override object Create(ActorInitializer init) { return new ClassicProductionQueue(init.self, this); }
}
[...]
@Mailaender
Mailaender / Ping.cs
Created March 10, 2013 19:33
Ping a host and calculate packet loss.
void GetNetworkStats(string host, int pingAmount, int timeout, out int averagePing, out int packetLoss)
{
Ping pingSender = new Ping();
PingOptions options = new PingOptions(); // default is: don't fragment and 128 Time-to-Live
string data = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
byte[] buffer = Encoding.ASCII.GetBytes(data); // 32 bytes of data
var failedPings = 0;
var latencySum = 0;
@Mailaender
Mailaender / ICSharpCode.SharpZipLib.ApiInfo.xml
Last active December 14, 2015 03:48
mono-api-info ICSharpCode.SharpZipLib.dll
<?xml version="1.0" encoding="utf-8"?>
<assemblies>
<assembly name="ICSharpCode.SharpZipLib" version="0.86.0.518">
<attributes>
<attribute name="System.Reflection.AssemblyTitleAttribute">
<properties>
<property name="Title" value="SharpZipLib for .NET Framework 1.1" />
</properties>
</attribute>
<attribute name="System.Reflection.AssemblyDescriptionAttribute">
@Mailaender
Mailaender / ICSharpCode.SharpZipLib.Combat.ApiInfo.xml
Created February 24, 2013 08:37
mono-api-info ICSharpCode.SharpZipLib.dll
<?xml version="1.0" encoding="utf-8"?>
<assemblies>
<assembly name="ICSharpCode.SharpZipLib" version="0.86.0.518">
<attributes>
<attribute name="System.Reflection.AssemblyTitleAttribute">
<properties>
<property name="Title" value="SharpZipLib for .NET Framework 1.1" />
</properties>
</attribute>
<attribute name="System.Reflection.AssemblyDescriptionAttribute">
diff -upa steam-1.0.0.22/usr/bin/steamdeps.rpmnames steam-1.0.0.22/usr/bin/steamdeps
--- steam-1.0.0.22/usr/bin/steamdeps.rpmnames 2013-02-07 11:07:03.935551942 -0500
+++ steam-1.0.0.22/usr/bin/steamdeps 2013-02-07 11:08:23.219557155 -0500
@@ -280,6 +280,54 @@ def checkConfig( config ):
return True
+###
+def debtorpm( val ):
+ arch32 = ':i386'