This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {ShaderLib, ShaderMaterial, UniformsUtils, Vector4} from "three"; | |
| const ParallaxShader = ShaderLib.standard; | |
| export class ParallaxMaterial extends ShaderMaterial { | |
| constructor(parameters) { | |
| super(parameters); | |
| this.lights = true; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Without: | |
| this.actionManager.registerAction(Input.Keys.F1,new Command() { | |
| @Override | |
| public void execute() { | |
| System.out.println(isMenuShown); | |
| } | |
| }); | |
| With lambdas: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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])}) |