Skip to content

Instantly share code, notes, and snippets.

View jsam's full-sized avatar
🦁

sam jsam

🦁
View GitHub Profile
import math
def generate_numbers(N):
"""Generate first N elements of the sequence S. Complexity is NlogN.
We have 3 bounds to consider:
1) Numbers generated when P == Q
2) Numbers generated when P > Q, the bound is given by grounding the Q
3) Numbers generated when P < Q, the bound is given by grounding the P
@jsam
jsam / bz2inline.go
Last active October 14, 2020 12:42
example
package main
import (
"bufio"
"compress/bzip2"
"fmt"
"io"
"os"
)
@jsam
jsam / gist:9dfa9403bc08f35923aaf8269834636b
Created October 5, 2020 09:48
player interactions/graphs
{
"data": {
"distanceGraph": [
{
"subject": "81",
"predicate": 23.3,
"object": "34"
},
...
],
git config --global url."[email protected]:".insteadOf "https://github.com/"
#git config --system url."[email protected]:".insteadOf "https://github.com/"
export GOPRIVATE=github.com/imbafactory
(map[string]interface {}) (len=206) {
(string) (len=30) "CBodyComponent.m_MeshGroupMask": (uint64) 0,
(string) (len=47) "CBodyComponent.m_bClientClothCreationSuppressed": (bool) false,
(string) (len=37) "CBodyComponent.m_bClientSideAnimation": (bool) true,
(string) (len=36) "CBodyComponent.m_bIsAnimationEnabled": (bool) true,
(string) (len=36) "CBodyComponent.m_bIsRenderingEnabled": (bool) true,
(string) (len=39) "CBodyComponent.m_bUseParentRenderBounds": (bool) false,
(string) (len=22) "CBodyComponent.m_cellX": (uint64) 86,
(string) (len=22) "CBodyComponent.m_cellY": (uint64) 150,
(string) (len=22) "CBodyComponent.m_cellZ": (uint64) 128,
{
"m_bSuggestedLaneJungle.0000":"SuggestedLane.0.Jungle",
"m_bSuggestedLaneJungle.0001":"SuggestedLane.1.Jungle",
"m_bSuggestedLaneJungle.0002":"SuggestedLane.2.Jungle",
"m_bSuggestedLaneJungle.0003":"SuggestedLane.3.Jungle",
"m_bSuggestedLaneJungle.0004":"SuggestedLane.4.Jungle",
"m_bSuggestedLaneRoam.0000":"SuggestedLane.0.Roam",
"m_bSuggestedLaneRoam.0001":"SuggestedLane.1.Roam",
"m_bSuggestedLaneRoam.0002":"SuggestedLane.2.Roam",
"m_bSuggestedLaneRoam.0003":"SuggestedLane.3.Roam",
@jsam
jsam / gist:aeb314c2ff71ed40d386b531515d8334
Created September 3, 2020 17:41
edited player resources
{
"m_vecPlayerData.0000.m_iszPlayerName":"players.0.PlayerName",
"m_vecPlayerData.0000.m_iPlayerTeam":"players.0.PlayerTeam",
"m_vecPlayerData.0000.m_iConnectionState":"players.0.ConnectionState",
"m_vecPlayerData.0000.m_iPlayerSteamID":"players.0.PlayerSteamID",
"m_vecPlayerData.0000.m_bWasMVPLastGame":"players.0.MVPLastGame",
"m_vecPlayerData.0000.m_iRankTier":"players.0.RankTier",
"m_vecPlayerTeamData.0000.m_iTeamSlot":"players.0.TeamSlot",
"m_vecPlayerTeamData.0000.m_nSelectedHeroID":"players.0.SelectedHeroID",
"m_vecPlayerTeamData.0000.m_iKills":"players.0.Kills",
@jsam
jsam / gist:b8ce8d003293bb5effecfce028f9b5c4
Created August 18, 2020 13:53
socket structure events
{
"type": "GAME_RULES",
"renames": { ... },
"events": [
{
"type": "GamePaused"
"keys": ["GameTime", "GamePaused"],
},
{
"type": "GameWinner"
@jsam
jsam / express.py
Created June 26, 2020 13:41
expression tree
from abc import ABC
class Node:
def __init__(self, data):
self.data = data
self.left = self.right = None
def __str__(self):
@jsam
jsam / gist:b2aeaced1c610856f1e08b26ce0ca72f
Created June 24, 2020 16:17
jena native --no-fallback compile
Error: Unsupported features in 15 methods
Detailed message:
Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved method during parsing: org.apache.logging.log4j.core.async.AsyncLoggerConfigDisruptor.start(). To diagnose the issue you can use the --allow-incomplete-classpath option. The missing method is then reported at run time when it is accessed the first time.
Trace:
at parsing org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:296)
Call path from entry point to org.apache.logging.log4j.core.config.AbstractConfiguration.start():
at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:287)
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:618)
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:691)
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:708)