Skip to content

Instantly share code, notes, and snippets.

View z-rui's full-sized avatar

张睿 Zhang Rui z-rui

  • Los Gatos, CA
  • 09:30 (UTC -07:00)
View GitHub Profile
@z-rui
z-rui / comb.c
Created July 25, 2020 04:35
Combination encoder / decoder
/**** combination (n choose k) encoder / decoder ****
* *
* a k-combination {c1,...,ck} of {0,1,...,n-1} can *
* be encoded as C(c1,1) + C(c2,2) + ... + C(ck,k). *
* *
****************************************************/
#include <stdio.h>
#include <assert.h>
@z-rui
z-rui / zh_tts.js
Created May 6, 2021 14:41
OsmAnd zh_tts: get rid of "tenths of a mile" and other fixes
// IMPLEMENTED (X) or MISSING ( ) FEATURES, (N/A) if not needed in this language:
//
// (X) Basic navigation prompts: route (re)calculated (with distance and time support), turns, roundabouts, u-turns, straight/follow, arrival
// (X) Announce nearby point names (destination / intermediate / GPX waypoint / favorites / POI)
// (X) Attention prompts: SPEED_CAMERA; SPEED_LIMIT; BORDER_CONTROL; RAILWAY; TRAFFIC_CALMING; TOLL_BOOTH; STOP; PEDESTRIAN; MAXIMUM; TUNNEL
// (X) Other prompts: gps lost, off route, back to route
// (X) Street name and prepositions (onto / on / to) and street destination (toward) support
// (X) Distance unit support (meters / feet / yard)
// (N/A) Special grammar: (please specify which)
// (X) Support announcing highway exits