democracy 0.0.56
Sign up to get free protection for your applications and to get access to all the features.
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,745 @@
|
|
1
|
+
|
2
|
+
function m() {
|
3
|
+
main_func = "";
|
4
|
+
decl = "const";
|
5
|
+
all_code = "";
|
6
|
+
VERBOSE_DEBUG = this.global && process.env["DEBUG"] == "true";
|
7
|
+
function get_all_declarations() {
|
8
|
+
return ((this.global && process.env["DECLS"]) || "").split(/,,/);
|
9
|
+
}
|
10
|
+
g = 0;
|
11
|
+
const javascript = process["mode"] === "js";
|
12
|
+
const cpp = process["mode"] === "cpp";
|
13
|
+
javascript || cpp || alert("Error, no mode selected");
|
14
|
+
if (cpp) {
|
15
|
+
decl = "const";
|
16
|
+
decl_int = "size_t";
|
17
|
+
array_decl = "Array";
|
18
|
+
precode = `
|
19
|
+
|
20
|
+
#define function static inline void*
|
21
|
+
#define var auto
|
22
|
+
#define let auto
|
23
|
+
#define const const auto
|
24
|
+
`;
|
25
|
+
} else {
|
26
|
+
array_decl = decl = decl_int = "";
|
27
|
+
precode = `
|
28
|
+
function set_globals() {
|
29
|
+
nesting=0;VERBOSE_DEBUG=${VERBOSE_DEBUG};function puts() { eval("return con" + "sole" + ".warn"); }
|
30
|
+
} ; set_globals(); `;
|
31
|
+
} /*
|
32
|
+
if (javascript)*/
|
33
|
+
if (cpp) {
|
34
|
+
len = "array.size()";
|
35
|
+
} else {
|
36
|
+
len = "array.length";
|
37
|
+
}
|
38
|
+
const m = (func, array, cond, one, i = [0, len]) => {
|
39
|
+
func = func.split(".").join("_");
|
40
|
+
c = "";
|
41
|
+
if (cpp) {
|
42
|
+
c += `#ifndef ${func}_macro
|
43
|
+
#define ${func}_macro
|
44
|
+
#undef ${func}
|
45
|
+
#undef ${func}_otherwise
|
46
|
+
#ifndef nop_func_macro
|
47
|
+
#define nop_func_macro
|
48
|
+
static double* nop_func(...) { return nullptr; }
|
49
|
+
#endif
|
50
|
+
#define ${func}_otherwise nop_func`;
|
51
|
+
}
|
52
|
+
var new_one = [];
|
53
|
+
|
54
|
+
one = one.split(/\s*;\s*/);
|
55
|
+
for (const i of one) {
|
56
|
+
if (i.length) {
|
57
|
+
new_one.push(i + ";");
|
58
|
+
}
|
59
|
+
}
|
60
|
+
one = new_one;
|
61
|
+
c += precode + `function ${func}(${array_decl} array, ${decl_int} i) {`;
|
62
|
+
c += `${cpp ? "double * " : "var"} rvalue`;
|
63
|
+
// }}`;
|
64
|
+
c += `
|
65
|
+
${
|
66
|
+
this.global &&
|
67
|
+
get_all_declarations().map((i) => {
|
68
|
+
if (!i.trim()) return "";
|
69
|
+
return "/* DECL */ const " + i;
|
70
|
+
})
|
71
|
+
}
|
72
|
+
${VERBOSE_DEBUG ? ++nesting : ""};
|
73
|
+
const max = ${i[1]};
|
74
|
+
while (i < max) {
|
75
|
+
Object element = array[i];
|
76
|
+
`;
|
77
|
+
if (javascript) {
|
78
|
+
c += `const style = element.style`;
|
79
|
+
}
|
80
|
+
c += ` ${
|
81
|
+
VERBOSE_DEBUG
|
82
|
+
? 'puts(" ".repeat((nesting - 1) * 4) + `....Iteration ${i} i=` + [i, "/", max, " (", Math.round(i/max*100, 2), "%", ") +", 1.0/max*100, "%", " of loop completed"].join(""))'
|
83
|
+
: ""
|
84
|
+
}
|
85
|
+
const condition = ${cond};
|
86
|
+
if (condition) {
|
87
|
+
using namespace std;
|
88
|
+
${one.slice(0, one.length - 1).join("\n\t\t\t\t")}
|
89
|
+
//{one.slice(one.length - 1)
|
90
|
+
rvalue = ${
|
91
|
+
cpp ? "*(double**)(size_t)(size_t*)&(" : ""
|
92
|
+
}${(last = one[one.length - 1]).substr(
|
93
|
+
0,
|
94
|
+
last.length - 1
|
95
|
+
)}${cpp ? ")" : ""};
|
96
|
+
} else {`;
|
97
|
+
if (javascript) {
|
98
|
+
c += "try { ";
|
99
|
+
}
|
100
|
+
c += `
|
101
|
+
rvalue = ${func}_otherwise(${cpp ? "&(" : "["}element${
|
102
|
+
cpp ? ")" : "]"
|
103
|
+
}, 0);
|
104
|
+
`;
|
105
|
+
if (javascript)
|
106
|
+
c += `
|
107
|
+
} catch (e) {}`;
|
108
|
+
c;
|
109
|
+
c += ` } ++i; } `;
|
110
|
+
if (VERBOSE_DEBUG && javascript)
|
111
|
+
c += `
|
112
|
+
puts("Loop comp");
|
113
|
+
--nesting;`;
|
114
|
+
c += `
|
115
|
+
return rvalue;
|
116
|
+
}
|
117
|
+
`;
|
118
|
+
if (cpp) {
|
119
|
+
c += `#endif` + "\n";
|
120
|
+
}
|
121
|
+
{
|
122
|
+
}
|
123
|
+
function remove_sides(a, first, last) {
|
124
|
+
if (a.startsWith(first)) a = a.slice(first.length, a.length);
|
125
|
+
if (a.endsWith(last)) {
|
126
|
+
a = a.slice(0, a.length - last.length);
|
127
|
+
}
|
128
|
+
return a;
|
129
|
+
}
|
130
|
+
|
131
|
+
/* String.prototype.gsub = function*/
|
132
|
+
|
133
|
+
if (!func.endsWith("otherwise")) {
|
134
|
+
d = main_func;
|
135
|
+
if (cpp) {
|
136
|
+
try {
|
137
|
+
array = mod(JSON.parse(array));
|
138
|
+
} catch (e) {
|
139
|
+
console.warn(e);
|
140
|
+
process.exit();
|
141
|
+
}
|
142
|
+
d += "return \n";
|
143
|
+
|
144
|
+
d += `${func}(\n${array},\n${i[0]}\n);`;
|
145
|
+
}
|
146
|
+
main_func = d;
|
147
|
+
}
|
148
|
+
function to_s(e) {
|
149
|
+
return e;
|
150
|
+
}
|
151
|
+
};
|
152
|
+
args = "";
|
153
|
+
try {
|
154
|
+
args = process.argv.slice(2).join(",,");
|
155
|
+
} catch (_) {
|
156
|
+
args = [...arguments].join(",,");
|
157
|
+
}
|
158
|
+
if (!args) {
|
159
|
+
puts("Added m function and env function");
|
160
|
+
return;
|
161
|
+
}
|
162
|
+
args = args.split(",,");
|
163
|
+
for (var i = 0; i < args.length; ) {
|
164
|
+
s = args.slice(i, i + 4);
|
165
|
+
if (s[0].match(/otherwise$/)) {
|
166
|
+
s = [s[0], [true], true, s[1]];
|
167
|
+
i += 2;
|
168
|
+
} else {
|
169
|
+
i += 4;
|
170
|
+
}
|
171
|
+
m(...s);
|
172
|
+
foo(s[0], c);
|
173
|
+
all_code += c;
|
174
|
+
}
|
175
|
+
all_code += `
|
176
|
+
function ${(prog_name = "e" + Date.now())}_main() {
|
177
|
+
${main_func}
|
178
|
+
}`;
|
179
|
+
if (cpp)
|
180
|
+
all_code = cpp_pre_code() + all_code + `\n\n\nint main(int argc, char ** argv , char ** envp) { main_( argc, argv, envp); }`;
|
181
|
+
else all_code += "\n" + prog_name + "_main();";
|
182
|
+
foo("all_code", all_code);
|
183
|
+
if (javascript) {
|
184
|
+
try {
|
185
|
+
eval(all_code);
|
186
|
+
} catch (e) {
|
187
|
+
console.warn(e);
|
188
|
+
}
|
189
|
+
}
|
190
|
+
function foo(func, code) {
|
191
|
+
const out = `${func}.${process.mode}`;
|
192
|
+
try {
|
193
|
+
require("fs").writeFileSync(out, code);
|
194
|
+
} catch (_) {
|
195
|
+
console.log(_);
|
196
|
+
var saveData = (function () {
|
197
|
+
var a = document.createElement("a");
|
198
|
+
document.body.appendChild(a);
|
199
|
+
a.style = "display: none";
|
200
|
+
return function (data, fileName) {
|
201
|
+
var json = data,
|
202
|
+
blob = new Blob([json], { type: "octet/stream" }),
|
203
|
+
url = window.URL.createObjectURL(blob);
|
204
|
+
a.href = url;
|
205
|
+
a.download = fileName;
|
206
|
+
a.click();
|
207
|
+
window.URL.revokeObjectURL(url);
|
208
|
+
};
|
209
|
+
})();
|
210
|
+
saveData(code, out);
|
211
|
+
}
|
212
|
+
}
|
213
|
+
return true;
|
214
|
+
}
|
215
|
+
|
216
|
+
env("mode", "js", 1) && m() && env("mode", "cpp", 1) && m();
|
217
|
+
function env(a, b, mode) {
|
218
|
+
var n = this.global || window;
|
219
|
+
n.process = n.process || { env: { DEBUG: "true", DECLS: "" } };
|
220
|
+
|
221
|
+
if (!mode) {
|
222
|
+
process.env.DECLS += `${a}=${b},,`;
|
223
|
+
} else {
|
224
|
+
process[a] = b;
|
225
|
+
}
|
226
|
+
return true;
|
227
|
+
}
|
228
|
+
function help() {
|
229
|
+
console.table(`m() (Browser console and node) -> generates a list of all arguments (or strings separted by double commas)
|
230
|
+
Functions are run sequentially. Otherwise functions are not run.
|
231
|
+
All functions loop over something
|
232
|
+
All functions have a conditional.
|
233
|
+
func_name iterable (such as a list or a DOMElement) condition expression
|
234
|
+
The resultant function returns the last expression in the function
|
235
|
+
This isn't a DSL, it's extremely broad.
|
236
|
+
Any algorithm can be expressed this way.
|
237
|
+
This makes writing algorithms much, much easier.
|
238
|
+
It works in Node.js and in the browser.
|
239
|
+
After generating all functions, the resultant code gets downloaded.
|
240
|
+
`);
|
241
|
+
}
|
242
|
+
|
243
|
+
//functin cpp
|
244
|
+
|
245
|
+
function cpp_code() {
|
246
|
+
return (cpp_code =
|
247
|
+
`
|
248
|
+
#include <cstddef>
|
249
|
+
#include <iostream>
|
250
|
+
#include <vector>
|
251
|
+
#include <sstream>
|
252
|
+
#include <cstring>
|
253
|
+
#include <map>
|
254
|
+
|
255
|
+
//namespace {
|
256
|
+
enum {
|
257
|
+
INT,
|
258
|
+
DOUBLE,
|
259
|
+
STRING,
|
260
|
+
VECTOR,
|
261
|
+
MAP,
|
262
|
+
|
263
|
+
NEEDS_FREEING,
|
264
|
+
NEEDS_DELETING,
|
265
|
+
NEEDS_DELETING_ARRAY
|
266
|
+
};
|
267
|
+
|
268
|
+
//#define c construct
|
269
|
+
|
270
|
+
class Object {
|
271
|
+
public:
|
272
|
+
double type;
|
273
|
+
double value;
|
274
|
+
|
275
|
+
|
276
|
+
~Object() {
|
277
|
+
union { char* v;
|
278
|
+
double d;
|
279
|
+
} un;
|
280
|
+
un.d = value;
|
281
|
+
|
282
|
+
switch ((size_t)type) {
|
283
|
+
case NEEDS_FREEING:
|
284
|
+
std::cout << "Freeing " << (std::string)(*this) << "\\n";
|
285
|
+
free(*un.v);
|
286
|
+
delete un.v;
|
287
|
+
break;
|
288
|
+
case NEEDS_DELETING_ARRAY:
|
289
|
+
delete [] un.v;
|
290
|
+
delete ptr;
|
291
|
+
break;
|
292
|
+
case NEEDS_DELETING:
|
293
|
+
delete *un.v;
|
294
|
+
delete un.v;
|
295
|
+
break;
|
296
|
+
}
|
297
|
+
};
|
298
|
+
|
299
|
+
operator const std::string() const;
|
300
|
+
|
301
|
+
|
302
|
+
const Object& print() const;
|
303
|
+
|
304
|
+
|
305
|
+
bool operator < (Object a) const {
|
306
|
+
return (const std::string)(*this) < (const std::string)(a);
|
307
|
+
};
|
308
|
+
|
309
|
+
};
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
template <class A>
|
316
|
+
class Array_sub : public std::vector<A>
|
317
|
+
{
|
318
|
+
public:
|
319
|
+
Array_sub(std::initializer_list<A> a) : std::vector<A>{a}
|
320
|
+
{}
|
321
|
+
|
322
|
+
inline void push(const A value) {
|
323
|
+
std::vector<A>::emplace_back(value);
|
324
|
+
}
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
inline Array_sub<A>& operator<< (A v) {
|
330
|
+
push(v);
|
331
|
+
return *this;
|
332
|
+
}
|
333
|
+
|
334
|
+
inline const auto surround(const char* first, const char* second) const {
|
335
|
+
|
336
|
+
typedef Array_sub<A> Array;
|
337
|
+
Array b{};
|
338
|
+
std::cout << "Start of loops\\n";
|
339
|
+
for (size_t i = 0; i < this->size(); ++i) {
|
340
|
+
std::string s{first};
|
341
|
+
s+= (std::string)((*this)[i]);
|
342
|
+
s += second;
|
343
|
+
|
344
|
+
b.emplace_back(construct_needs_freeing(strdup(s.c_str())));
|
345
|
+
std::cout << "Loop number " << i << std::endl;
|
346
|
+
}
|
347
|
+
std::cout << "End of loops\\n";
|
348
|
+
return b;
|
349
|
+
}
|
350
|
+
|
351
|
+
inline auto js() {
|
352
|
+
return surround("<script type='text/javascript'>", "</script>");
|
353
|
+
}
|
354
|
+
|
355
|
+
inline const auto construct_needs_freeing(const char* const a) const {
|
356
|
+
union {
|
357
|
+
const char* c;
|
358
|
+
double d;
|
359
|
+
} u;
|
360
|
+
|
361
|
+
u.c = a;
|
362
|
+
|
363
|
+
return *new Object{NEEDS_FREEING, u.d};
|
364
|
+
}
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
operator const std::string() const {
|
370
|
+
return to_s();
|
371
|
+
}
|
372
|
+
|
373
|
+
inline auto append(const char* arg1) const {
|
374
|
+
return surround(nullptr, arg1);
|
375
|
+
}
|
376
|
+
|
377
|
+
|
378
|
+
inline auto prepend(const char* arg1) const {
|
379
|
+
return surround(nullptr, arg1);
|
380
|
+
}
|
381
|
+
|
382
|
+
inline auto quote() const {
|
383
|
+
return surround("'", "'");
|
384
|
+
}
|
385
|
+
|
386
|
+
inline auto join(const char* delim) const {
|
387
|
+
std::string result;
|
388
|
+
const auto length=this->size();
|
389
|
+
for (size_t i = 0; i < length; ++i) {
|
390
|
+
result += (*this)[i];
|
391
|
+
if (i==length-1) {
|
392
|
+
} else {
|
393
|
+
result += delim;
|
394
|
+
}
|
395
|
+
}
|
396
|
+
|
397
|
+
return result;
|
398
|
+
}
|
399
|
+
|
400
|
+
inline auto html(const char* title) const {
|
401
|
+
std::string site_content;
|
402
|
+
site_content += "Content-type: text/html\\r\\n\\r\\n<!DOCTYPE html><html><head><title>";
|
403
|
+
site_content += title;
|
404
|
+
site_content += "</title></head>";
|
405
|
+
site_content += "<body>";
|
406
|
+
//this->surround("<p>", "</p>");
|
407
|
+
site_content += this->surround("<p>", "</p>");
|
408
|
+
site_content += "</body></html>";
|
409
|
+
return site_content;
|
410
|
+
}
|
411
|
+
|
412
|
+
inline auto p() const {
|
413
|
+
return surround("<p>", "</p>");
|
414
|
+
}
|
415
|
+
|
416
|
+
inline auto div() const {
|
417
|
+
return surround("<div>", "</div>");
|
418
|
+
}
|
419
|
+
|
420
|
+
inline auto nls() const {
|
421
|
+
return surround(nullptr, "\\n");
|
422
|
+
}
|
423
|
+
|
424
|
+
|
425
|
+
|
426
|
+
const std::string to_s() const {
|
427
|
+
std::ostringstream str;
|
428
|
+
str << '[';
|
429
|
+
for (size_t i = 0; i < this->size(); ++i) {
|
430
|
+
str << (std::string)((*this)[i]);
|
431
|
+
|
432
|
+
if (i == this->size() - 1) {
|
433
|
+
} else {
|
434
|
+
str << ", ";
|
435
|
+
}
|
436
|
+
}
|
437
|
+
str << ']';
|
438
|
+
|
439
|
+
|
440
|
+
|
441
|
+
return str.str();
|
442
|
+
|
443
|
+
}
|
444
|
+
};
|
445
|
+
typedef Array_sub<Object> Array;
|
446
|
+
|
447
|
+
|
448
|
+
union Object_v {
|
449
|
+
double d;
|
450
|
+
const void* v;
|
451
|
+
long long int long_long;
|
452
|
+
|
453
|
+
const std::map<Object, Object>* map;
|
454
|
+
//const char* string;
|
455
|
+
const Array* array; /*/const ch
|
456
|
+
const cha*/
|
457
|
+
const char* string;
|
458
|
+
};
|
459
|
+
|
460
|
+
|
461
|
+
Object::operator const std::string() const {
|
462
|
+
Object_v val_;
|
463
|
+
|
464
|
+
val_.d = this->value;
|
465
|
+
|
466
|
+
switch ((size_t)this->type) {
|
467
|
+
case STRING:
|
468
|
+
return val_.string;
|
469
|
+
case NEEDS_DELETING:
|
470
|
+
return "[needs_deleting]";
|
471
|
+
case NEEDS_FREEING:return val_.string;
|
472
|
+
// return std::string(val_.string) + ";
|
473
|
+
case NEEDS_DELETING_ARRAY: return "[needs_deleting_array]";
|
474
|
+
case INT:
|
475
|
+
return std::to_string((long long int)val_.long_long );
|
476
|
+
case DOUBLE:
|
477
|
+
return std::to_string(val_.d);
|
478
|
+
case VECTOR:
|
479
|
+
return val_.array->to_s();
|
480
|
+
case MAP:
|
481
|
+
std::string map_str = "{";
|
482
|
+
// std::map<A,
|
483
|
+
|
484
|
+
//auto& map = val_->map;
|
485
|
+
for (const auto i : *val_.map) {
|
486
|
+
map_str += (std::string)(i.first);
|
487
|
+
map_str += ": ";
|
488
|
+
|
489
|
+
map_str += (std::string)(i.second);
|
490
|
+
|
491
|
+
map_str += ", ";
|
492
|
+
}
|
493
|
+
// map_str[map_str.size() =
|
494
|
+
if (map_str.size () ) {
|
495
|
+
map_str[map_str.size() - 2] = '}';
|
496
|
+
map_str.resize(map_str.size() - 1);
|
497
|
+
}
|
498
|
+
|
499
|
+
// std::cout << map_str;
|
500
|
+
|
501
|
+
return map_str;
|
502
|
+
}
|
503
|
+
|
504
|
+
return "Error string";
|
505
|
+
};
|
506
|
+
|
507
|
+
const Object& Object::print() const {
|
508
|
+
std::cout << (std::string)(*this) << "<br/>";
|
509
|
+
return *this;
|
510
|
+
}
|
511
|
+
Object construct(const long long int a) { union Object_v un; un.long_long = a; return Object {0, un.d}; }
|
512
|
+
Object construct(const std::map<Object, Object> && a) {Object_v un; un.map = &a; return Object{4, un.d}; }
|
513
|
+
|
514
|
+
Object construct(Array && a ) {Object_v q; q.array = &a; return Object{3, q.d}; }
|
515
|
+
Object operator ""_c(unsigned long long a) {
|
516
|
+
return construct(a);
|
517
|
+
}
|
518
|
+
|
519
|
+
Object construct(const double a) {
|
520
|
+
return Object{1, a};
|
521
|
+
|
522
|
+
}
|
523
|
+
|
524
|
+
|
525
|
+
Object construct(const char* a) {
|
526
|
+
union {
|
527
|
+
double d;
|
528
|
+
const void* v; } b;
|
529
|
+
b.v = a;
|
530
|
+
|
531
|
+
return Object{2, b.d};
|
532
|
+
}
|
533
|
+
|
534
|
+
|
535
|
+
|
536
|
+
` + additional_cpp_code()); //moremore+more_cpp_code();
|
537
|
+
}
|
538
|
+
function nums(a) {
|
539
|
+
if (typeof a != "number") return mod(a);
|
540
|
+
|
541
|
+
//while (1) console.log(a)
|
542
|
+
if (a.toString().includes(".")) {
|
543
|
+
return surround(a);
|
544
|
+
} else {
|
545
|
+
return surround(a + "ll");
|
546
|
+
}
|
547
|
+
}
|
548
|
+
|
549
|
+
function cpp_pre_code() {
|
550
|
+
return cpp_code();
|
551
|
+
}
|
552
|
+
function set_kv(kv) {
|
553
|
+
for (var i_ of [0, 1]) kv[i_] = nums(kv[i_]);
|
554
|
+
|
555
|
+
//}
|
556
|
+
|
557
|
+
//}
|
558
|
+
}
|
559
|
+
|
560
|
+
function surround(a) {
|
561
|
+
return "construct(" + a + ")";
|
562
|
+
}
|
563
|
+
function mod(array, a = 0) {
|
564
|
+
if (typeof array == "string") {
|
565
|
+
return surround(JSON.stringify(array));
|
566
|
+
}
|
567
|
+
a = a + 1;
|
568
|
+
if (a == 1) {
|
569
|
+
var str = " Array{";
|
570
|
+
} else var str = "";
|
571
|
+
var element = false;
|
572
|
+
|
573
|
+
try {
|
574
|
+
// let str = "";
|
575
|
+
if (typeof array == "object" && array.length === undefined) {
|
576
|
+
str = "construct(" + "\n" + "\t".repeat(a) + " std::map<Object, Object >{";
|
577
|
+
// var element
|
578
|
+
var a = 0;
|
579
|
+
console.log(array);
|
580
|
+
// fs.writeFileSync("args/" +
|
581
|
+
const s = JSON.stringify;
|
582
|
+
for (var i in array) {
|
583
|
+
var kv = [i, array[i]];
|
584
|
+
element = true;
|
585
|
+
set_kv(kv);
|
586
|
+
const t = " Object ";
|
587
|
+
const pair = "std::pair<" + t + "," + t + ">";
|
588
|
+
str += pair + "(" + kv.join(",") + ")";
|
589
|
+
|
590
|
+
str += ", ";
|
591
|
+
}
|
592
|
+
str = str.replace(/, $/, "}" + ") , /* end of map */"); //";
|
593
|
+
} else if (array.length === undefined) {
|
594
|
+
array = ["", array];
|
595
|
+
set_kv(array);
|
596
|
+
return array[1];
|
597
|
+
} else
|
598
|
+
for (var i of array) {
|
599
|
+
// if (a ==
|
600
|
+
if (typeof i != "number") {
|
601
|
+
if (typeof i == "object" && i.join === undefined) {
|
602
|
+
str += mod(i, a);
|
603
|
+
} else if (typeof i == "string") {
|
604
|
+
const SEPARATOR = ",";
|
605
|
+
str +=
|
606
|
+
"construct(" + JSON.stringify(i) + ") /* string literal */" + SEPARATOR;
|
607
|
+
} else {
|
608
|
+
str +=
|
609
|
+
"\t".repeat(a) +
|
610
|
+
"construct(" +
|
611
|
+
"Array" +
|
612
|
+
"{" +
|
613
|
+
"\n" +
|
614
|
+
"\t".repeat(a) +
|
615
|
+
mod(i, a) +
|
616
|
+
"\t".repeat(a - 1) +
|
617
|
+
"}" +
|
618
|
+
")" +
|
619
|
+
",\n";
|
620
|
+
}
|
621
|
+
} else {
|
622
|
+
const value = ["", i];
|
623
|
+
set_kv(value);
|
624
|
+
str += value[1] + ", ";
|
625
|
+
}
|
626
|
+
}
|
627
|
+
|
628
|
+
if (a == 1) str += "}";
|
629
|
+
//str = str.slice(0, s
|
630
|
+
|
631
|
+
return str.replace(/, $/, "");
|
632
|
+
} catch (e) {
|
633
|
+
console.warn(e);
|
634
|
+
process.exit(1);
|
635
|
+
}
|
636
|
+
}
|
637
|
+
|
638
|
+
//#include <iostream>
|
639
|
+
|
640
|
+
function additional_cpp_code() {
|
641
|
+
return `
|
642
|
+
#include \"fcgio.h\"
|
643
|
+
using namespace std;
|
644
|
+
#define endl "<br />"
|
645
|
+
static inline void* ${prog_name}_main ();
|
646
|
+
static int mmain();
|
647
|
+
|
648
|
+
int
|
649
|
+
main_
|
650
|
+
(
|
651
|
+
int argc, char** argv, char** envp)
|
652
|
+
{
|
653
|
+
(void)envp;
|
654
|
+
Array args{};
|
655
|
+
for (int i = 0; i < argc; ++i)
|
656
|
+
args << construct(argv[i]);
|
657
|
+
//auto content = (string)args.html("Title"); //cout << c
|
658
|
+
auto content=std::string{};
|
659
|
+
cout << Array{construct(1ll)}.html("Hello");
|
660
|
+
//cout << content;
|
661
|
+
|
662
|
+
|
663
|
+
const auto server=0;
|
664
|
+
|
665
|
+
if (server) {
|
666
|
+
// Backup the stdio streambufs
|
667
|
+
streambuf * cin_streambuf = cin.rdbuf();
|
668
|
+
streambuf * cout_streambuf = cout.rdbuf();
|
669
|
+
streambuf * cerr_streambuf = cerr.rdbuf();
|
670
|
+
|
671
|
+
FCGX_Request request;
|
672
|
+
|
673
|
+
FCGX_Init();
|
674
|
+
/*
|
675
|
+
*
|
676
|
+
*
|
677
|
+
*
|
678
|
+
* The above function seems to memory leak 1 block of 768 bytes. It never deletes it at exit.
|
679
|
+
*
|
680
|
+
*
|
681
|
+
*
|
682
|
+
*/
|
683
|
+
FCGX_InitRequest(&request, 0, 0);
|
684
|
+
|
685
|
+
while (FCGX_Accept_r(&request) == 0) {
|
686
|
+
fcgi_streambuf cin_fcgi_streambuf(request.in);
|
687
|
+
fcgi_streambuf cout_fcgi_streambuf(request.out);
|
688
|
+
fcgi_streambuf cerr_fcgi_streambuf(request.err);
|
689
|
+
|
690
|
+
cin.rdbuf(&cin_fcgi_streambuf);
|
691
|
+
cout.rdbuf(&cout_fcgi_streambuf);
|
692
|
+
cerr.rdbuf(&cerr_fcgi_streambuf);
|
693
|
+
|
694
|
+
cout << content;
|
695
|
+
|
696
|
+
// system(\"echo 5 > /root/six\");
|
697
|
+
mmain();
|
698
|
+
cout << "Where?";
|
699
|
+
// system(\"echo 6\");
|
700
|
+
|
701
|
+
// Note: the fcgi_streambuf destructor will auto flush
|
702
|
+
}
|
703
|
+
|
704
|
+
// restore stdio streambufs
|
705
|
+
cin.rdbuf(cin_streambuf);
|
706
|
+
cout.rdbuf(cout_streambuf);
|
707
|
+
cerr.rdbuf(cerr_streambuf);
|
708
|
+
}
|
709
|
+
|
710
|
+
${prog_name}_main();
|
711
|
+
|
712
|
+
return 0;
|
713
|
+
}
|
714
|
+
|
715
|
+
|
716
|
+
static int mmain()
|
717
|
+
{
|
718
|
+
std::string command(\"ls * 2>&1\");
|
719
|
+
|
720
|
+
char buffer[4096];
|
721
|
+
std::string result;
|
722
|
+
|
723
|
+
// std::cout << "Opening reading pipe"
|
724
|
+
FILE* pipe = popen(command.c_str(), \"r\");
|
725
|
+
if (!pipe)
|
726
|
+
{
|
727
|
+
std::cerr << \"Couldn't start command.\" << endl;
|
728
|
+
return 0;
|
729
|
+
}
|
730
|
+
while (fgets(buffer, sizeof(buffer), pipe) != NULL) {
|
731
|
+
//std::cout << \"Reading...\" << std::endl;
|
732
|
+
result += buffer;
|
733
|
+
}
|
734
|
+
auto returnCode = pclose(pipe);
|
735
|
+
|
736
|
+
std::cout << result << endl;
|
737
|
+
std::cout << returnCode << endl;
|
738
|
+
|
739
|
+
// ${prog_name}_main();
|
740
|
+
|
741
|
+
${prog_name}_main ();
|
742
|
+
return 0;
|
743
|
+
}
|
744
|
+
`;
|
745
|
+
}
|