Skip to content

Instantly share code, notes, and snippets.

public class PopFromStack<T> : Action
{
private BBKey<List<T>> _items;
private BBKey<T> _item;
public PopFromStack(BBKey<List<T>> items, BBKey<T> item)
{
_items = items;
_item = item;
}
import {ShaderLib, ShaderMaterial, UniformsUtils, Vector4} from "three";
const ParallaxShader = ShaderLib.standard;
export class ParallaxMaterial extends ShaderMaterial {
constructor(parameters) {
super(parameters);
this.lights = true;
}
FAerialNavigationVoxel* AAerialNavigationManager::GetVoxel(int32 X, int32 Y, int32 Z)
{
auto Plane = NavigationData.Planes[Z];
int32 i = X + GetGridSize().X * Y;
FAerialNavigationVoxel Vox = Plane.Voxels[i]; //UStruct, TArray<FAerialNavigationVoxel> Voxels;
UE_LOG(LogTemp, Warning, TEXT("GetVoxelAt: %s"), *Vox.WorldLocation.ToString());
return &Plane.Voxels[i];
}
import re
from xml.etree import ElementTree as Et
from regexp import RE_URL, URL_REGEX
RE_M3U_URL = RE_URL
RE_M3U_INFOS = re.compile(r"#EXTINF:-1,(.*)\n{}".format(URL_REGEX))
RE_PLS_URL = re.compile(r"File(\d+)={}\n".format(URL_REGEX))
RE_PLS_TITLE = re.compile(r"Title(\d+)=(.*)\n")
class PlaylistParser:
_strategy = {"audio/x-scpls": PlaylistParserPLS(),
"application/pls+xml": PlaylistParserPLS(),
"audio/mpegurl": PlaylistParserM3U(),
"audio/x-mpegurl": PlaylistParserM3U(),
"application/xspf+xml": PlaylistParserXSPF()
}
def parse(self, mime, data):
self.data = data
public class Person {
private final String firstName;
private final String lastName;
public Person(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
public String getFirstName() {
return firstName;
}
Without:
this.actionManager.registerAction(Input.Keys.F1,new Command() {
@Override
public void execute() {
System.out.println(isMenuShown);
}
});
With lambdas:
@Busata
Busata / app.py
Last active August 29, 2015 14:11
def create_app(configuration=config.base_config, enable_blueprints=True):
app = Flask(__name__)
app.config.from_object(configuration)
register_extensions(app)
if enable_blueprints:
register_blueprints(app)
register_errorhandlers(app)
return app
def run_import():
with open('listings.csv', 'r') as csv_file:
reader = csv.reader(csv_file, delimiter=";")
inserts = []
for row in reader:
inserts.append({'item_id': int(row[0]),
'order_type': ItemOrderType.from_string(row[1].replace('<','').replace('>','')),
'listings': int(row[2]),
'unit_price': int(row[3]),
'quantity': int(row[4])})