Skip to content

Instantly share code, notes, and snippets.

package app
import java.io.File
import java.nio.charset.StandardCharsets
import java.nio.file.Files
import scala.collection.JavaConverters._
import scala.io.Source
import scalaz._, Scalaz._, scalaz.effect._
UNetWeaver error: Exception :System.ArgumentException: An element with the same key already exists in the dictionary.
at System.Collections.Generic.Dictionary`2[System.UInt32,System.UInt32].Add (UInt32 key, UInt32 value) [0x0007e] in /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404
at Mono.Cecil.MetadataSystem.SetReverseNestedTypeMapping (UInt32 nested, UInt32 declaring) [0x00000] in <filename unknown>:0
at Mono.Cecil.MetadataReader.AddNestedMapping (UInt32 declaring, UInt32 nested) [0x00000] in <filename unknown>:0
at Mono.Cecil.MetadataReader.InitializeNestedTypes () [0x00000] in <filename unknown>:0
at Mono.Cecil.MetadataReader.InitializeTypeDefinitions () [0x00000] in <filename unknown>:0
at Mono.Cecil.MetadataReader.ReadTypes () [0x00000] in <filename unknown>:0
at Mono.Cecil.ModuleDefinition.<get_Types>b__8 (Mono.Cecil.ModuleDefinition _, Mono.Cecil.MetadataReader reader) [0x00000] in <filename unknown>:0
at
HTTP/1.1 301 MOVED PERMANENTLY
Date: Mon, 31 Aug 2015 09:19:45 GMT
Server: gunicorn/19.3.0
Vary: Accept-Language,Accept-Encoding
Content-Type: text/html; charset=utf-8
Location: http://errors.tinylabproductions.com/api/2/store/
Content-Language: en
Transfer-Encoding: chunked
case class Resources(
food: Food=Food(0), wood: Wood=Wood(0), stone: Stone=Stone(0), gold: Gold=Gold(0),
mana: Mana=Mana(0)
) {
def +(r: Resources) =
Resources(food + r.food, wood + r.wood, stone + r.stone, gold + r.gold, mana + r.mana)
def -(r: Resources) =
Resources(food - r.food, wood - r.wood, stone - r.stone, gold - r.gold, mana - r.mana)
def >=(r: Resources) =
food >= r.food && wood >= r.wood && stone >= r.stone && gold >= r.gold && mana >= r.mana
package app.actors
import java.nio.ByteOrder
import akka.io.Tcp
import akka.typed.ScalaDSL._
import akka.typed._
import akka.util.ByteString
import akka.{actor => untyped}
import app.protobuf.parsing.Parsing
package com.tinylabproductions.tbsgame.notifications;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class LaunchMuteForDialogReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
context.startActivity(
package com.tinylabproductions.tbsgame.notifications;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.util.Log;
import android.widget.Toast;
import com.tinylabproductions.tbsgame.Prefs;
import com.tinylabproductions.tbsgame.data.IntDate;
import com.tinylabproductions.tbsgame.data.IntHHMM;
void addToUI(int width, int height, boolean isTopBanner) {
float density = activity.getResources().getDisplayMetrics().density;
int finalWidth = (int)(width * density);
int finalHeight = (int)(height * density);
bannerFrame = new FrameLayout(activity);
RelativeLayout.LayoutParams bannerLayoutParams =
new RelativeLayout.LayoutParams(finalWidth, finalHeight);
bannerFrame.addView(banner, bannerLayoutParams);
void addToUI(int width, int height, boolean isTopBanner) {
float density = activity.getResources().getDisplayMetrics().density;
int finalWidth = (int)(width * density);
int finalHeight = (int)(height * density);
bannerFrame = new FrameLayout(activity);
bannerFrame.addView(banner, new FrameLayout.LayoutParams(
finalWidth, finalHeight,
(isTopBanner ? Gravity.TOP : Gravity.BOTTOM) | Gravity.CENTER_HORIZONTAL
));
@arturaz
arturaz / IAP.scala
Created May 8, 2016 18:06
Error while trying to update IAPs on google play
def update
(pkgName: PkgName, diff: IAPDiffResult)
(implicit log: Logger, service: AndroidPublisher) =
{
val iaps = service.inappproducts()
def doUpdates() = {
log.logln(s"Updating IAPs (${diff.changes.size})")
diff.changes.foreach { diff =>
val iap = diff.local