Skip to content

Instantly share code, notes, and snippets.

@Birdasaur
Birdasaur / SpotLightTest.java
Created June 1, 2022 02:40
Quick JavaFX 18 test of adding multiple 3D SpotLight objects to the scene.
package edu.jhuapl.trinity.javafx;
import java.util.ArrayList;
import java.util.List;
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.geometry.Point3D;
import javafx.scene.Group;
import javafx.scene.PerspectiveCamera;
import javafx.scene.Scene;
package edu.jhuapl.trinity.javafx;
/*-
* #%L
* ******************************* UNCLASSIFIED *******************************
* LookAtTest.java
* trinity:trinity
* %%
* Copyright (C) 2021 - 2022 Johns Hopkins University Applied Physics Laboratory
* %%
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 18 columns, instead of 1. in line 5.
id,ident,type,name,latitude_deg,longitude_deg,elevation_ft,continent,iso_country,iso_region,municipality,scheduled_service,gps_code,iata_code,local_code,home_link,wikipedia_link,keywords
5531,RJAA,large_airport,Narita International Airport,35.764702,140.386002,141,AS,JP,JP-12,Narita,yes,RJAA,NRT,,,https://en.wikipedia.org/wiki/Narita_International_Airport,"TYO, Tokyo, Tokyo Narita Airport, New Tokyo International Airport"
5536,RJBB,large_airport,Kansai International Airport,34.427299,135.244003,26,AS,JP,JP-27,Osaka,yes,RJBB,KIX,,http://www.kansai-airport.or.jp/en/index.asp,https://en.wikipedia.org/wiki/Kansai_International_Airport,OSA
5576,RJGG,large_airport,Chubu Centrair International Airport,34.85839844,136.8049927,15,AS,JP,JP-23,Tokoname,yes,RJGG,NGO,,,https://en.wikipedia.org/wiki/Ch%C5%ABbu_Centrair_International_Airport,
5598,RJOO,large_airport,Osaka International Airport,34.78549957,135.4380035,50,AS,JP,JP-27,Osaka,yes,RJOO,ITM,,,https://en.wikipedia.org/wiki/Osaka_International_Airport,"OSA, Itami"
5
@Birdasaur
Birdasaur / JapanGEOJSON.json
Last active February 28, 2023 17:00
JapanGEOJSON.json
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Birdasaur
Birdasaur / RussiaGEOJSON.json
Created February 28, 2023 20:32
RussiaGEOJSON.json
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
city city_ascii lat lng country iso2 iso3 admin_name capital population id
Moscow Moscow 55.7558 37.6178 Russia RU RUS Moskva primary 17693000 1643318494
Maykop Maykop 44.6 40.0833 Russia RU RUS Adygeya admin 141970 1643584159
Gorno-Altaysk Gorno-Altaysk 51.96 85.96 Russia RU RUS Altay admin 63214 1643549691
Barnaul Barnaul 53.3567 83.7872 Russia RU RUS Altayskiy Kray admin 633301 1643318931
Blagoveshchensk Blagoveshchensk 50.2578 127.5364 Russia RU RUS Amurskaya Oblast’ admin 224419 1643308239
Arkhangelsk Arkhangelsk 64.55 40.5333 Russia RU RUS Arkhangel’skaya Oblast’ admin 351488 1643797198
Astrakhan Astrakhan 46.3333 48.0167 Russia RU RUS Astrakhanskaya Oblast’ admin 532504 1643407929
Ufa Ufa 54.7261 55.9475 Russia RU RUS Bashkortostan admin 1115560 1643722928
Belgorod Belgorod 50.6 36.6 Russia RU RUS Belgorodskaya Oblast’ admin 391135 1643407900
@Birdasaur
Birdasaur / Hypersurface3D.java
Created March 28, 2023 19:29
Painting JavaFX 3D surface with crosshair
public void updatePaintMesh() {
//in case the data grid dimensions have changed
//make the painting image the same dimension as the data grid for easy math
diffusePaintImage = new WritableImage(
Double.valueOf(xWidth*surfScale).intValue(),
Double.valueOf(zWidth*surfScale).intValue()
);
//if this is the first time ....
if(null == paintTriangleMesh) {
paintTriangleMesh = new TriangleMesh();
@Birdasaur
Birdasaur / geoBoundaries-ETH-ADM1.topojson
Created March 29, 2023 14:54
Topojson for Ethiopia
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Birdasaur
Birdasaur / MexicoRegionsISOCodes.csv
Last active April 24, 2023 20:28
MexicoRegionsISOCodes.csv
n_region_wvs_region_country_specific n_region_iso_region_iso_3166_2 Abundant_Corruption_Percent Work_Is_Important_Percent Religion_Very_Important_Percent per_capita_economic_impact_of_violence_in1kPesos Foreign_workers_as_neighbors Neighbors_Of_A_Different_Race Do_not_trust_Foreigners_at_all Neighbors_Homosexuals Prefer_Male_Political_Leaders
MX: Aguascalientes MX-AGU 61.9 90.48 71.43 41.93 14.29 19.05 28.57 23.81 38.09
MX: Baja California de Norte MX-BCN 72 68 40 70.73 8 6 44 38.00 18
MX: Baja California de Sur MX-BCS 72 68 40 70.73 8 6 44 38.00 18
MX: Campeche MX-CAM 62.5 100 75 25.8 0 0 87.5 25.00 25
MX: Chiapas MX-CHP 71.43 84.42 67.53 20.56 9.09 5.19 62.34 12.99 27.27
MX: Chihuahua MX-CHH 64.81 94.44 59.26 57.57 18.52 7.41 46.3 25.93 16.67
MX: Coahuila MX-COA 71.43 80.95 47.62 17.82 19.05 14.29 45.24 35.71 19.05
MX: Colima MX-COL 58.82 94.12 70.59 72.85 5.88 11.76 52.94 17.65 23.52
MX: Distrito Federal MX-CMX 58.94 64.24 26.49 45.58 19.87 23.84 46.36 24.50 31.12
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"title": {"text": {"signal":"'Perception of ' + Color_Variable + ' by Region'" }},
"width": 675,
"height": 500,
"config": {"style": {"cell": {"stroke": "transparent"}}},
"data": [
{
"name": "symbols",