elonmusk 1.0.72 → 1.0.79

Sign up to get free protection for your applications and to get access to all the features.
Files changed (529) hide show
  1. checksums.yaml +4 -4
  2. data/CYCLE_OF_ETHICAL_BEHAVIOR +7 -0
  3. data/EXAMPLES_OF_OPERATION.html +6132 -0
  4. data/PP.rb +4 -4
  5. data/README.md +77 -69
  6. data/VERSION_NUMBER +1 -1
  7. data/bin/big_num +3 -0
  8. data/bin/chat_rb +6 -18
  9. data/bin/close +1 -1
  10. data/bin/find_housing +1 -1
  11. data/bin/left_right +0 -0
  12. data/bin/left_right.exe +0 -0
  13. data/bin/quot +1 -1
  14. data/documentation/DISCOURSE_GENERATOR.exe +1 -1
  15. data/documentation/ULTIMATE_CHAT_APPLICATION.exe +1 -1
  16. data/documentation/abs +3 -11
  17. data/documentation/add +1 -5
  18. data/documentation/append +1 -3
  19. data/documentation/black +0 -1
  20. data/documentation/black_bold +0 -1
  21. data/documentation/black_bold_underline +0 -1
  22. data/documentation/black_underline +0 -1
  23. data/documentation/blue +0 -1
  24. data/documentation/blue_bold +0 -1
  25. data/documentation/blue_bold_underline +0 -1
  26. data/documentation/blue_underline +0 -1
  27. data/documentation/bold +1 -1
  28. data/documentation/chat_rb +1 -9
  29. data/documentation/clock +1 -16
  30. data/documentation/close +2 -2
  31. data/documentation/cyan +0 -1
  32. data/documentation/cyan_bold +0 -1
  33. data/documentation/cyan_bold_underline +0 -1
  34. data/documentation/cyan_underline +0 -1
  35. data/documentation/dictate +1 -2
  36. data/documentation/div +1 -7
  37. data/documentation/doc.rb +2 -0
  38. data/documentation/dump +1 -2
  39. data/documentation/email +2 -20
  40. data/documentation/emerald-browser +1 -2
  41. data/documentation/emeraldc +22 -47
  42. data/documentation/emoji +1 -4
  43. data/documentation/exp +1 -1
  44. data/documentation/find_housing +1 -1
  45. data/documentation/floor +1 -1
  46. data/documentation/g+ +1 -3
  47. data/documentation/google_speak +2 -2
  48. data/documentation/green +0 -1
  49. data/documentation/green_bold +0 -1
  50. data/documentation/green_bold_underline +0 -1
  51. data/documentation/green_underline +0 -1
  52. data/documentation/gsub +3 -7
  53. data/documentation/gsubip +1 -1
  54. data/documentation/last_nth +1 -1
  55. data/documentation/left_right.exe +9 -0
  56. data/documentation/lines +1 -3
  57. data/documentation/magenta +0 -1
  58. data/documentation/magenta_bold +0 -1
  59. data/documentation/magenta_bold_underline +0 -1
  60. data/documentation/magenta_underline +0 -1
  61. data/documentation/mul +2 -4
  62. data/documentation/nth +1 -1
  63. data/documentation/open +4 -23
  64. data/documentation/page +1 -1
  65. data/documentation/prepend +2 -20
  66. data/documentation/processes +1 -5
  67. data/documentation/red +0 -1
  68. data/documentation/red_bold +0 -1
  69. data/documentation/red_bold_underline +0 -1
  70. data/documentation/red_underline +0 -1
  71. data/documentation/rgsub +8 -13
  72. data/documentation/rhyme +5 -12
  73. data/documentation/rip +1 -2
  74. data/documentation/rnip +1 -1
  75. data/documentation/selectlines +1 -7
  76. data/documentation/speakcat +2 -2
  77. data/documentation/squeeze +0 -1
  78. data/documentation/sub +2 -3
  79. data/documentation/swap +0 -2
  80. data/documentation/t +3 -12
  81. data/documentation/underline +1 -1
  82. data/documentation/undump +1 -5
  83. data/documentation/white +0 -1
  84. data/documentation/white_bold +0 -1
  85. data/documentation/white_bold_underline +0 -1
  86. data/documentation/white_underline +0 -1
  87. data/documentation/yellow +0 -1
  88. data/documentation/yellow_bold +0 -1
  89. data/documentation/yellow_bold_underline +0 -1
  90. data/documentation/yellow_underline +0 -1
  91. data/gem_data/VERSION_NUMBER +1 -1
  92. data/gem_data/version_increment +1 -0
  93. data/images/12.png +0 -0
  94. data/index.html +78 -75
  95. data/non_compiled_programs/big_num +3 -0
  96. data/non_compiled_programs/chat_rb +6 -18
  97. data/non_compiled_programs/close +1 -1
  98. data/non_compiled_programs/find_housing +1 -1
  99. data/non_compiled_programs/quot +1 -1
  100. data/other/rub +35 -0
  101. data/other/stories/1 +15 -0
  102. data/other/stories/10 +17 -0
  103. data/other/stories/100 +17 -0
  104. data/other/stories/1000 +17 -0
  105. data/other/stories/1001 +17 -0
  106. data/other/stories/101 +15 -0
  107. data/other/stories/102 +15 -0
  108. data/other/stories/103 +13 -0
  109. data/other/stories/104 +17 -0
  110. data/other/stories/105 +11 -0
  111. data/other/stories/106 +13 -0
  112. data/other/stories/107 +15 -0
  113. data/other/stories/108 +15 -0
  114. data/other/stories/109 +13 -0
  115. data/other/stories/11 +13 -0
  116. data/other/stories/110 +17 -0
  117. data/other/stories/111 +11 -0
  118. data/other/stories/112 +13 -0
  119. data/other/stories/113 +11 -0
  120. data/other/stories/114 +15 -0
  121. data/other/stories/115 +15 -0
  122. data/other/stories/116 +13 -0
  123. data/other/stories/117 +17 -0
  124. data/other/stories/118 +19 -0
  125. data/other/stories/119 +15 -0
  126. data/other/stories/12 +19 -0
  127. data/other/stories/120 +15 -0
  128. data/other/stories/121 +15 -0
  129. data/other/stories/122 +11 -0
  130. data/other/stories/123 +23 -0
  131. data/other/stories/124 +17 -0
  132. data/other/stories/125 +19 -0
  133. data/other/stories/126 +15 -0
  134. data/other/stories/127 +17 -0
  135. data/other/stories/128 +17 -0
  136. data/other/stories/129 +15 -0
  137. data/other/stories/13 +13 -0
  138. data/other/stories/130 +19 -0
  139. data/other/stories/131 +17 -0
  140. data/other/stories/132 +11 -0
  141. data/other/stories/133 +13 -0
  142. data/other/stories/134 +17 -0
  143. data/other/stories/135 +15 -0
  144. data/other/stories/136 +15 -0
  145. data/other/stories/137 +15 -0
  146. data/other/stories/138 +17 -0
  147. data/other/stories/139 +9 -0
  148. data/other/stories/14 +11 -0
  149. data/other/stories/140 +13 -0
  150. data/other/stories/141 +15 -0
  151. data/other/stories/142 +11 -0
  152. data/other/stories/143 +13 -0
  153. data/other/stories/144 +21 -0
  154. data/other/stories/145 +11 -0
  155. data/other/stories/146 +11 -0
  156. data/other/stories/147 +13 -0
  157. data/other/stories/148 +17 -0
  158. data/other/stories/149 +15 -0
  159. data/other/stories/15 +15 -0
  160. data/other/stories/150 +17 -0
  161. data/other/stories/151 +13 -0
  162. data/other/stories/152 +13 -0
  163. data/other/stories/153 +17 -0
  164. data/other/stories/154 +15 -0
  165. data/other/stories/155 +15 -0
  166. data/other/stories/156 +17 -0
  167. data/other/stories/157 +13 -0
  168. data/other/stories/158 +21 -0
  169. data/other/stories/159 +15 -0
  170. data/other/stories/16 +17 -0
  171. data/other/stories/160 +17 -0
  172. data/other/stories/161 +15 -0
  173. data/other/stories/162 +19 -0
  174. data/other/stories/163 +15 -0
  175. data/other/stories/164 +13 -0
  176. data/other/stories/165 +11 -0
  177. data/other/stories/166 +19 -0
  178. data/other/stories/167 +19 -0
  179. data/other/stories/168 +21 -0
  180. data/other/stories/169 +13 -0
  181. data/other/stories/17 +19 -0
  182. data/other/stories/170 +13 -0
  183. data/other/stories/171 +13 -0
  184. data/other/stories/172 +15 -0
  185. data/other/stories/173 +13 -0
  186. data/other/stories/174 +11 -0
  187. data/other/stories/175 +15 -0
  188. data/other/stories/176 +15 -0
  189. data/other/stories/177 +15 -0
  190. data/other/stories/178 +15 -0
  191. data/other/stories/179 +17 -0
  192. data/other/stories/18 +23 -0
  193. data/other/stories/180 +19 -0
  194. data/other/stories/181 +15 -0
  195. data/other/stories/182 +15 -0
  196. data/other/stories/183 +17 -0
  197. data/other/stories/184 +15 -0
  198. data/other/stories/185 +15 -0
  199. data/other/stories/186 +15 -0
  200. data/other/stories/187 +15 -0
  201. data/other/stories/188 +15 -0
  202. data/other/stories/189 +17 -0
  203. data/other/stories/19 +17 -0
  204. data/other/stories/190 +13 -0
  205. data/other/stories/191 +17 -0
  206. data/other/stories/192 +17 -0
  207. data/other/stories/193 +11 -0
  208. data/other/stories/194 +17 -0
  209. data/other/stories/195 +13 -0
  210. data/other/stories/196 +13 -0
  211. data/other/stories/197 +15 -0
  212. data/other/stories/198 +15 -0
  213. data/other/stories/199 +15 -0
  214. data/other/stories/2 +13 -0
  215. data/other/stories/20 +15 -0
  216. data/other/stories/200 +17 -0
  217. data/other/stories/201 +21 -0
  218. data/other/stories/202 +13 -0
  219. data/other/stories/203 +15 -0
  220. data/other/stories/204 +17 -0
  221. data/other/stories/205 +13 -0
  222. data/other/stories/206 +15 -0
  223. data/other/stories/207 +13 -0
  224. data/other/stories/208 +11 -0
  225. data/other/stories/209 +15 -0
  226. data/other/stories/21 +19 -0
  227. data/other/stories/210 +11 -0
  228. data/other/stories/211 +19 -0
  229. data/other/stories/212 +17 -0
  230. data/other/stories/213 +13 -0
  231. data/other/stories/214 +13 -0
  232. data/other/stories/215 +15 -0
  233. data/other/stories/216 +13 -0
  234. data/other/stories/217 +23 -0
  235. data/other/stories/218 +17 -0
  236. data/other/stories/219 +15 -0
  237. data/other/stories/22 +13 -0
  238. data/other/stories/220 +15 -0
  239. data/other/stories/221 +19 -0
  240. data/other/stories/222 +15 -0
  241. data/other/stories/223 +19 -0
  242. data/other/stories/224 +15 -0
  243. data/other/stories/225 +13 -0
  244. data/other/stories/226 +15 -0
  245. data/other/stories/227 +15 -0
  246. data/other/stories/228 +13 -0
  247. data/other/stories/229 +15 -0
  248. data/other/stories/23 +17 -0
  249. data/other/stories/230 +15 -0
  250. data/other/stories/231 +17 -0
  251. data/other/stories/232 +17 -0
  252. data/other/stories/233 +17 -0
  253. data/other/stories/234 +19 -0
  254. data/other/stories/235 +17 -0
  255. data/other/stories/236 +15 -0
  256. data/other/stories/237 +15 -0
  257. data/other/stories/238 +17 -0
  258. data/other/stories/239 +19 -0
  259. data/other/stories/24 +15 -0
  260. data/other/stories/240 +15 -0
  261. data/other/stories/241 +13 -0
  262. data/other/stories/242 +23 -0
  263. data/other/stories/243 +11 -0
  264. data/other/stories/244 +19 -0
  265. data/other/stories/245 +19 -0
  266. data/other/stories/246 +17 -0
  267. data/other/stories/247 +15 -0
  268. data/other/stories/248 +17 -0
  269. data/other/stories/249 +13 -0
  270. data/other/stories/25 +15 -0
  271. data/other/stories/250 +15 -0
  272. data/other/stories/251 +21 -0
  273. data/other/stories/252 +17 -0
  274. data/other/stories/253 +15 -0
  275. data/other/stories/254 +13 -0
  276. data/other/stories/255 +15 -0
  277. data/other/stories/256 +13 -0
  278. data/other/stories/257 +15 -0
  279. data/other/stories/258 +13 -0
  280. data/other/stories/259 +15 -0
  281. data/other/stories/26 +15 -0
  282. data/other/stories/260 +15 -0
  283. data/other/stories/261 +11 -0
  284. data/other/stories/262 +13 -0
  285. data/other/stories/263 +17 -0
  286. data/other/stories/264 +13 -0
  287. data/other/stories/265 +19 -0
  288. data/other/stories/266 +23 -0
  289. data/other/stories/267 +13 -0
  290. data/other/stories/268 +15 -0
  291. data/other/stories/269 +19 -0
  292. data/other/stories/27 +13 -0
  293. data/other/stories/270 +15 -0
  294. data/other/stories/271 +17 -0
  295. data/other/stories/272 +11 -0
  296. data/other/stories/273 +13 -0
  297. data/other/stories/274 +15 -0
  298. data/other/stories/275 +13 -0
  299. data/other/stories/276 +15 -0
  300. data/other/stories/277 +13 -0
  301. data/other/stories/278 +15 -0
  302. data/other/stories/279 +15 -0
  303. data/other/stories/28 +19 -0
  304. data/other/stories/280 +15 -0
  305. data/other/stories/281 +19 -0
  306. data/other/stories/282 +15 -0
  307. data/other/stories/283 +17 -0
  308. data/other/stories/284 +13 -0
  309. data/other/stories/285 +15 -0
  310. data/other/stories/286 +15 -0
  311. data/other/stories/287 +17 -0
  312. data/other/stories/288 +11 -0
  313. data/other/stories/289 +15 -0
  314. data/other/stories/29 +23 -0
  315. data/other/stories/290 +19 -0
  316. data/other/stories/291 +19 -0
  317. data/other/stories/292 +17 -0
  318. data/other/stories/293 +13 -0
  319. data/other/stories/294 +15 -0
  320. data/other/stories/295 +15 -0
  321. data/other/stories/296 +15 -0
  322. data/other/stories/297 +15 -0
  323. data/other/stories/298 +23 -0
  324. data/other/stories/299 +11 -0
  325. data/other/stories/3 +15 -0
  326. data/other/stories/30 +13 -0
  327. data/other/stories/300 +15 -0
  328. data/other/stories/301 +15 -0
  329. data/other/stories/302 +19 -0
  330. data/other/stories/303 +15 -0
  331. data/other/stories/304 +17 -0
  332. data/other/stories/305 +15 -0
  333. data/other/stories/306 +21 -0
  334. data/other/stories/307 +11 -0
  335. data/other/stories/308 +15 -0
  336. data/other/stories/309 +15 -0
  337. data/other/stories/31 +19 -0
  338. data/other/stories/310 +17 -0
  339. data/other/stories/311 +15 -0
  340. data/other/stories/312 +15 -0
  341. data/other/stories/313 +13 -0
  342. data/other/stories/314 +15 -0
  343. data/other/stories/315 +13 -0
  344. data/other/stories/316 +17 -0
  345. data/other/stories/317 +17 -0
  346. data/other/stories/318 +15 -0
  347. data/other/stories/319 +13 -0
  348. data/other/stories/32 +17 -0
  349. data/other/stories/320 +13 -0
  350. data/other/stories/321 +15 -0
  351. data/other/stories/322 +11 -0
  352. data/other/stories/323 +15 -0
  353. data/other/stories/324 +19 -0
  354. data/other/stories/325 +19 -0
  355. data/other/stories/326 +21 -0
  356. data/other/stories/327 +15 -0
  357. data/other/stories/328 +15 -0
  358. data/other/stories/329 +15 -0
  359. data/other/stories/33 +13 -0
  360. data/other/stories/330 +15 -0
  361. data/other/stories/331 +17 -0
  362. data/other/stories/332 +20 -0
  363. data/other/stories/333 +17 -0
  364. data/other/stories/334 +11 -0
  365. data/other/stories/335 +15 -0
  366. data/other/stories/336 +15 -0
  367. data/other/stories/337 +19 -0
  368. data/other/stories/338 +19 -0
  369. data/other/stories/339 +13 -0
  370. data/other/stories/34 +13 -0
  371. data/other/stories/340 +17 -0
  372. data/other/stories/341 +15 -0
  373. data/other/stories/342 +17 -0
  374. data/other/stories/343 +15 -0
  375. data/other/stories/344 +17 -0
  376. data/other/stories/345 +15 -0
  377. data/other/stories/346 +17 -0
  378. data/other/stories/347 +17 -0
  379. data/other/stories/348 +11 -0
  380. data/other/stories/349 +15 -0
  381. data/other/stories/35 +13 -0
  382. data/other/stories/350 +21 -0
  383. data/other/stories/351 +15 -0
  384. data/other/stories/352 +17 -0
  385. data/other/stories/353 +15 -0
  386. data/other/stories/354 +17 -0
  387. data/other/stories/355 +15 -0
  388. data/other/stories/356 +15 -0
  389. data/other/stories/357 +11 -0
  390. data/other/stories/358 +13 -0
  391. data/other/stories/359 +11 -0
  392. data/other/stories/36 +11 -0
  393. data/other/stories/360 +13 -0
  394. data/other/stories/361 +13 -0
  395. data/other/stories/362 +13 -0
  396. data/other/stories/363 +21 -0
  397. data/other/stories/364 +17 -0
  398. data/other/stories/365 +11 -0
  399. data/other/stories/37 +13 -0
  400. data/other/stories/38 +17 -0
  401. data/other/stories/39 +17 -0
  402. data/other/stories/4 +15 -0
  403. data/other/stories/40 +11 -0
  404. data/other/stories/4000 +15 -0
  405. data/other/stories/4001 +21 -0
  406. data/other/stories/4002 +15 -0
  407. data/other/stories/4003 +15 -0
  408. data/other/stories/4004 +15 -0
  409. data/other/stories/4005 +15 -0
  410. data/other/stories/4006 +21 -0
  411. data/other/stories/4007 +15 -0
  412. data/other/stories/4008 +15 -0
  413. data/other/stories/4009 +13 -0
  414. data/other/stories/4010 +15 -0
  415. data/other/stories/4011 +15 -0
  416. data/other/stories/4012 +17 -0
  417. data/other/stories/4013 +15 -0
  418. data/other/stories/4014 +13 -0
  419. data/other/stories/4015 +15 -0
  420. data/other/stories/4016 +17 -0
  421. data/other/stories/4017 +13 -0
  422. data/other/stories/4018 +17 -0
  423. data/other/stories/4019 +15 -0
  424. data/other/stories/4020 +19 -0
  425. data/other/stories/4021 +21 -0
  426. data/other/stories/4022 +15 -0
  427. data/other/stories/4023 +13 -0
  428. data/other/stories/4024 +13 -0
  429. data/other/stories/4025 +23 -0
  430. data/other/stories/4026 +17 -0
  431. data/other/stories/4027 +15 -0
  432. data/other/stories/4028 +13 -0
  433. data/other/stories/4029 +11 -0
  434. data/other/stories/4030 +13 -0
  435. data/other/stories/4031 +13 -0
  436. data/other/stories/4032 +13 -0
  437. data/other/stories/4033 +15 -0
  438. data/other/stories/4034 +17 -0
  439. data/other/stories/4035 +13 -0
  440. data/other/stories/41 +15 -0
  441. data/other/stories/42 +17 -0
  442. data/other/stories/43 +15 -0
  443. data/other/stories/44 +15 -0
  444. data/other/stories/45 +17 -0
  445. data/other/stories/46 +17 -0
  446. data/other/stories/47 +13 -0
  447. data/other/stories/48 +13 -0
  448. data/other/stories/49 +17 -0
  449. data/other/stories/5 +11 -0
  450. data/other/stories/50 +13 -0
  451. data/other/stories/51 +15 -0
  452. data/other/stories/52 +17 -0
  453. data/other/stories/53 +15 -0
  454. data/other/stories/54 +11 -0
  455. data/other/stories/55 +21 -0
  456. data/other/stories/56 +19 -0
  457. data/other/stories/57 +13 -0
  458. data/other/stories/58 +15 -0
  459. data/other/stories/59 +13 -0
  460. data/other/stories/6 +11 -0
  461. data/other/stories/60 +13 -0
  462. data/other/stories/61 +13 -0
  463. data/other/stories/62 +13 -0
  464. data/other/stories/63 +15 -0
  465. data/other/stories/64 +15 -0
  466. data/other/stories/65 +17 -0
  467. data/other/stories/66 +15 -0
  468. data/other/stories/67 +15 -0
  469. data/other/stories/68 +15 -0
  470. data/other/stories/69 +17 -0
  471. data/other/stories/7 +15 -0
  472. data/other/stories/70 +21 -0
  473. data/other/stories/71 +13 -0
  474. data/other/stories/72 +13 -0
  475. data/other/stories/73 +15 -0
  476. data/other/stories/74 +17 -0
  477. data/other/stories/75 +11 -0
  478. data/other/stories/76 +19 -0
  479. data/other/stories/77 +21 -0
  480. data/other/stories/78 +19 -0
  481. data/other/stories/79 +11 -0
  482. data/other/stories/8 +17 -0
  483. data/other/stories/80 +21 -0
  484. data/other/stories/81 +23 -0
  485. data/other/stories/82 +15 -0
  486. data/other/stories/83 +11 -0
  487. data/other/stories/84 +13 -0
  488. data/other/stories/85 +17 -0
  489. data/other/stories/86 +17 -0
  490. data/other/stories/87 +25 -0
  491. data/other/stories/88 +19 -0
  492. data/other/stories/89 +17 -0
  493. data/other/stories/9 +15 -0
  494. data/other/stories/90 +15 -0
  495. data/other/stories/91 +15 -0
  496. data/other/stories/92 +17 -0
  497. data/other/stories/93 +17 -0
  498. data/other/stories/94 +19 -0
  499. data/other/stories/95 +13 -0
  500. data/other/stories/96 +17 -0
  501. data/other/stories/97 +15 -0
  502. data/other/stories/98 +11 -0
  503. data/other/stories/99 +13 -0
  504. data/other/upload.rb +8 -2
  505. data/src/compilation/abs +1 -1
  506. data/src/compilation/add +1 -1
  507. data/src/compilation/append +1 -1
  508. data/src/compilation/div +1 -1
  509. data/src/compilation/dump +1 -1
  510. data/src/compilation/exp +1 -1
  511. data/src/compilation/gsub +1 -1
  512. data/src/compilation/lines +1 -1
  513. data/src/compilation/mul +1 -1
  514. data/src/compilation/prepend +1 -1
  515. data/src/compilation/rip +1 -1
  516. data/src/compilation/rnip +1 -1
  517. data/src/compilation/selectlines +1 -1
  518. data/src/compilation/sub +1 -1
  519. data/src/compilation/swap +1 -1
  520. data/src/compilation/undump +1 -1
  521. data/src/compile_all +5 -2
  522. data/src/left_right +0 -0
  523. data/src/left_right.cc +87 -0
  524. data/src/left_right.exe +0 -0
  525. data/version_increment +1 -0
  526. metadata +417 -5
  527. data/non_compiled_programs/make_server +0 -784
  528. data/src/- +0 -1
  529. data/src/--file +0 -0
@@ -1,784 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /*
4
-
5
- # BSD 2-Clause License
6
- #
7
- # Copyright (c) 2023, Gregory Cohen
8
- # All rights reserved.
9
- #
10
- # Redistribution and use in source and binary forms, with or without
11
- # modification, are permitted provided that the following conditions are met:
12
- #
13
- # 1. Redistributions of source code must retain the above copyright notice, this
14
- # list of conditions and the following disclaimer.
15
- #
16
- # 2. Redistributions in binary form must reproduce the above copyright notice,
17
- # this list of conditions and the following disclaimer in the documentation
18
- # and/or other materials provided with the distribution.
19
- #
20
- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
- # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
- # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
- # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
- # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
- # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
- # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
- # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
- # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
- # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
-
31
- # Get rid of the "ca"s if you want to make it work for the US.
32
- # This program is for personal, non-commerical use.
33
- # Any sites this program downloads from are being used for personal, non-commerical use.
34
- # If any legal problems do arise, feel free to contact me at my
35
- # email and I can modify this program to use some ohter site.
36
-
37
-
38
- */
39
-
40
-
41
- function m() {
42
- main_func = "";
43
- decl = "const";
44
- all_code = "";
45
- VERBOSE_DEBUG = this.global && process.env["DEBUG"] == "true";
46
- function get_all_declarations() {
47
- return ((this.global && process.env["DECLS"]) || "").split(/,,/);
48
- }
49
- g = 0;
50
- const javascript = process["mode"] === "js";
51
- const cpp = process["mode"] === "cpp";
52
- javascript || cpp || alert("Error, no mode selected");
53
- if (cpp) {
54
- decl = "const";
55
- decl_int = "size_t";
56
- array_decl = "Array";
57
- precode = `
58
-
59
- #define function static inline void*
60
- #define var auto
61
- #define let auto
62
- #define const const auto
63
- `;
64
- } else {
65
- array_decl = decl = decl_int = "";
66
- precode = `
67
- function set_globals() {
68
- nesting=0;VERBOSE_DEBUG=${VERBOSE_DEBUG};function puts() { eval("return con" + "sole" + ".warn"); }
69
- } ; set_globals(); `;
70
- } /*
71
- if (javascript)*/
72
- if (cpp) {
73
- len = "array.size()";
74
- } else {
75
- len = "array.length";
76
- }
77
- const m = (func, array, cond, one, i = [0, len]) => {
78
- func = func.split(".").join("_");
79
- c = "";
80
- if (cpp) {
81
- c += `#ifndef ${func}_macro
82
- #define ${func}_macro
83
- #undef ${func}
84
- #undef ${func}_otherwise
85
- #ifndef nop_func_macro
86
- #define nop_func_macro
87
- static double* nop_func(...) { return nullptr; }
88
- #endif
89
- #define ${func}_otherwise nop_func`;
90
- }
91
- var new_one = [];
92
-
93
- one = one.split(/\s*;\s*/);
94
- for (const i of one) {
95
- if (i.length) {
96
- new_one.push(i + ";");
97
- }
98
- }
99
- one = new_one;
100
- c += precode + `function ${func}(${array_decl} array, ${decl_int} i) {`;
101
- c += `${cpp ? "double * " : "var"} rvalue`;
102
- // }}`;
103
- c += `
104
- ${
105
- this.global &&
106
- get_all_declarations().map((i) => {
107
- if (!i.trim()) return "";
108
- return "/* DECL */ const " + i;
109
- })
110
- }
111
- ${VERBOSE_DEBUG ? ++nesting : ""};
112
- const max = ${i[1]};
113
- while (i < max) {
114
- Object element = array[i];
115
- `;
116
- if (javascript) {
117
- c += `const style = element.style`;
118
- }
119
- c += ` ${
120
- VERBOSE_DEBUG
121
- ? 'puts(" ".repeat((nesting - 1) * 4) + `....Iteration ${i} i=` + [i, "/", max, " (", Math.round(i/max*100, 2), "%", ") +", 1.0/max*100, "%", " of loop completed"].join(""))'
122
- : ""
123
- }
124
- const condition = ${cond};
125
- if (condition) {
126
- using namespace std;
127
- ${one.slice(0, one.length - 1).join("\n\t\t\t\t")}
128
- //{one.slice(one.length - 1)
129
- rvalue = ${
130
- cpp ? "*(double**)(size_t)(size_t*)&(" : ""
131
- }${(last = one[one.length - 1]).substr(
132
- 0,
133
- last.length - 1
134
- )}${cpp ? ")" : ""};
135
- } else {`;
136
- if (javascript) {
137
- c += "try { ";
138
- }
139
- c += `
140
- rvalue = ${func}_otherwise(${cpp ? "&(" : "["}element${
141
- cpp ? ")" : "]"
142
- }, 0);
143
- `;
144
- if (javascript)
145
- c += `
146
- } catch (e) {}`;
147
- c;
148
- c += ` } ++i; } `;
149
- if (VERBOSE_DEBUG && javascript)
150
- c += `
151
- puts("Loop comp");
152
- --nesting;`;
153
- c += `
154
- return rvalue;
155
- }
156
- `;
157
- if (cpp) {
158
- c += `#endif` + "\n";
159
- }
160
- {
161
- }
162
- function remove_sides(a, first, last) {
163
- if (a.startsWith(first)) a = a.slice(first.length, a.length);
164
- if (a.endsWith(last)) {
165
- a = a.slice(0, a.length - last.length);
166
- }
167
- return a;
168
- }
169
-
170
- /* String.prototype.gsub = function*/
171
-
172
- if (!func.endsWith("otherwise")) {
173
- d = main_func;
174
- if (cpp) {
175
- try {
176
- array = mod(JSON.parse(array));
177
- } catch (e) {
178
- console.warn(e);
179
- process.exit();
180
- }
181
- d += "return \n";
182
-
183
- d += `${func}(\n${array},\n${i[0]}\n);`;
184
- }
185
- main_func = d;
186
- }
187
- function to_s(e) {
188
- return e;
189
- }
190
- };
191
- args = "";
192
- try {
193
- args = process.argv.slice(2).join(",,");
194
- } catch (_) {
195
- args = [...arguments].join(",,");
196
- }
197
- if (!args) {
198
- puts("Added m function and env function");
199
- return;
200
- }
201
- args = args.split(",,");
202
- for (var i = 0; i < args.length; ) {
203
- s = args.slice(i, i + 4);
204
- if (s[0].match(/otherwise$/)) {
205
- s = [s[0], [true], true, s[1]];
206
- i += 2;
207
- } else {
208
- i += 4;
209
- }
210
- m(...s);
211
- foo(s[0], c);
212
- all_code += c;
213
- }
214
- all_code += `
215
- function ${(prog_name = "e" + Date.now())}_main() {
216
- ${main_func}
217
- }`;
218
- if (cpp)
219
- all_code = cpp_pre_code() + all_code + `\n\n\nint main(int argc, char ** argv , char ** envp) { main_( argc, argv, envp); }`;
220
- else all_code += "\n" + prog_name + "_main();";
221
- foo("all_code", all_code);
222
- if (javascript) {
223
- try {
224
- eval(all_code);
225
- } catch (e) {
226
- console.warn(e);
227
- }
228
- }
229
- function foo(func, code) {
230
- const out = `${func}.${process.mode}`;
231
- try {
232
- require("fs").writeFileSync(out, code);
233
- } catch (_) {
234
- console.log(_);
235
- var saveData = (function () {
236
- var a = document.createElement("a");
237
- document.body.appendChild(a);
238
- a.style = "display: none";
239
- return function (data, fileName) {
240
- var json = data,
241
- blob = new Blob([json], { type: "octet/stream" }),
242
- url = window.URL.createObjectURL(blob);
243
- a.href = url;
244
- a.download = fileName;
245
- a.click();
246
- window.URL.revokeObjectURL(url);
247
- };
248
- })();
249
- saveData(code, out);
250
- }
251
- }
252
- return true;
253
- }
254
-
255
- env("mode", "js", 1) && m() && env("mode", "cpp", 1) && m();
256
- function env(a, b, mode) {
257
- var n = this.global || window;
258
- n.process = n.process || { env: { DEBUG: "true", DECLS: "" } };
259
-
260
- if (!mode) {
261
- process.env.DECLS += `${a}=${b},,`;
262
- } else {
263
- process[a] = b;
264
- }
265
- return true;
266
- }
267
- function help() {
268
- console.table(`m() (Browser console and node) -> generates a list of all arguments (or strings separted by double commas)
269
- Functions are run sequentially. Otherwise functions are not run.
270
- All functions loop over something
271
- All functions have a conditional.
272
- func_name iterable (such as a list or a DOMElement) condition expression
273
- The resultant function returns the last expression in the function
274
- This isn't a DSL, it's extremely broad.
275
- Any algorithm can be expressed this way.
276
- This makes writing algorithms much, much easier.
277
- It works in Node.js and in the browser.
278
- After generating all functions, the resultant code gets downloaded.
279
- `);
280
- }
281
-
282
- //functin cpp
283
-
284
- function cpp_code() {
285
- return (cpp_code =
286
- `
287
- #include <cstddef>
288
- #include <iostream>
289
- #include <vector>
290
- #include <sstream>
291
- #include <cstring>
292
- #include <map>
293
-
294
- //namespace {
295
- enum {
296
- INT,
297
- DOUBLE,
298
- STRING,
299
- VECTOR,
300
- MAP,
301
-
302
- NEEDS_FREEING,
303
- NEEDS_DELETING,
304
- NEEDS_DELETING_ARRAY
305
- };
306
-
307
- //#define c construct
308
-
309
- class Object {
310
- public:
311
- double type;
312
- double value;
313
-
314
-
315
- ~Object() {
316
- union { char* v;
317
- double d;
318
- } un;
319
- un.d = value;
320
-
321
- switch ((size_t)type) {
322
- case NEEDS_FREEING:
323
- std::cout << "Freeing " << (std::string)(*this) << "\\n";
324
- free(*un.v);
325
- delete un.v;
326
- break;
327
- case NEEDS_DELETING_ARRAY:
328
- delete [] un.v;
329
- delete ptr;
330
- break;
331
- case NEEDS_DELETING:
332
- delete *un.v;
333
- delete un.v;
334
- break;
335
- }
336
- };
337
-
338
- operator const std::string() const;
339
-
340
-
341
- const Object& print() const;
342
-
343
-
344
- bool operator < (Object a) const {
345
- return (const std::string)(*this) < (const std::string)(a);
346
- };
347
-
348
- };
349
-
350
-
351
-
352
-
353
-
354
- template <class A>
355
- class Array_sub : public std::vector<A>
356
- {
357
- public:
358
- Array_sub(std::initializer_list<A> a) : std::vector<A>{a}
359
- {}
360
-
361
- inline void push(const A value) {
362
- std::vector<A>::emplace_back(value);
363
- }
364
-
365
-
366
-
367
-
368
- inline Array_sub<A>& operator<< (A v) {
369
- push(v);
370
- return *this;
371
- }
372
-
373
- inline const auto surround(const char* first, const char* second) const {
374
-
375
- typedef Array_sub<A> Array;
376
- Array b{};
377
- std::cout << "Start of loops\\n";
378
- for (size_t i = 0; i < this->size(); ++i) {
379
- std::string s{first};
380
- s+= (std::string)((*this)[i]);
381
- s += second;
382
-
383
- b.emplace_back(construct_needs_freeing(strdup(s.c_str())));
384
- std::cout << "Loop number " << i << std::endl;
385
- }
386
- std::cout << "End of loops\\n";
387
- return b;
388
- }
389
-
390
- inline auto js() {
391
- return surround("<script type='text/javascript'>", "</script>");
392
- }
393
-
394
- inline const auto construct_needs_freeing(const char* const a) const {
395
- union {
396
- const char* c;
397
- double d;
398
- } u;
399
-
400
- u.c = a;
401
-
402
- return *new Object{NEEDS_FREEING, u.d};
403
- }
404
-
405
-
406
-
407
-
408
- operator const std::string() const {
409
- return to_s();
410
- }
411
-
412
- inline auto append(const char* arg1) const {
413
- return surround(nullptr, arg1);
414
- }
415
-
416
-
417
- inline auto prepend(const char* arg1) const {
418
- return surround(nullptr, arg1);
419
- }
420
-
421
- inline auto quote() const {
422
- return surround("'", "'");
423
- }
424
-
425
- inline auto join(const char* delim) const {
426
- std::string result;
427
- const auto length=this->size();
428
- for (size_t i = 0; i < length; ++i) {
429
- result += (*this)[i];
430
- if (i==length-1) {
431
- } else {
432
- result += delim;
433
- }
434
- }
435
-
436
- return result;
437
- }
438
-
439
- inline auto html(const char* title) const {
440
- std::string site_content;
441
- site_content += "Content-type: text/html\\r\\n\\r\\n<!DOCTYPE html><html><head><title>";
442
- site_content += title;
443
- site_content += "</title></head>";
444
- site_content += "<body>";
445
- //this->surround("<p>", "</p>");
446
- site_content += this->surround("<p>", "</p>");
447
- site_content += "</body></html>";
448
- return site_content;
449
- }
450
-
451
- inline auto p() const {
452
- return surround("<p>", "</p>");
453
- }
454
-
455
- inline auto div() const {
456
- return surround("<div>", "</div>");
457
- }
458
-
459
- inline auto nls() const {
460
- return surround(nullptr, "\\n");
461
- }
462
-
463
-
464
-
465
- const std::string to_s() const {
466
- std::ostringstream str;
467
- str << '[';
468
- for (size_t i = 0; i < this->size(); ++i) {
469
- str << (std::string)((*this)[i]);
470
-
471
- if (i == this->size() - 1) {
472
- } else {
473
- str << ", ";
474
- }
475
- }
476
- str << ']';
477
-
478
-
479
-
480
- return str.str();
481
-
482
- }
483
- };
484
- typedef Array_sub<Object> Array;
485
-
486
-
487
- union Object_v {
488
- double d;
489
- const void* v;
490
- long long int long_long;
491
-
492
- const std::map<Object, Object>* map;
493
- //const char* string;
494
- const Array* array; /*/const ch
495
- const cha*/
496
- const char* string;
497
- };
498
-
499
-
500
- Object::operator const std::string() const {
501
- Object_v val_;
502
-
503
- val_.d = this->value;
504
-
505
- switch ((size_t)this->type) {
506
- case STRING:
507
- return val_.string;
508
- case NEEDS_DELETING:
509
- return "[needs_deleting]";
510
- case NEEDS_FREEING:return val_.string;
511
- // return std::string(val_.string) + ";
512
- case NEEDS_DELETING_ARRAY: return "[needs_deleting_array]";
513
- case INT:
514
- return std::to_string((long long int)val_.long_long );
515
- case DOUBLE:
516
- return std::to_string(val_.d);
517
- case VECTOR:
518
- return val_.array->to_s();
519
- case MAP:
520
- std::string map_str = "{";
521
- // std::map<A,
522
-
523
- //auto& map = val_->map;
524
- for (const auto i : *val_.map) {
525
- map_str += (std::string)(i.first);
526
- map_str += ": ";
527
-
528
- map_str += (std::string)(i.second);
529
-
530
- map_str += ", ";
531
- }
532
- // map_str[map_str.size() =
533
- if (map_str.size () ) {
534
- map_str[map_str.size() - 2] = '}';
535
- map_str.resize(map_str.size() - 1);
536
- }
537
-
538
- // std::cout << map_str;
539
-
540
- return map_str;
541
- }
542
-
543
- return "Error string";
544
- };
545
-
546
- const Object& Object::print() const {
547
- std::cout << (std::string)(*this) << "<br/>";
548
- return *this;
549
- }
550
- Object construct(const long long int a) { union Object_v un; un.long_long = a; return Object {0, un.d}; }
551
- Object construct(const std::map<Object, Object> && a) {Object_v un; un.map = &a; return Object{4, un.d}; }
552
-
553
- Object construct(Array && a ) {Object_v q; q.array = &a; return Object{3, q.d}; }
554
- Object operator ""_c(unsigned long long a) {
555
- return construct(a);
556
- }
557
-
558
- Object construct(const double a) {
559
- return Object{1, a};
560
-
561
- }
562
-
563
-
564
- Object construct(const char* a) {
565
- union {
566
- double d;
567
- const void* v; } b;
568
- b.v = a;
569
-
570
- return Object{2, b.d};
571
- }
572
-
573
-
574
-
575
- ` + additional_cpp_code()); //moremore+more_cpp_code();
576
- }
577
- function nums(a) {
578
- if (typeof a != "number") return mod(a);
579
-
580
- //while (1) console.log(a)
581
- if (a.toString().includes(".")) {
582
- return surround(a);
583
- } else {
584
- return surround(a + "ll");
585
- }
586
- }
587
-
588
- function cpp_pre_code() {
589
- return cpp_code();
590
- }
591
- function set_kv(kv) {
592
- for (var i_ of [0, 1]) kv[i_] = nums(kv[i_]);
593
-
594
- //}
595
-
596
- //}
597
- }
598
-
599
- function surround(a) {
600
- return "construct(" + a + ")";
601
- }
602
- function mod(array, a = 0) {
603
- if (typeof array == "string") {
604
- return surround(JSON.stringify(array));
605
- }
606
- a = a + 1;
607
- if (a == 1) {
608
- var str = " Array{";
609
- } else var str = "";
610
- var element = false;
611
-
612
- try {
613
- // let str = "";
614
- if (typeof array == "object" && array.length === undefined) {
615
- str = "construct(" + "\n" + "\t".repeat(a) + " std::map<Object, Object >{";
616
- // var element
617
- var a = 0;
618
- console.log(array);
619
- // fs.writeFileSync("args/" +
620
- const s = JSON.stringify;
621
- for (var i in array) {
622
- var kv = [i, array[i]];
623
- element = true;
624
- set_kv(kv);
625
- const t = " Object ";
626
- const pair = "std::pair<" + t + "," + t + ">";
627
- str += pair + "(" + kv.join(",") + ")";
628
-
629
- str += ", ";
630
- }
631
- str = str.replace(/, $/, "}" + ") , /* end of map */"); //";
632
- } else if (array.length === undefined) {
633
- array = ["", array];
634
- set_kv(array);
635
- return array[1];
636
- } else
637
- for (var i of array) {
638
- // if (a ==
639
- if (typeof i != "number") {
640
- if (typeof i == "object" && i.join === undefined) {
641
- str += mod(i, a);
642
- } else if (typeof i == "string") {
643
- const SEPARATOR = ",";
644
- str +=
645
- "construct(" + JSON.stringify(i) + ") /* string literal */" + SEPARATOR;
646
- } else {
647
- str +=
648
- "\t".repeat(a) +
649
- "construct(" +
650
- "Array" +
651
- "{" +
652
- "\n" +
653
- "\t".repeat(a) +
654
- mod(i, a) +
655
- "\t".repeat(a - 1) +
656
- "}" +
657
- ")" +
658
- ",\n";
659
- }
660
- } else {
661
- const value = ["", i];
662
- set_kv(value);
663
- str += value[1] + ", ";
664
- }
665
- }
666
-
667
- if (a == 1) str += "}";
668
- //str = str.slice(0, s
669
-
670
- return str.replace(/, $/, "");
671
- } catch (e) {
672
- console.warn(e);
673
- process.exit(1);
674
- }
675
- }
676
-
677
- //#include <iostream>
678
-
679
- function additional_cpp_code() {
680
- return `
681
- #include \"fcgio.h\"
682
- using namespace std;
683
- #define endl "<br />"
684
- static inline void* ${prog_name}_main ();
685
- static int mmain();
686
-
687
- int
688
- main_
689
- (
690
- int argc, char** argv, char** envp)
691
- {
692
- (void)envp;
693
- Array args{};
694
- for (int i = 0; i < argc; ++i)
695
- args << construct(argv[i]);
696
- //auto content = (string)args.html("Title"); //cout << c
697
- auto content=std::string{};
698
- cout << Array{construct(1ll)}.html("Hello");
699
- //cout << content;
700
-
701
-
702
- const auto server=0;
703
-
704
- if (server) {
705
- // Backup the stdio streambufs
706
- streambuf * cin_streambuf = cin.rdbuf();
707
- streambuf * cout_streambuf = cout.rdbuf();
708
- streambuf * cerr_streambuf = cerr.rdbuf();
709
-
710
- FCGX_Request request;
711
-
712
- FCGX_Init();
713
- /*
714
- *
715
- *
716
- *
717
- * The above function seems to memory leak 1 block of 768 bytes. It never deletes it at exit.
718
- *
719
- *
720
- *
721
- */
722
- FCGX_InitRequest(&request, 0, 0);
723
-
724
- while (FCGX_Accept_r(&request) == 0) {
725
- fcgi_streambuf cin_fcgi_streambuf(request.in);
726
- fcgi_streambuf cout_fcgi_streambuf(request.out);
727
- fcgi_streambuf cerr_fcgi_streambuf(request.err);
728
-
729
- cin.rdbuf(&cin_fcgi_streambuf);
730
- cout.rdbuf(&cout_fcgi_streambuf);
731
- cerr.rdbuf(&cerr_fcgi_streambuf);
732
-
733
- cout << content;
734
-
735
- // system(\"echo 5 > /root/six\");
736
- mmain();
737
- cout << "Where?";
738
- // system(\"echo 6\");
739
-
740
- // Note: the fcgi_streambuf destructor will auto flush
741
- }
742
-
743
- // restore stdio streambufs
744
- cin.rdbuf(cin_streambuf);
745
- cout.rdbuf(cout_streambuf);
746
- cerr.rdbuf(cerr_streambuf);
747
- }
748
-
749
- ${prog_name}_main();
750
-
751
- return 0;
752
- }
753
-
754
-
755
- static int mmain()
756
- {
757
- std::string command(\"ls * 2>&1\");
758
-
759
- char buffer[4096];
760
- std::string result;
761
-
762
- // std::cout << "Opening reading pipe"
763
- FILE* pipe = popen(command.c_str(), \"r\");
764
- if (!pipe)
765
- {
766
- std::cerr << \"Couldn't start command.\" << endl;
767
- return 0;
768
- }
769
- while (fgets(buffer, sizeof(buffer), pipe) != NULL) {
770
- //std::cout << \"Reading...\" << std::endl;
771
- result += buffer;
772
- }
773
- auto returnCode = pclose(pipe);
774
-
775
- std::cout << result << endl;
776
- std::cout << returnCode << endl;
777
-
778
- // ${prog_name}_main();
779
-
780
- ${prog_name}_main ();
781
- return 0;
782
- }
783
- `;
784
- }