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
| require 'date' | |
| if ARGV.count != 1 | |
| puts "Need file argument!" | |
| exit | |
| end | |
| filename = ARGV[0] | |
| i = 0 |
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
| #!/usr/bin/env ruby | |
| require 'nokogiri' | |
| require 'Date' | |
| require 'Time' | |
| if (ARGV.count != 2) | |
| puts "usage:" | |
| puts " gpx_reduce.rb file_name number_of_reductions" | |
| puts "e.g. to reduce the number of waypoints to one third:" | |
| puts " gpx_reduce.rb my_file.gpx 3" |
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
| /* | |
| * lexy_sort - Lexical sorting for files, keys etc. | |
| * - NB Fails badly with long numeric components, due to reliance on sscanf+int64 | |
| * | |
| * Compile: clang++ lexy_sort.cpp -std=c++11 -o lexy | |
| * | |
| * Example: bh$ lexy monkeys1n11 monke1n2 monke10n2 monke10n100 monke10n10 | |
| * => monke1n2 | |
| * monke10n2 | |
| * monke10n10 |