democracy 0.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of democracy might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/LIBERTY +310 -0
- data/README +310 -0
- data/README2 +14 -0
- data/READ_THIS_TO_CHANGE_THINGS +310 -0
- data/Resume.pdf +0 -0
- data/Ruby Installer.exe +0 -0
- data/VERSION_NUMBER +1 -0
- data/WE_NEEDNT_BE_ENSLAVED +310 -0
- data/_.html +460 -0
- data/__index.html +11 -0
- data/a.html +21 -0
- data/ac +73 -0
- data/all_code.cpp +280 -0
- data/all_code.js +30 -0
- data/app_topics +93 -0
- data/background.jpg +0 -0
- data/better_string +26 -0
- data/bin/abs +0 -0
- data/bin/ac +34 -0
- data/bin/add +0 -0
- data/bin/append +14 -0
- data/bin/args +0 -0
- data/bin/autorequire +85 -0
- data/bin/big_num +155 -0
- data/bin/black +0 -0
- data/bin/blue +0 -0
- data/bin/bold +0 -0
- data/bin/c_repl +76 -0
- data/bin/close +3 -0
- data/bin/copy +0 -0
- data/bin/count +0 -0
- data/bin/cpy +0 -0
- data/bin/cyan +0 -0
- data/bin/democracyinstall.exe +0 -0
- data/bin/div +0 -0
- data/bin/down_all_links +50 -0
- data/bin/dump +0 -0
- data/bin/email +127 -0
- data/bin/emerald-browser +0 -0
- data/bin/emoji +176 -0
- data/bin/executable +1 -0
- data/bin/exp +0 -0
- data/bin/files +0 -0
- data/bin/floor +0 -0
- data/bin/foreach +49 -0
- data/bin/g+ +557 -0
- data/bin/get_all_links +11 -0
- data/bin/github +55 -0
- data/bin/green +0 -0
- data/bin/gsearch +159 -0
- data/bin/gsub +0 -0
- data/bin/gsub_in_place +0 -0
- data/bin/last_nth +0 -0
- data/bin/lines +0 -0
- data/bin/magenta +0 -0
- data/bin/mkfile +47 -0
- data/bin/mul +0 -0
- data/bin/nth +0 -0
- data/bin/open +0 -0
- data/bin/play +0 -0
- data/bin/prepend +14 -0
- data/bin/processes +3 -0
- data/bin/qt_download +21 -0
- data/bin/record +121 -0
- data/bin/red +0 -0
- data/bin/replace_in_place +0 -0
- data/bin/replace_not_in_place +0 -0
- data/bin/selectlines +0 -0
- data/bin/sort_in_place +0 -0
- data/bin/splitfiles +16 -0
- data/bin/squeeze +17 -0
- data/bin/string +161 -0
- data/bin/strip_extensions +13 -0
- data/bin/sub +0 -0
- data/bin/t +63 -0
- data/bin/tracefile +555 -0
- data/bin/underline +0 -0
- data/bin/undump +0 -0
- data/bin/viu +0 -0
- data/bin/white +0 -0
- data/bin/yellow +0 -0
- data/bin/youtube_video +45 -0
- data/bin/youtube_video2 +45 -0
- data/code.js +28490 -0
- data/crystal-gobject/.git/HEAD +1 -0
- data/crystal-gobject/.git/config +11 -0
- data/crystal-gobject/.git/description +1 -0
- data/crystal-gobject/.git/hooks/applypatch-msg.sample +15 -0
- data/crystal-gobject/.git/hooks/commit-msg.sample +24 -0
- data/crystal-gobject/.git/hooks/fsmonitor-watchman.sample +109 -0
- data/crystal-gobject/.git/hooks/post-update.sample +8 -0
- data/crystal-gobject/.git/hooks/pre-applypatch.sample +14 -0
- data/crystal-gobject/.git/hooks/pre-commit.sample +49 -0
- data/crystal-gobject/.git/hooks/pre-merge-commit.sample +13 -0
- data/crystal-gobject/.git/hooks/pre-push.sample +53 -0
- data/crystal-gobject/.git/hooks/pre-rebase.sample +169 -0
- data/crystal-gobject/.git/hooks/pre-receive.sample +24 -0
- data/crystal-gobject/.git/hooks/prepare-commit-msg.sample +42 -0
- data/crystal-gobject/.git/hooks/update.sample +128 -0
- data/crystal-gobject/.git/index +0 -0
- data/crystal-gobject/.git/info/exclude +6 -0
- data/crystal-gobject/.git/logs/HEAD +1 -0
- data/crystal-gobject/.git/logs/refs/heads/main +1 -0
- data/crystal-gobject/.git/logs/refs/remotes/origin/HEAD +1 -0
- data/crystal-gobject/.git/objects/pack/pack-c21cfd88c6eef3076f2c2aebb658b750e87e10b6.idx +0 -0
- data/crystal-gobject/.git/objects/pack/pack-c21cfd88c6eef3076f2c2aebb658b750e87e10b6.pack +0 -0
- data/crystal-gobject/.git/packed-refs +15 -0
- data/crystal-gobject/.git/refs/heads/main +1 -0
- data/crystal-gobject/.git/refs/remotes/origin/HEAD +1 -0
- data/crystal-gobject/.github/workflows/ci.yml +22 -0
- data/crystal-gobject/.gitignore +14 -0
- data/crystal-gobject/LICENSE +27 -0
- data/crystal-gobject/README.md +143 -0
- data/crystal-gobject/samples/base_class_container.cr +15 -0
- data/crystal-gobject/samples/connect_after.cr +35 -0
- data/crystal-gobject/samples/crout/crout.cr +59 -0
- data/crystal-gobject/samples/e +0 -0
- data/crystal-gobject/samples/gdk_window.cr +36 -0
- data/crystal-gobject/samples/glist.cr +16 -0
- data/crystal-gobject/samples/greeter.cr +34 -0
- data/crystal-gobject/samples/greeter.glade +91 -0
- data/crystal-gobject/samples/gtk_accel_group.cr +13 -0
- data/crystal-gobject/samples/gtk_application.cr +12 -0
- data/crystal-gobject/samples/gtk_boxes.cr +44 -0
- data/crystal-gobject/samples/gtk_css_styling/css_window.cr +37 -0
- data/crystal-gobject/samples/gtk_css_styling/css_window.css +3 -0
- data/crystal-gobject/samples/gtk_css_styling/css_window.glade +104 -0
- data/crystal-gobject/samples/gtk_editable.cr +14 -0
- data/crystal-gobject/samples/gtk_entry.cr +10 -0
- data/crystal-gobject/samples/gtk_hello_world.cr +13 -0
- data/crystal-gobject/samples/gtk_menu_and_actions.cr +69 -0
- data/crystal-gobject/samples/gtk_message_dialog.cr +9 -0
- data/crystal-gobject/samples/gtk_subclasses.cr +30 -0
- data/crystal-gobject/samples/gtk_tree_view.cr +30 -0
- data/crystal-gobject/samples/gtk_tree_view.glade +44 -0
- data/crystal-gobject/samples/hello +0 -0
- data/crystal-gobject/samples/libgdk-3.a +0 -0
- data/crystal-gobject/samples/libgdk_pixbuf-2.0.a +0 -0
- data/crystal-gobject/samples/libgtk-3.a +0 -0
- data/crystal-gobject/samples/timeout.cr +34 -0
- data/crystal-gobject/script/ci.sh +17 -0
- data/crystal-gobject/script/release.sh +31 -0
- data/crystal-gobject/script/run_with_timeout.cr +14 -0
- data/crystal-gobject/script/test +7 -0
- data/crystal-gobject/shard.yml +16 -0
- data/crystal-gobject/spec/basic_spec.cr +46 -0
- data/crystal-gobject/spec/libsample/Makefile +28 -0
- data/crystal-gobject/spec/libsample/test-subject.c +107 -0
- data/crystal-gobject/spec/libsample/test-subject.h +65 -0
- data/crystal-gobject/spec/spec_helper.cr +5 -0
- data/crystal-gobject/src/atk/atk.cr +2 -0
- data/crystal-gobject/src/closure_data_manager.cr +62 -0
- data/crystal-gobject/src/crout.cr +601 -0
- data/crystal-gobject/src/g_i_repository/dumper.cr +116 -0
- data/crystal-gobject/src/g_i_repository/g_i_repository.cr +46 -0
- data/crystal-gobject/src/g_i_repository/info/arg_info.cr +157 -0
- data/crystal-gobject/src/g_i_repository/info/base_info.cr +169 -0
- data/crystal-gobject/src/g_i_repository/info/callable_info.cr +266 -0
- data/crystal-gobject/src/g_i_repository/info/callback_info.cr +54 -0
- data/crystal-gobject/src/g_i_repository/info/constant_info.cr +115 -0
- data/crystal-gobject/src/g_i_repository/info/enum_info.cr +88 -0
- data/crystal-gobject/src/g_i_repository/info/field_info.cr +97 -0
- data/crystal-gobject/src/g_i_repository/info/function_info.cr +237 -0
- data/crystal-gobject/src/g_i_repository/info/interface_info.cr +97 -0
- data/crystal-gobject/src/g_i_repository/info/object_info.cr +170 -0
- data/crystal-gobject/src/g_i_repository/info/property_info.cr +93 -0
- data/crystal-gobject/src/g_i_repository/info/registered_type_info.cr +62 -0
- data/crystal-gobject/src/g_i_repository/info/signal_info.cr +119 -0
- data/crystal-gobject/src/g_i_repository/info/struct_info.cr +139 -0
- data/crystal-gobject/src/g_i_repository/info/type_info.cr +326 -0
- data/crystal-gobject/src/g_i_repository/info/union_info.cr +136 -0
- data/crystal-gobject/src/g_i_repository/info/v_func_info.cr +33 -0
- data/crystal-gobject/src/g_i_repository/info/value_info.cr +62 -0
- data/crystal-gobject/src/g_i_repository/repository.cr +68 -0
- data/crystal-gobject/src/g_i_repository/wrapper_generator.cr +103 -0
- data/crystal-gobject/src/g_lib/error.cr +34 -0
- data/crystal-gobject/src/g_lib/g_lib.cr +81 -0
- data/crystal-gobject/src/g_lib/list_iterator.cr +81 -0
- data/crystal-gobject/src/g_lib/s_list_iterator.cr +54 -0
- data/crystal-gobject/src/g_object/closure.cr +40 -0
- data/crystal-gobject/src/g_object/g_object.cr +7 -0
- data/crystal-gobject/src/g_object/module_functions.cr +38 -0
- data/crystal-gobject/src/g_object/object.cr +104 -0
- data/crystal-gobject/src/g_object/type.cr +68 -0
- data/crystal-gobject/src/g_object/value.cr +308 -0
- data/crystal-gobject/src/gdk/event.cr +34 -0
- data/crystal-gobject/src/gdk/gdk.cr +35 -0
- data/crystal-gobject/src/generated/g_i_repository/argument.cr +130 -0
- data/crystal-gobject/src/generated/g_i_repository/array_type.cr +34 -0
- data/crystal-gobject/src/generated/g_i_repository/attribute_iter.cr +65 -0
- data/crystal-gobject/src/generated/g_i_repository/base_info.cr +134 -0
- data/crystal-gobject/src/generated/g_i_repository/direction.cr +33 -0
- data/crystal-gobject/src/generated/g_i_repository/field_info_flags.cr +34 -0
- data/crystal-gobject/src/generated/g_i_repository/function_info_flags.cr +38 -0
- data/crystal-gobject/src/generated/g_i_repository/g_i_repository.cr +7 -0
- data/crystal-gobject/src/generated/g_i_repository/info_type.cr +50 -0
- data/crystal-gobject/src/generated/g_i_repository/module_functions.cr +816 -0
- data/crystal-gobject/src/generated/g_i_repository/repository.cr +214 -0
- data/crystal-gobject/src/generated/g_i_repository/repository_class.cr +55 -0
- data/crystal-gobject/src/generated/g_i_repository/repository_error.cr +34 -0
- data/crystal-gobject/src/generated/g_i_repository/repository_load_flags.cr +33 -0
- data/crystal-gobject/src/generated/g_i_repository/repository_private.cr +46 -0
- data/crystal-gobject/src/generated/g_i_repository/scope_type.cr +34 -0
- data/crystal-gobject/src/generated/g_i_repository/transfer.cr +33 -0
- data/crystal-gobject/src/generated/g_i_repository/type_tag.cr +52 -0
- data/crystal-gobject/src/generated/g_i_repository/typelib.cr +61 -0
- data/crystal-gobject/src/generated/g_i_repository/unresolved_info.cr +45 -0
- data/crystal-gobject/src/generated/g_i_repository/v_func_info_flags.cr +36 -0
- data/crystal-gobject/src/generated/g_object/param_flags.cr +44 -0
- data/crystal-gobject/src/generated/g_object/signal_flags.cr +42 -0
- data/crystal-gobject/src/generated/lib_g_i_repository.cr +302 -0
- data/crystal-gobject/src/generated/lib_g_lib.cr +2261 -0
- data/crystal-gobject/src/generated/lib_g_object.cr +874 -0
- data/crystal-gobject/src/generator/build_namespace.cr +22 -0
- data/crystal-gobject/src/generator/doc.cr +259 -0
- data/crystal-gobject/src/generator/dump.cr +55 -0
- data/crystal-gobject/src/generator/generator.cr +22 -0
- data/crystal-gobject/src/generator/namespace.cr +192 -0
- data/crystal-gobject/src/generator/stage2.cr +113 -0
- data/crystal-gobject/src/generator/stage3.cr +3 -0
- data/crystal-gobject/src/gio/gio.cr +4 -0
- data/crystal-gobject/src/gobject.cr +54 -0
- data/crystal-gobject/src/gtk/autorun.cr +16 -0
- data/crystal-gobject/src/gtk/gtk.cr +61 -0
- data/crystal-gobject/src/notify/notification.cr +158 -0
- data/crystal-gobject/src/notify/notify.cr +4 -0
- data/crystal-gobject/src/pointer_iterator.cr +49 -0
- data/crystal-gobject/src/wrapped_type.cr +53 -0
- data/democracy.gemspec +14 -0
- data/dictate +183 -0
- data/emerald-browser/.qmake.stash +23 -0
- data/emerald-browser/Makefile +469 -0
- data/emerald-browser/OUT +90 -0
- data/emerald-browser/a.out +0 -0
- data/emerald-browser/empty +0 -0
- data/emerald-browser/empty.c +1 -0
- data/emerald-browser/open +0 -0
- data/emerald-browser/open.c +57 -0
- data/emerald-browser/qmake.pro +23 -0
- data/emerald-browser/src/OUT +438 -0
- data/emerald-browser/src/a.cpp +303 -0
- data/emerald-browser/src/a.out +0 -0
- data/emerald-browser/src/ss.h +12 -0
- data/emerald-browser/src/t/fullscreennotification.cpp +98 -0
- data/emerald-browser/src/t/fullscreennotification.h +72 -0
- data/emerald-browser/src/t/fullscreenwindow.cpp +99 -0
- data/emerald-browser/src/t/fullscreenwindow.h +76 -0
- data/emerald-browser/src/t/main.cpp +64 -0
- data/emerald-browser/src/t/mainwindow.cpp +83 -0
- data/emerald-browser/src/t/mainwindow.h +75 -0
- data/emerald-browser/test/a.cpp +2 -0
- data/f +0 -0
- data/faster_googler +31 -0
- data/favicon.ico +0 -0
- data/foo +80 -0
- data/foo.c +39 -0
- data/foo.cpp +36 -0
- data/foo.js +25 -0
- data/free_icons/site/bulb +0 -0
- data/free_icons/site/chess +0 -0
- data/free_icons/site/compiz.svg +463 -0
- data/free_icons/site/cursor.svg +1 -0
- data/free_icons/site/dock +0 -0
- data/free_icons/site/gnu +0 -0
- data/free_icons/site/info.svg +200 -0
- data/free_icons/site/iphone.svg +222 -0
- data/free_icons/site/laptop +0 -0
- data/free_icons/site/magic.svg +856 -0
- data/free_icons/site/man +0 -0
- data/free_icons/site/mint +0 -0
- data/free_icons/site/mouse +0 -0
- data/free_icons/site/paint.svg +2640 -0
- data/free_icons/site/present +0 -0
- data/free_icons/site/python +0 -0
- data/free_icons/site/reality +0 -0
- data/free_icons/site/ruby +0 -0
- data/free_icons/site/skeptic +0 -0
- data/free_icons/site/terminal +0 -0
- data/free_icons/site/video.svg +358 -0
- data/free_icons/site/warning +0 -0
- data/free_icons/site/wikipedia.svg +553 -0
- data/free_icons/site/write.svg +287 -0
- data/g +0 -0
- data/graphical_help.c +6 -0
- data/gregory_coreutils/DOC +14 -0
- data/gregory_coreutils/build/Makefile +12 -0
- data/gregory_coreutils/build/code +1 -0
- data/gregory_coreutils/build/functions +465 -0
- data/gregory_coreutils/build/make +93 -0
- data/gregory_coreutils/build/mk +74 -0
- data/gregory_coreutils/build/regex +2 -0
- data/gregory_coreutils/build/ruby_functions +0 -0
- data/gregory_coreutils/utilities/abs +0 -0
- data/gregory_coreutils/utilities/add +0 -0
- data/gregory_coreutils/utilities/args +0 -0
- data/gregory_coreutils/utilities/black +0 -0
- data/gregory_coreutils/utilities/blue +0 -0
- data/gregory_coreutils/utilities/bold +0 -0
- data/gregory_coreutils/utilities/copy +0 -0
- data/gregory_coreutils/utilities/count +0 -0
- data/gregory_coreutils/utilities/cpy +0 -0
- data/gregory_coreutils/utilities/cyan +0 -0
- data/gregory_coreutils/utilities/div +0 -0
- data/gregory_coreutils/utilities/dump +0 -0
- data/gregory_coreutils/utilities/exp +0 -0
- data/gregory_coreutils/utilities/files +0 -0
- data/gregory_coreutils/utilities/floor +0 -0
- data/gregory_coreutils/utilities/green +0 -0
- data/gregory_coreutils/utilities/gsub +0 -0
- data/gregory_coreutils/utilities/gsub_in_place +0 -0
- data/gregory_coreutils/utilities/last_nth +0 -0
- data/gregory_coreutils/utilities/lines +0 -0
- data/gregory_coreutils/utilities/magenta +0 -0
- data/gregory_coreutils/utilities/mul +0 -0
- data/gregory_coreutils/utilities/nth +0 -0
- data/gregory_coreutils/utilities/red +0 -0
- data/gregory_coreutils/utilities/replace_in_place +0 -0
- data/gregory_coreutils/utilities/replace_not_in_place +0 -0
- data/gregory_coreutils/utilities/selectlines +0 -0
- data/gregory_coreutils/utilities/sort_in_place +0 -0
- data/gregory_coreutils/utilities/sub +0 -0
- data/gregory_coreutils/utilities/underline +0 -0
- data/gregory_coreutils/utilities/undump +0 -0
- data/gregory_coreutils/utilities/white +0 -0
- data/gregory_coreutils/utilities/yellow +0 -0
- data/gtk +3 -0
- data/html_file +0 -0
- data/html_file.html +92 -0
- data/i +181 -0
- data/index.html +38 -0
- data/index2.html +344 -0
- data/inspect.rb +209 -0
- data/lib/README +310 -0
- data/lib/__index.html +11 -0
- data/lib/because.rb +41 -0
- data/lib/code.js +28490 -0
- data/lib/compile +5 -0
- data/lib/conjunction.rb +49 -0
- data/lib/evidence.rb +45 -0
- data/lib/graphical_help +90 -0
- data/lib/however.rb +42 -0
- data/lib/index.html +49 -0
- data/lib/index2.html +344 -0
- data/lib/inputreceiver.rb +135 -0
- data/lib/item.rb +77 -0
- data/lib/itemlist.rb +50 -0
- data/lib/negative.rb +43 -0
- data/lib/neutral.rb +43 -0
- data/lib/outputter.rb +60 -0
- data/lib/p.rb +71 -0
- data/lib/positive.rb +41 -0
- data/lib/script.js +423 -0
- data/lib/string__.rb +110 -0
- data/lib/sub/file +5 -0
- data/man/foo.rb +6 -0
- data/man/gtk.html +1 -0
- data/man/out +7288 -0
- data/more/ac.desktop +12 -0
- data/more/res +1 -0
- data/more/web-speech-api/.git/HEAD +1 -0
- data/more/web-speech-api/.git/config +11 -0
- data/more/web-speech-api/.git/description +1 -0
- data/more/web-speech-api/.git/hooks/applypatch-msg.sample +15 -0
- data/more/web-speech-api/.git/hooks/commit-msg.sample +24 -0
- data/more/web-speech-api/.git/hooks/fsmonitor-watchman.sample +109 -0
- data/more/web-speech-api/.git/hooks/post-update.sample +8 -0
- data/more/web-speech-api/.git/hooks/pre-applypatch.sample +14 -0
- data/more/web-speech-api/.git/hooks/pre-commit.sample +49 -0
- data/more/web-speech-api/.git/hooks/pre-merge-commit.sample +13 -0
- data/more/web-speech-api/.git/hooks/pre-push.sample +53 -0
- data/more/web-speech-api/.git/hooks/pre-rebase.sample +169 -0
- data/more/web-speech-api/.git/hooks/pre-receive.sample +24 -0
- data/more/web-speech-api/.git/hooks/prepare-commit-msg.sample +42 -0
- data/more/web-speech-api/.git/hooks/update.sample +128 -0
- data/more/web-speech-api/.git/index +0 -0
- data/more/web-speech-api/.git/info/exclude +6 -0
- data/more/web-speech-api/.git/logs/HEAD +1 -0
- data/more/web-speech-api/.git/logs/refs/heads/master +1 -0
- data/more/web-speech-api/.git/logs/refs/remotes/origin/HEAD +1 -0
- data/more/web-speech-api/.git/objects/pack/pack-4d2adae000c513b287d53e24937e9e836954f901.idx +0 -0
- data/more/web-speech-api/.git/objects/pack/pack-4d2adae000c513b287d53e24937e9e836954f901.pack +0 -0
- data/more/web-speech-api/.git/packed-refs +2 -0
- data/more/web-speech-api/.git/refs/heads/master +1 -0
- data/more/web-speech-api/.git/refs/remotes/origin/HEAD +1 -0
- data/more/web-speech-api/CODE_OF_CONDUCT.md +15 -0
- data/more/web-speech-api/LICENSE +116 -0
- data/more/web-speech-api/README.md +23 -0
- data/more/web-speech-api/index.html +25 -0
- data/more/web-speech-api/phrase-matcher/index.html +30 -0
- data/more/web-speech-api/phrase-matcher/script.js +124 -0
- data/more/web-speech-api/phrase-matcher/style.css +54 -0
- data/more/web-speech-api/speak-easy-synthesis/img/ws128.png +0 -0
- data/more/web-speech-api/speak-easy-synthesis/img/ws512.png +0 -0
- data/more/web-speech-api/speak-easy-synthesis/index.html +43 -0
- data/more/web-speech-api/speak-easy-synthesis/manifest.webapp +14 -0
- data/more/web-speech-api/speak-easy-synthesis/script.js +87 -0
- data/more/web-speech-api/speak-easy-synthesis/style.css +74 -0
- data/more/web-speech-api/speech-color-changer/img/ws128.png +0 -0
- data/more/web-speech-api/speech-color-changer/img/ws512.png +0 -0
- data/more/web-speech-api/speech-color-changer/index.html +26 -0
- data/more/web-speech-api/speech-color-changer/manifest.webapp +23 -0
- data/more/web-speech-api/speech-color-changer/script.js +58 -0
- data/more/web-speech-api/speech-color-changer/style.css +38 -0
- data/opensrc +68 -0
- data/out +39 -0
- data/playsrc +14 -0
- data/program.c +11 -0
- data/program.prog +568 -0
- data/proj/a +0 -0
- data/proj/a.c +1 -0
- data/proj/a.o +0 -0
- data/proj/a.rs +18 -0
- data/proj/b.rs +22 -0
- data/proj/linker.sh +8 -0
- data/proj/save_last +4 -0
- data/push +16 -0
- data/q.cpp +175 -0
- data/qt/.qmake.stash +23 -0
- data/qt/Qt5Core.dll +0 -0
- data/qt/Qt5Gui.dll +0 -0
- data/qt/Qt5Multimedia.dll +0 -0
- data/qt/Qt5MultimediaWidgets.dll +0 -0
- data/qt/Qt5Network.dll +0 -0
- data/qt/Qt5PrintSupport.dll +0 -0
- data/qt/Qt5Qml.dll +0 -0
- data/qt/Qt5QmlModels.dll +0 -0
- data/qt/Qt5Quick.dll +0 -0
- data/qt/Qt5Sensors.dll +0 -0
- data/qt/Qt5WebChannel.dll +0 -0
- data/qt/Qt5WebKit.dll +0 -0
- data/qt/Qt5WebKitWidgets.dll +0 -0
- data/qt/Qt5Widgets.dll +0 -0
- data/qt/a.cpp +39 -0
- data/qt/a.out +0 -0
- data/qt/a.sh +7 -0
- data/qt/icudt66.dll +0 -0
- data/qt/icuin66.dll +0 -0
- data/qt/icuuc66.dll +0 -0
- data/qt/libbz2.dll +0 -0
- data/qt/libcrypto-1_1-x64.dll +0 -0
- data/qt/libfreetype-6.dll +0 -0
- data/qt/libgcc_s_seh-1.dll +0 -0
- data/qt/libglib-2.0-0.dll +0 -0
- data/qt/libharfbuzz-0.dll +0 -0
- data/qt/libiconv-2.dll +0 -0
- data/qt/libintl-8.dll +0 -0
- data/qt/libjpeg-9.dll +0 -0
- data/qt/liblzma-5.dll +0 -0
- data/qt/libpcre-1.dll +0 -0
- data/qt/libpcre2-16-0.dll +0 -0
- data/qt/libpng16-16.dll +0 -0
- data/qt/libsqlite3-0.dll +0 -0
- data/qt/libssl-1_1-x64.dll +0 -0
- data/qt/libstdc++-6.dll +0 -0
- data/qt/libwebp-7.dll +0 -0
- data/qt/libwinpthread-1.dll +0 -0
- data/qt/libxml2-2.dll +0 -0
- data/qt/libxslt-1.dll +0 -0
- data/qt/libzstd.dll +0 -0
- data/qt/prog +1 -0
- data/qt/qwindows.dll +0 -0
- data/qt/zlib1.dll +0 -0
- data/quickjs/.git/HEAD +1 -0
- data/quickjs/.git/config +11 -0
- data/quickjs/.git/description +1 -0
- data/quickjs/.git/hooks/applypatch-msg.sample +15 -0
- data/quickjs/.git/hooks/commit-msg.sample +24 -0
- data/quickjs/.git/hooks/fsmonitor-watchman.sample +109 -0
- data/quickjs/.git/hooks/post-update.sample +8 -0
- data/quickjs/.git/hooks/pre-applypatch.sample +14 -0
- data/quickjs/.git/hooks/pre-commit.sample +49 -0
- data/quickjs/.git/hooks/pre-merge-commit.sample +13 -0
- data/quickjs/.git/hooks/pre-push.sample +53 -0
- data/quickjs/.git/hooks/pre-rebase.sample +169 -0
- data/quickjs/.git/hooks/pre-receive.sample +24 -0
- data/quickjs/.git/hooks/prepare-commit-msg.sample +42 -0
- data/quickjs/.git/hooks/update.sample +128 -0
- data/quickjs/.git/index +0 -0
- data/quickjs/.git/info/exclude +6 -0
- data/quickjs/.git/logs/HEAD +1 -0
- data/quickjs/.git/logs/refs/heads/master +1 -0
- data/quickjs/.git/logs/refs/remotes/origin/HEAD +1 -0
- data/quickjs/.git/objects/pack/pack-744a13dba8773a756b22372ba65ded3aca50cdeb.idx +0 -0
- data/quickjs/.git/objects/pack/pack-744a13dba8773a756b22372ba65ded3aca50cdeb.pack +0 -0
- data/quickjs/.git/packed-refs +2 -0
- data/quickjs/.git/refs/heads/master +1 -0
- data/quickjs/.git/refs/remotes/origin/HEAD +1 -0
- data/quickjs/.obj/.d +1 -0
- data/quickjs/.obj/cutils.nolto.o +0 -0
- data/quickjs/.obj/cutils.o +0 -0
- data/quickjs/.obj/cutils.o.d +1 -0
- data/quickjs/.obj/hello.o +0 -0
- data/quickjs/.obj/hello.o.d +1 -0
- data/quickjs/.obj/libbf.nolto.o +0 -0
- data/quickjs/.obj/libbf.o +0 -0
- data/quickjs/.obj/libbf.o.d +1 -0
- data/quickjs/.obj/libregexp.nolto.o +0 -0
- data/quickjs/.obj/libregexp.o +0 -0
- data/quickjs/.obj/libregexp.o.d +2 -0
- data/quickjs/.obj/libunicode.nolto.o +0 -0
- data/quickjs/.obj/libunicode.o +0 -0
- data/quickjs/.obj/libunicode.o.d +1 -0
- data/quickjs/.obj/qjs.check.o +0 -0
- data/quickjs/.obj/qjs.check.o.d +1 -0
- data/quickjs/.obj/qjs.o +0 -0
- data/quickjs/.obj/qjs.o.d +1 -0
- data/quickjs/.obj/qjsc.o +0 -0
- data/quickjs/.obj/qjsc.o.d +1 -0
- data/quickjs/.obj/qjscalc.o +0 -0
- data/quickjs/.obj/qjscalc.o.d +1 -0
- data/quickjs/.obj/quickjs-libc.nolto.o +0 -0
- data/quickjs/.obj/quickjs-libc.o +0 -0
- data/quickjs/.obj/quickjs-libc.o.d +2 -0
- data/quickjs/.obj/quickjs.check.o +0 -0
- data/quickjs/.obj/quickjs.check.o.d +2 -0
- data/quickjs/.obj/quickjs.nolto.o +0 -0
- data/quickjs/.obj/quickjs.o +0 -0
- data/quickjs/.obj/quickjs.o.d +2 -0
- data/quickjs/.obj/repl.o +0 -0
- data/quickjs/.obj/repl.o.d +1 -0
- data/quickjs/.obj/run-test262.o +0 -0
- data/quickjs/.obj/run-test262.o.d +2 -0
- data/quickjs/COMPILE_WIN +1 -0
- data/quickjs/Changelog +148 -0
- data/quickjs/LICENSE +22 -0
- data/quickjs/Makefile +470 -0
- data/quickjs/TODO +70 -0
- data/quickjs/VERSION +1 -0
- data/quickjs/a.c +50038 -0
- data/quickjs/a.js +26075 -0
- data/quickjs/a.rb +3 -0
- data/quickjs/cutils.c +631 -0
- data/quickjs/cutils.h +297 -0
- data/quickjs/doc/jsbignum.texi +589 -0
- data/quickjs/doc/quickjs.texi +1097 -0
- data/quickjs/examples/fib.c +72 -0
- data/quickjs/examples/fib_module.js +10 -0
- data/quickjs/examples/hello +0 -0
- data/quickjs/examples/hello.js +1 -0
- data/quickjs/examples/hello_module.js +6 -0
- data/quickjs/examples/pi_bigdecimal.js +68 -0
- data/quickjs/examples/pi_bigfloat.js +66 -0
- data/quickjs/examples/pi_bigint.js +118 -0
- data/quickjs/examples/point.c +151 -0
- data/quickjs/examples/test_fib.js +6 -0
- data/quickjs/examples/test_point.js +40 -0
- data/quickjs/hello.c +44 -0
- data/quickjs/libbf.c +8466 -0
- data/quickjs/libbf.h +535 -0
- data/quickjs/libquickjs.a +0 -0
- data/quickjs/libquickjs.lto.a +0 -0
- data/quickjs/libregexp-opcode.h +58 -0
- data/quickjs/libregexp.c +2610 -0
- data/quickjs/libregexp.h +92 -0
- data/quickjs/libunicode-table.h +4368 -0
- data/quickjs/libunicode.c +1556 -0
- data/quickjs/libunicode.h +124 -0
- data/quickjs/libwinpthread-1.dll +0 -0
- data/quickjs/list.h +100 -0
- data/quickjs/out.c +24 -0
- data/quickjs/out55.c +59 -0
- data/quickjs/out56.c +79 -0
- data/quickjs/out57.c +24 -0
- data/quickjs/out58.c +4 -0
- data/quickjs/p.exe +0 -0
- data/quickjs/qjs +0 -0
- data/quickjs/qjs.c +570 -0
- data/quickjs/qjsc +0 -0
- data/quickjs/qjsc.c +762 -0
- data/quickjs/qjsc.exe +0 -0
- data/quickjs/qjscalc.c +4005 -0
- data/quickjs/qjscalc.js +2657 -0
- data/quickjs/quickjs-atom.h +273 -0
- data/quickjs/quickjs-libc.c +3927 -0
- data/quickjs/quickjs-libc.h +59 -0
- data/quickjs/quickjs-opcode.h +365 -0
- data/quickjs/quickjs.c +54036 -0
- data/quickjs/quickjs.h +1049 -0
- data/quickjs/readme.txt +1 -0
- data/quickjs/release.sh +158 -0
- data/quickjs/repl.c +2020 -0
- data/quickjs/repl.js +1566 -0
- data/quickjs/run-test262 +0 -0
- data/quickjs/run-test262.c +2107 -0
- data/quickjs/test262.conf +199 -0
- data/quickjs/test262_errors.txt +35 -0
- data/quickjs/test262o.conf +410 -0
- data/quickjs/test262o_errors.txt +0 -0
- data/quickjs/tests/bjson.c +96 -0
- data/quickjs/tests/microbench.js +1065 -0
- data/quickjs/tests/test262.patch +71 -0
- data/quickjs/tests/test_bignum.js +326 -0
- data/quickjs/tests/test_bjson.js +191 -0
- data/quickjs/tests/test_builtin.js +685 -0
- data/quickjs/tests/test_closure.js +221 -0
- data/quickjs/tests/test_language.js +547 -0
- data/quickjs/tests/test_loop.js +368 -0
- data/quickjs/tests/test_op_overloading.js +207 -0
- data/quickjs/tests/test_qjscalc.js +256 -0
- data/quickjs/tests/test_std.js +281 -0
- data/quickjs/tests/test_worker.js +62 -0
- data/quickjs/tests/test_worker_module.js +31 -0
- data/quickjs/unicode_download.sh +19 -0
- data/quickjs/unicode_gen.c +3057 -0
- data/quickjs/unicode_gen_def.h +284 -0
- data/readline +3 -0
- data/rm_com +1 -0
- data/run.sh +13 -0
- data/scaling +6 -0
- data/script.js +572 -0
- data/server_creator/__ +307 -0
- data/server_creator/a/a (1).tar.gz +0 -0
- data/server_creator/a/a.out +0 -0
- data/server_creator/a/hello_world +0 -0
- data/server_creator/a/help +57 -0
- data/server_creator/a/main_v1.cpp +83 -0
- data/server_creator/a/my_libs_gregory/.deps +0 -0
- data/server_creator/a/my_libs_gregory/.libs/mod_my_libs_gregory.lai +41 -0
- data/server_creator/a/my_libs_gregory/.libs/mod_my_libs_gregory.o +0 -0
- data/server_creator/a/my_libs_gregory/.libs/mod_my_libs_gregory.so +0 -0
- data/server_creator/a/my_libs_gregory/mod_my_libs_gregory.c +72 -0
- data/server_creator/a/my_libs_gregory/mod_my_libs_gregory.la +41 -0
- data/server_creator/a/my_libs_gregory/mod_my_libs_gregory.lo +12 -0
- data/server_creator/a/my_libs_gregory/mod_my_libs_gregory.slo +0 -0
- data/server_creator/a/nginx.conf +32 -0
- data/server_creator/a/six +1 -0
- data/server_creator/a.out +0 -0
- data/server_creator/all_code.cpp +448 -0
- data/server_creator/all_code.js +27 -0
- data/server_creator/code +510 -0
- data/server_creator/make_application +64 -0
- data/server_creator/prog.cpp +33 -0
- data/server_creator/prog.js +22 -0
- data/server_creator/program.js +745 -0
- data/server_creator/rm_com +1 -0
- data/server_creator/test.sh +82 -0
- data/speakcat.rb +9 -0
- data/string +48 -0
- data/super_trans +83 -0
- data/test.sh +21 -0
- data/todo +8 -0
- data/version_decrement +3 -0
- data/viu_license +21 -0
- data/windows/program.c +21 -0
- data/windows/program.exe +0 -0
- metadata +759 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
"use math";
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
function assert(actual, expected, message) {
|
|
5
|
+
if (arguments.length == 1)
|
|
6
|
+
expected = true;
|
|
7
|
+
|
|
8
|
+
if (actual === expected)
|
|
9
|
+
return;
|
|
10
|
+
|
|
11
|
+
if (actual !== null && expected !== null
|
|
12
|
+
&& typeof actual == 'object' && typeof expected == 'object'
|
|
13
|
+
&& actual.toString() === expected.toString())
|
|
14
|
+
return;
|
|
15
|
+
|
|
16
|
+
throw Error("assertion failed: got |" + actual + "|" +
|
|
17
|
+
", expected |" + expected + "|" +
|
|
18
|
+
(message ? " (" + message + ")" : ""));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function assertThrows(err, func)
|
|
22
|
+
{
|
|
23
|
+
var ex;
|
|
24
|
+
ex = false;
|
|
25
|
+
try {
|
|
26
|
+
func();
|
|
27
|
+
} catch(e) {
|
|
28
|
+
ex = true;
|
|
29
|
+
assert(e instanceof err);
|
|
30
|
+
}
|
|
31
|
+
assert(ex, true, "exception expected");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// load more elaborate version of assert if available
|
|
35
|
+
try { __loadScript("test_assert.js"); } catch(e) {}
|
|
36
|
+
|
|
37
|
+
/*----------------*/
|
|
38
|
+
|
|
39
|
+
function pow(a, n)
|
|
40
|
+
{
|
|
41
|
+
var r, i;
|
|
42
|
+
r = 1;
|
|
43
|
+
for(i = 0; i < n; i++)
|
|
44
|
+
r *= a;
|
|
45
|
+
return r;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function test_integer()
|
|
49
|
+
{
|
|
50
|
+
var a, r;
|
|
51
|
+
a = pow(3, 100);
|
|
52
|
+
assert((a - 1) != a);
|
|
53
|
+
assert(a == 515377520732011331036461129765621272702107522001);
|
|
54
|
+
assert(a == 0x5a4653ca673768565b41f775d6947d55cf3813d1);
|
|
55
|
+
assert(Integer.isInteger(1) === true);
|
|
56
|
+
assert(Integer.isInteger(1.0) === false);
|
|
57
|
+
|
|
58
|
+
assert(Integer.floorLog2(0) === -1);
|
|
59
|
+
assert(Integer.floorLog2(7) === 2);
|
|
60
|
+
|
|
61
|
+
r = 1 << 31;
|
|
62
|
+
assert(r, 2147483648, "1 << 31 === 2147483648");
|
|
63
|
+
|
|
64
|
+
r = 1 << 32;
|
|
65
|
+
assert(r, 4294967296, "1 << 32 === 4294967296");
|
|
66
|
+
|
|
67
|
+
r = (1 << 31) < 0;
|
|
68
|
+
assert(r, false, "(1 << 31) < 0 === false");
|
|
69
|
+
|
|
70
|
+
assert(typeof 1 === "number");
|
|
71
|
+
assert(typeof 9007199254740991 === "number");
|
|
72
|
+
assert(typeof 9007199254740992 === "bigint");
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function test_float()
|
|
76
|
+
{
|
|
77
|
+
assert(typeof 1.0 === "bigfloat");
|
|
78
|
+
assert(1 == 1.0);
|
|
79
|
+
assert(1 !== 1.0);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* jscalc tests */
|
|
83
|
+
|
|
84
|
+
function test_modulo()
|
|
85
|
+
{
|
|
86
|
+
var i, p, a, b;
|
|
87
|
+
|
|
88
|
+
/* Euclidian modulo operator */
|
|
89
|
+
assert((-3) % 2 == 1);
|
|
90
|
+
assert(3 % (-2) == 1);
|
|
91
|
+
|
|
92
|
+
p = 101;
|
|
93
|
+
for(i = 1; i < p; i++) {
|
|
94
|
+
a = Integer.invmod(i, p);
|
|
95
|
+
assert(a >= 0 && a < p);
|
|
96
|
+
assert((i * a) % p == 1);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
assert(Integer.isPrime(2^107-1));
|
|
100
|
+
assert(!Integer.isPrime((2^107-1) * (2^89-1)));
|
|
101
|
+
a = Integer.factor((2^89-1)*2^3*11*13^2*1009);
|
|
102
|
+
assert(a == [ 2,2,2,11,13,13,1009,618970019642690137449562111 ]);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function test_fraction()
|
|
106
|
+
{
|
|
107
|
+
assert((1/3 + 1).toString(), "4/3")
|
|
108
|
+
assert((2/3)^30, 1073741824/205891132094649);
|
|
109
|
+
assert(1/3 < 2/3);
|
|
110
|
+
assert(1/3 < 1);
|
|
111
|
+
assert(1/3 == 1.0/3);
|
|
112
|
+
assert(1.0/3 < 2/3);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function test_mod()
|
|
116
|
+
{
|
|
117
|
+
var a, b, p;
|
|
118
|
+
|
|
119
|
+
a = Mod(3, 101);
|
|
120
|
+
b = Mod(-1, 101);
|
|
121
|
+
assert((a + b) == Mod(2, 101));
|
|
122
|
+
assert(a ^ 100 == Mod(1, 101));
|
|
123
|
+
|
|
124
|
+
p = 2 ^ 607 - 1; /* mersenne prime */
|
|
125
|
+
a = Mod(3, p) ^ (p - 1);
|
|
126
|
+
assert(a == Mod(1, p));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function test_polynomial()
|
|
130
|
+
{
|
|
131
|
+
var a, b, q, r, t, i;
|
|
132
|
+
a = (1 + X) ^ 4;
|
|
133
|
+
assert(a == X^4+4*X^3+6*X^2+4*X+1);
|
|
134
|
+
|
|
135
|
+
r = (1 + X);
|
|
136
|
+
q = (1+X+X^2);
|
|
137
|
+
b = (1 - X^2);
|
|
138
|
+
a = q * b + r;
|
|
139
|
+
t = Polynomial.divrem(a, b);
|
|
140
|
+
assert(t[0] == q);
|
|
141
|
+
assert(t[1] == r);
|
|
142
|
+
|
|
143
|
+
a = 1 + 2*X + 3*X^2;
|
|
144
|
+
assert(a.apply(0.1) == 1.23);
|
|
145
|
+
|
|
146
|
+
a = 1-2*X^2+2*X^3;
|
|
147
|
+
assert(deriv(a) == (6*X^2-4*X));
|
|
148
|
+
assert(deriv(integ(a)) == a);
|
|
149
|
+
|
|
150
|
+
a = (X-1)*(X-2)*(X-3)*(X-4)*(X-0.1);
|
|
151
|
+
r = polroots(a);
|
|
152
|
+
for(i = 0; i < r.length; i++) {
|
|
153
|
+
b = abs(a.apply(r[i]));
|
|
154
|
+
assert(b <= 1e-13);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function test_poly_mod()
|
|
159
|
+
{
|
|
160
|
+
var a, p;
|
|
161
|
+
|
|
162
|
+
/* modulo using polynomials */
|
|
163
|
+
p = X^2 + X + 1;
|
|
164
|
+
a = PolyMod(3+X, p) ^ 10;
|
|
165
|
+
assert(a == PolyMod(-3725*X-18357, p));
|
|
166
|
+
|
|
167
|
+
a = PolyMod(1/X, 1+X^2);
|
|
168
|
+
assert(a == PolyMod(-X, X^2+1));
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function test_rfunc()
|
|
172
|
+
{
|
|
173
|
+
var a;
|
|
174
|
+
a = (X+1)/((X+1)*(X-1));
|
|
175
|
+
assert(a == 1/(X-1));
|
|
176
|
+
a = (X + 2) / (X - 2);
|
|
177
|
+
assert(a.apply(1/3) == -7/5);
|
|
178
|
+
|
|
179
|
+
assert(deriv((X^2-X+1)/(X-1)) == (X^2-2*X)/(X^2-2*X+1));
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function test_series()
|
|
183
|
+
{
|
|
184
|
+
var a, b;
|
|
185
|
+
a = 1+X+O(X^5);
|
|
186
|
+
b = a.inverse();
|
|
187
|
+
assert(b == 1-X+X^2-X^3+X^4+O(X^5));
|
|
188
|
+
assert(deriv(b) == -1+2*X-3*X^2+4*X^3+O(X^4));
|
|
189
|
+
assert(deriv(integ(b)) == b);
|
|
190
|
+
|
|
191
|
+
a = Series(1/(1-X), 5);
|
|
192
|
+
assert(a == 1+X+X^2+X^3+X^4+O(X^5));
|
|
193
|
+
b = a.apply(0.1);
|
|
194
|
+
assert(b == 1.1111);
|
|
195
|
+
|
|
196
|
+
assert(exp(3*X^2+O(X^10)) == 1+3*X^2+9/2*X^4+9/2*X^6+27/8*X^8+O(X^10));
|
|
197
|
+
assert(sin(X+O(X^6)) == X-1/6*X^3+1/120*X^5+O(X^6));
|
|
198
|
+
assert(cos(X+O(X^6)) == 1-1/2*X^2+1/24*X^4+O(X^6));
|
|
199
|
+
assert(tan(X+O(X^8)) == X+1/3*X^3+2/15*X^5+17/315*X^7+O(X^8));
|
|
200
|
+
assert((1+X+O(X^6))^(2+X) == 1+2*X+2*X^2+3/2*X^3+5/6*X^4+5/12*X^5+O(X^6));
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function test_matrix()
|
|
204
|
+
{
|
|
205
|
+
var a, b, r;
|
|
206
|
+
a = [[1, 2],[3, 4]];
|
|
207
|
+
b = [3, 4];
|
|
208
|
+
r = a * b;
|
|
209
|
+
assert(r == [11, 25]);
|
|
210
|
+
r = (a^-1) * 2;
|
|
211
|
+
assert(r == [[-4, 2],[3, -1]]);
|
|
212
|
+
|
|
213
|
+
assert(norm2([1,2,3]) == 14);
|
|
214
|
+
|
|
215
|
+
assert(diag([1,2,3]) == [ [ 1, 0, 0 ], [ 0, 2, 0 ], [ 0, 0, 3 ] ]);
|
|
216
|
+
assert(trans(a) == [ [ 1, 3 ], [ 2, 4 ] ]);
|
|
217
|
+
assert(trans([1,2,3]) == [[1,2,3]]);
|
|
218
|
+
assert(trace(a) == 5);
|
|
219
|
+
|
|
220
|
+
assert(charpoly(Matrix.hilbert(4)) == X^4-176/105*X^3+3341/12600*X^2-41/23625*X+1/6048000);
|
|
221
|
+
assert(det(Matrix.hilbert(4)) == 1/6048000);
|
|
222
|
+
|
|
223
|
+
a = [[1,2,1],[-2,-3,1],[3,5,0]];
|
|
224
|
+
assert(rank(a) == 2);
|
|
225
|
+
assert(ker(a) == [ [ 5 ], [ -3 ], [ 1 ] ]);
|
|
226
|
+
|
|
227
|
+
assert(dp([1, 2, 3], [3, -4, -7]) === -26);
|
|
228
|
+
assert(cp([1, 2, 3], [3, -4, -7]) == [ -2, 16, -10 ]);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function assert_eq(a, ref)
|
|
232
|
+
{
|
|
233
|
+
assert(abs(a / ref - 1.0) <= 1e-15);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function test_trig()
|
|
237
|
+
{
|
|
238
|
+
assert_eq(sin(1/2), 0.479425538604203);
|
|
239
|
+
assert_eq(sin(2+3*I), 9.154499146911428-4.168906959966565*I);
|
|
240
|
+
assert_eq(cos(2+3*I), -4.189625690968807-9.109227893755337*I);
|
|
241
|
+
assert_eq((2+0.5*I)^(1.1-0.5*I), 2.494363021357619-0.23076804554558092*I);
|
|
242
|
+
assert_eq(sqrt(2*I), 1 + I);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
test_integer();
|
|
246
|
+
test_float();
|
|
247
|
+
|
|
248
|
+
test_modulo();
|
|
249
|
+
test_fraction();
|
|
250
|
+
test_mod();
|
|
251
|
+
test_polynomial();
|
|
252
|
+
test_poly_mod();
|
|
253
|
+
test_rfunc();
|
|
254
|
+
test_series();
|
|
255
|
+
test_matrix();
|
|
256
|
+
test_trig();
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import * as std from "std";
|
|
2
|
+
import * as os from "os";
|
|
3
|
+
|
|
4
|
+
function assert(actual, expected, message) {
|
|
5
|
+
if (arguments.length == 1)
|
|
6
|
+
expected = true;
|
|
7
|
+
|
|
8
|
+
if (actual === expected)
|
|
9
|
+
return;
|
|
10
|
+
|
|
11
|
+
if (actual !== null && expected !== null
|
|
12
|
+
&& typeof actual == 'object' && typeof expected == 'object'
|
|
13
|
+
&& actual.toString() === expected.toString())
|
|
14
|
+
return;
|
|
15
|
+
|
|
16
|
+
throw Error("assertion failed: got |" + actual + "|" +
|
|
17
|
+
", expected |" + expected + "|" +
|
|
18
|
+
(message ? " (" + message + ")" : ""));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// load more elaborate version of assert if available
|
|
22
|
+
try { std.loadScript("test_assert.js"); } catch(e) {}
|
|
23
|
+
|
|
24
|
+
/*----------------*/
|
|
25
|
+
|
|
26
|
+
function test_printf()
|
|
27
|
+
{
|
|
28
|
+
assert(std.sprintf("a=%d s=%s", 123, "abc"), "a=123 s=abc");
|
|
29
|
+
assert(std.sprintf("%010d", 123), "0000000123");
|
|
30
|
+
assert(std.sprintf("%x", -2), "fffffffe");
|
|
31
|
+
assert(std.sprintf("%lx", -2), "fffffffffffffffe");
|
|
32
|
+
assert(std.sprintf("%10.1f", 2.1), " 2.1");
|
|
33
|
+
assert(std.sprintf("%*.*f", 10, 2, -2.13), " -2.13");
|
|
34
|
+
assert(std.sprintf("%#lx", 0x7fffffffffffffffn), "0x7fffffffffffffff");
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function test_file1()
|
|
38
|
+
{
|
|
39
|
+
var f, len, str, size, buf, ret, i, str1;
|
|
40
|
+
|
|
41
|
+
f = std.tmpfile();
|
|
42
|
+
str = "hello world\n";
|
|
43
|
+
f.puts(str);
|
|
44
|
+
|
|
45
|
+
f.seek(0, std.SEEK_SET);
|
|
46
|
+
str1 = f.readAsString();
|
|
47
|
+
assert(str1 === str);
|
|
48
|
+
|
|
49
|
+
f.seek(0, std.SEEK_END);
|
|
50
|
+
size = f.tell();
|
|
51
|
+
assert(size === str.length);
|
|
52
|
+
|
|
53
|
+
f.seek(0, std.SEEK_SET);
|
|
54
|
+
|
|
55
|
+
buf = new Uint8Array(size);
|
|
56
|
+
ret = f.read(buf.buffer, 0, size);
|
|
57
|
+
assert(ret === size);
|
|
58
|
+
for(i = 0; i < size; i++)
|
|
59
|
+
assert(buf[i] === str.charCodeAt(i));
|
|
60
|
+
|
|
61
|
+
f.close();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function test_file2()
|
|
65
|
+
{
|
|
66
|
+
var f, str, i, size;
|
|
67
|
+
f = std.tmpfile();
|
|
68
|
+
str = "hello world\n";
|
|
69
|
+
size = str.length;
|
|
70
|
+
for(i = 0; i < size; i++)
|
|
71
|
+
f.putByte(str.charCodeAt(i));
|
|
72
|
+
f.seek(0, std.SEEK_SET);
|
|
73
|
+
for(i = 0; i < size; i++) {
|
|
74
|
+
assert(str.charCodeAt(i) === f.getByte());
|
|
75
|
+
}
|
|
76
|
+
assert(f.getByte() === -1);
|
|
77
|
+
f.close();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function test_getline()
|
|
81
|
+
{
|
|
82
|
+
var f, line, line_count, lines, i;
|
|
83
|
+
|
|
84
|
+
lines = ["hello world", "line 1", "line 2" ];
|
|
85
|
+
f = std.tmpfile();
|
|
86
|
+
for(i = 0; i < lines.length; i++) {
|
|
87
|
+
f.puts(lines[i], "\n");
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
f.seek(0, std.SEEK_SET);
|
|
91
|
+
assert(!f.eof());
|
|
92
|
+
line_count = 0;
|
|
93
|
+
for(;;) {
|
|
94
|
+
line = f.getline();
|
|
95
|
+
if (line === null)
|
|
96
|
+
break;
|
|
97
|
+
assert(line == lines[line_count]);
|
|
98
|
+
line_count++;
|
|
99
|
+
}
|
|
100
|
+
assert(f.eof());
|
|
101
|
+
assert(line_count === lines.length);
|
|
102
|
+
|
|
103
|
+
f.close();
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function test_popen()
|
|
107
|
+
{
|
|
108
|
+
var str, f, fname = "tmp_file.txt";
|
|
109
|
+
var content = "hello world";
|
|
110
|
+
|
|
111
|
+
f = std.open(fname, "w");
|
|
112
|
+
f.puts(content);
|
|
113
|
+
f.close();
|
|
114
|
+
|
|
115
|
+
/* test loadFile */
|
|
116
|
+
assert(std.loadFile(fname), content);
|
|
117
|
+
|
|
118
|
+
/* execute the 'cat' shell command */
|
|
119
|
+
f = std.popen("cat " + fname, "r");
|
|
120
|
+
str = f.readAsString();
|
|
121
|
+
f.close();
|
|
122
|
+
|
|
123
|
+
assert(str, content);
|
|
124
|
+
|
|
125
|
+
os.remove(fname);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function test_ext_json()
|
|
129
|
+
{
|
|
130
|
+
var expected, input, obj;
|
|
131
|
+
expected = '{"x":false,"y":true,"z2":null,"a":[1,8,160],"s":"str"}';
|
|
132
|
+
input = `{ "x":false, /*comments are allowed */
|
|
133
|
+
"y":true, // also a comment
|
|
134
|
+
z2:null, // unquoted property names
|
|
135
|
+
"a":[+1,0o10,0xa0,], // plus prefix, octal, hexadecimal
|
|
136
|
+
"s":"str",} // trailing comma in objects and arrays
|
|
137
|
+
`;
|
|
138
|
+
obj = std.parseExtJSON(input);
|
|
139
|
+
assert(JSON.stringify(obj), expected);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function test_os()
|
|
143
|
+
{
|
|
144
|
+
var fd, fpath, fname, fdir, buf, buf2, i, files, err, fdate, st, link_path;
|
|
145
|
+
|
|
146
|
+
assert(os.isatty(0));
|
|
147
|
+
|
|
148
|
+
fdir = "test_tmp_dir";
|
|
149
|
+
fname = "tmp_file.txt";
|
|
150
|
+
fpath = fdir + "/" + fname;
|
|
151
|
+
link_path = fdir + "/test_link";
|
|
152
|
+
|
|
153
|
+
os.remove(link_path);
|
|
154
|
+
os.remove(fpath);
|
|
155
|
+
os.remove(fdir);
|
|
156
|
+
|
|
157
|
+
err = os.mkdir(fdir, 0o755);
|
|
158
|
+
assert(err === 0);
|
|
159
|
+
|
|
160
|
+
fd = os.open(fpath, os.O_RDWR | os.O_CREAT | os.O_TRUNC);
|
|
161
|
+
assert(fd >= 0);
|
|
162
|
+
|
|
163
|
+
buf = new Uint8Array(10);
|
|
164
|
+
for(i = 0; i < buf.length; i++)
|
|
165
|
+
buf[i] = i;
|
|
166
|
+
assert(os.write(fd, buf.buffer, 0, buf.length) === buf.length);
|
|
167
|
+
|
|
168
|
+
assert(os.seek(fd, 0, std.SEEK_SET) === 0);
|
|
169
|
+
buf2 = new Uint8Array(buf.length);
|
|
170
|
+
assert(os.read(fd, buf2.buffer, 0, buf2.length) === buf2.length);
|
|
171
|
+
|
|
172
|
+
for(i = 0; i < buf.length; i++)
|
|
173
|
+
assert(buf[i] == buf2[i]);
|
|
174
|
+
|
|
175
|
+
if (typeof BigInt !== "undefined") {
|
|
176
|
+
assert(os.seek(fd, BigInt(6), std.SEEK_SET), BigInt(6));
|
|
177
|
+
assert(os.read(fd, buf2.buffer, 0, 1) === 1);
|
|
178
|
+
assert(buf[6] == buf2[0]);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
assert(os.close(fd) === 0);
|
|
182
|
+
|
|
183
|
+
[files, err] = os.readdir(fdir);
|
|
184
|
+
assert(err, 0);
|
|
185
|
+
assert(files.indexOf(fname) >= 0);
|
|
186
|
+
|
|
187
|
+
fdate = 10000;
|
|
188
|
+
|
|
189
|
+
err = os.utimes(fpath, fdate, fdate);
|
|
190
|
+
assert(err, 0);
|
|
191
|
+
|
|
192
|
+
[st, err] = os.stat(fpath);
|
|
193
|
+
assert(err, 0);
|
|
194
|
+
assert(st.mode & os.S_IFMT, os.S_IFREG);
|
|
195
|
+
assert(st.mtime, fdate);
|
|
196
|
+
|
|
197
|
+
err = os.symlink(fname, link_path);
|
|
198
|
+
assert(err === 0);
|
|
199
|
+
|
|
200
|
+
[st, err] = os.lstat(link_path);
|
|
201
|
+
assert(err, 0);
|
|
202
|
+
assert(st.mode & os.S_IFMT, os.S_IFLNK);
|
|
203
|
+
|
|
204
|
+
[buf, err] = os.readlink(link_path);
|
|
205
|
+
assert(err, 0);
|
|
206
|
+
assert(buf, fname);
|
|
207
|
+
|
|
208
|
+
assert(os.remove(link_path) === 0);
|
|
209
|
+
|
|
210
|
+
[buf, err] = os.getcwd();
|
|
211
|
+
assert(err, 0);
|
|
212
|
+
|
|
213
|
+
[buf2, err] = os.realpath(".");
|
|
214
|
+
assert(err, 0);
|
|
215
|
+
|
|
216
|
+
assert(buf, buf2);
|
|
217
|
+
|
|
218
|
+
assert(os.remove(fpath) === 0);
|
|
219
|
+
|
|
220
|
+
fd = os.open(fpath, os.O_RDONLY);
|
|
221
|
+
assert(fd < 0);
|
|
222
|
+
|
|
223
|
+
assert(os.remove(fdir) === 0);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function test_os_exec()
|
|
227
|
+
{
|
|
228
|
+
var ret, fds, pid, f, status;
|
|
229
|
+
|
|
230
|
+
ret = os.exec(["true"]);
|
|
231
|
+
assert(ret, 0);
|
|
232
|
+
|
|
233
|
+
ret = os.exec(["/bin/sh", "-c", "exit 1"], { usePath: false });
|
|
234
|
+
assert(ret, 1);
|
|
235
|
+
|
|
236
|
+
fds = os.pipe();
|
|
237
|
+
pid = os.exec(["sh", "-c", "echo $FOO"], {
|
|
238
|
+
stdout: fds[1],
|
|
239
|
+
block: false,
|
|
240
|
+
env: { FOO: "hello" },
|
|
241
|
+
} );
|
|
242
|
+
assert(pid >= 0);
|
|
243
|
+
os.close(fds[1]); /* close the write end (as it is only in the child) */
|
|
244
|
+
f = std.fdopen(fds[0], "r");
|
|
245
|
+
assert(f.getline(), "hello");
|
|
246
|
+
assert(f.getline(), null);
|
|
247
|
+
f.close();
|
|
248
|
+
[ret, status] = os.waitpid(pid, 0);
|
|
249
|
+
assert(ret, pid);
|
|
250
|
+
assert(status & 0x7f, 0); /* exited */
|
|
251
|
+
assert(status >> 8, 0); /* exit code */
|
|
252
|
+
|
|
253
|
+
pid = os.exec(["cat"], { block: false } );
|
|
254
|
+
assert(pid >= 0);
|
|
255
|
+
os.kill(pid, os.SIGQUIT);
|
|
256
|
+
[ret, status] = os.waitpid(pid, 0);
|
|
257
|
+
assert(ret, pid);
|
|
258
|
+
assert(status & 0x7f, os.SIGQUIT);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
function test_timer()
|
|
262
|
+
{
|
|
263
|
+
var th, i;
|
|
264
|
+
|
|
265
|
+
/* just test that a timer can be inserted and removed */
|
|
266
|
+
th = [];
|
|
267
|
+
for(i = 0; i < 3; i++)
|
|
268
|
+
th[i] = os.setTimeout(function () { }, 1000);
|
|
269
|
+
for(i = 0; i < 3; i++)
|
|
270
|
+
os.clearTimeout(th[i]);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
test_printf();
|
|
274
|
+
test_file1();
|
|
275
|
+
test_file2();
|
|
276
|
+
test_getline();
|
|
277
|
+
test_popen();
|
|
278
|
+
test_os();
|
|
279
|
+
test_os_exec();
|
|
280
|
+
test_timer();
|
|
281
|
+
test_ext_json();
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/* os.Worker API test */
|
|
2
|
+
import * as std from "std";
|
|
3
|
+
import * as os from "os";
|
|
4
|
+
|
|
5
|
+
function assert(actual, expected, message) {
|
|
6
|
+
if (arguments.length == 1)
|
|
7
|
+
expected = true;
|
|
8
|
+
|
|
9
|
+
if (actual === expected)
|
|
10
|
+
return;
|
|
11
|
+
|
|
12
|
+
if (actual !== null && expected !== null
|
|
13
|
+
&& typeof actual == 'object' && typeof expected == 'object'
|
|
14
|
+
&& actual.toString() === expected.toString())
|
|
15
|
+
return;
|
|
16
|
+
|
|
17
|
+
throw Error("assertion failed: got |" + actual + "|" +
|
|
18
|
+
", expected |" + expected + "|" +
|
|
19
|
+
(message ? " (" + message + ")" : ""));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
var worker;
|
|
23
|
+
|
|
24
|
+
function test_worker()
|
|
25
|
+
{
|
|
26
|
+
var counter;
|
|
27
|
+
|
|
28
|
+
worker = new os.Worker("./test_worker_module.js");
|
|
29
|
+
|
|
30
|
+
counter = 0;
|
|
31
|
+
worker.onmessage = function (e) {
|
|
32
|
+
var ev = e.data;
|
|
33
|
+
// print("recv", JSON.stringify(ev));
|
|
34
|
+
switch(ev.type) {
|
|
35
|
+
case "num":
|
|
36
|
+
assert(ev.num, counter);
|
|
37
|
+
counter++;
|
|
38
|
+
if (counter == 10) {
|
|
39
|
+
/* test SharedArrayBuffer modification */
|
|
40
|
+
let sab = new SharedArrayBuffer(10);
|
|
41
|
+
let buf = new Uint8Array(sab);
|
|
42
|
+
worker.postMessage({ type: "sab", buf: buf });
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
case "sab_done":
|
|
46
|
+
{
|
|
47
|
+
let buf = ev.buf;
|
|
48
|
+
/* check that the SharedArrayBuffer was modified */
|
|
49
|
+
assert(buf[2], 10);
|
|
50
|
+
worker.postMessage({ type: "abort" });
|
|
51
|
+
}
|
|
52
|
+
break;
|
|
53
|
+
case "done":
|
|
54
|
+
/* terminate */
|
|
55
|
+
worker.onmessage = null;
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
test_worker();
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* Worker code for test_worker.js */
|
|
2
|
+
import * as std from "std";
|
|
3
|
+
import * as os from "os";
|
|
4
|
+
|
|
5
|
+
var parent = os.Worker.parent;
|
|
6
|
+
|
|
7
|
+
function handle_msg(e) {
|
|
8
|
+
var ev = e.data;
|
|
9
|
+
// print("child_recv", JSON.stringify(ev));
|
|
10
|
+
switch(ev.type) {
|
|
11
|
+
case "abort":
|
|
12
|
+
parent.postMessage({ type: "done" });
|
|
13
|
+
break;
|
|
14
|
+
case "sab":
|
|
15
|
+
/* modify the SharedArrayBuffer */
|
|
16
|
+
ev.buf[2] = 10;
|
|
17
|
+
parent.postMessage({ type: "sab_done", buf: ev.buf });
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function worker_main() {
|
|
23
|
+
var i;
|
|
24
|
+
|
|
25
|
+
parent.onmessage = handle_msg;
|
|
26
|
+
for(i = 0; i < 10; i++) {
|
|
27
|
+
parent.postMessage({ type: "num", num: i });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
worker_main();
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
url="ftp://ftp.unicode.org/Public/13.0.0/ucd"
|
|
5
|
+
emoji_url="${url}/emoji/emoji-data.txt"
|
|
6
|
+
|
|
7
|
+
files="CaseFolding.txt DerivedNormalizationProps.txt PropList.txt \
|
|
8
|
+
SpecialCasing.txt CompositionExclusions.txt ScriptExtensions.txt \
|
|
9
|
+
UnicodeData.txt DerivedCoreProperties.txt NormalizationTest.txt Scripts.txt \
|
|
10
|
+
PropertyValueAliases.txt"
|
|
11
|
+
|
|
12
|
+
mkdir -p unicode
|
|
13
|
+
|
|
14
|
+
#for f in $files; do
|
|
15
|
+
# g="${url}/${f}"
|
|
16
|
+
# wget $g -O unicode/$f
|
|
17
|
+
#done
|
|
18
|
+
|
|
19
|
+
wget $emoji_url -O unicode/emoji-data.txt
|