Skip to content

Instantly share code, notes, and snippets.

Avatar
💨

Lance Pollard lancejpollard

💨
View GitHub Profile
@lancejpollard
lancejpollard / stereographic.ts
Created January 24, 2023 21:06
manifolds/stereographic.ts
View stereographic.ts
type _WeightedMidpointInputType = {
weights: OptionalTorchTensor
reducedim: OptionalListInt
dim: number
keepdim: boolean
lincomb: boolean
posweight: boolean
}
type WeightedMidpointInputType = {
@lancejpollard
lancejpollard / readme.md
Created January 19, 2023 14:21
MagicTile Key Snippets for understanding Hyperbolic Tessellation Implementation
View readme.md
private void TrackClosest( Cell cell )
{
	// Are we tracking?
	if( !m_trackClosest )
		return;

	Complex transformedCenter = m_mouseMotion.Isometry.Apply( cell.Boundary.Center.ToComplex() );
	
	double distToOrigin = transformedCenter.Magnitude;
@lancejpollard
lancejpollard / type.ts
Created December 21, 2022 19:20
Pick and Partial together in TypeScript
View type.ts
type PickPartial<T, M> = Partial<Omit<T, keyof M>> & {
[K in keyof T & keyof M]: M[K] extends object
? PickPartial<T[K], M[K]>
: T[K]
} extends infer O
? { [K in keyof O]: O[K] }
: never
@lancejpollard
lancejpollard / test.dart
Created December 15, 2022 08:05
Dart Example JS Compilation Output
View test.dart
main() {
var i = 0;
// while conditions are evaluated before the loop
while(i++ < 2) {
print("while $i");
}
var j = 0;
@lancejpollard
lancejpollard / tarjans.js
Created November 15, 2022 23:18 — forked from HopefulLlama/tarjans.js
JavaScript implementation of Tarjan's strongly connected components algorithm
View tarjans.js
function Vertex(name) {
this.name = name;
this.index = null;
this.lowlink = null;
this.onStack = false;
this.children = [];
}
function TarjanRunner() {
@lancejpollard
lancejpollard / example.tsx
Created November 8, 2022 15:03
FontObserver React Hook (to prevent FOUC)
View example.tsx
import { useState, useEffect } from 'react'
import FontFaceObserver from 'fontfaceobserver'
export default function useFonts(allFonts, selectedFonts) {
const [isVisible, setIsVisible] = useState(false)
useEffect(() => {
const fonts = selectedFonts.length
? selectedFonts.map(name => allFonts[name])
@lancejpollard
lancejpollard / list.csv
Created October 27, 2022 03:46
English Adverbs not Ending with -ly (from Wiktionary)
View list.csv
word
abread
abreast
abrest
abrim
abroach
abroad
abrode
abrood
abubble
View languages-without-adjectives-note.md

Source

This is a somewhat belated summary to the query I made about a month ago. The original query goes as follows:

James McCawley (1992) has suggested that there be no such category as >Adjective in Mandarin Chinese after failing to distinguish adjectives >from verbs with a list of universal properties. I like to know if >there are indeed languages without adjectives. Japanese and some >Sino-Tibetan languages can employ 'adjectives' as predicate without a >copula, just like Chinese. I wonder if there is any difficulty in >identifying adjectives in these languages. I will post a summary if >there is interest. > >Reference: >James McCawley (1992) Justifying part-of-speech assignments in > Mandarin Chinese. Journal of Chinese Linguistics 20, 2, > 211-46.

I received seven replies from the respondents below. Languages they cited are given along with the respondents' names according to the order their notes reached me. Many thanks to their responses.

John E. Koontz

@lancejpollard
lancejpollard / model.js
Created May 8, 2022 01:49
How your code ends up without a framework (SQL without a good model layer)
View model.js
const { uniq, omit } = require('lodash')
const serialization = require('./serialization')
const knex = require('../../knex')
const toneText = require('../../../../../../drumwork/deck/tone')
const callText = require('../../../../../../drumwork/deck/call')
let objectKeyToIdMap
let objectIdToKeyMap
let languageMap
@lancejpollard
lancejpollard / sequences.csv
Created April 29, 2022 12:17
Complete List of N=5 Binary de Bruijn Sequences
View sequences.csv
sequence
00000100011001010011101011011111
00000100011001010011101101011111
00000100011001010011111010110111
00000100011001010011111011010111
00000100011001010110100111011111
00000100011001010110100111110111
00000100011001010110111010011111
00000100011001010110111110100111
00000100011001010111011010011111