Download Jar. Libraryless. Click here for Pure Java version (15648L/113K).
1 | !7 |
2 | |
3 | static TimedCache<Map<Long, S>> cache_snippetTitles = TimedCache(600.0, f allSnippetTitlesFromLocalSnippetsDB); |
4 | static TimedCache<SS> cache_stdFunctions = TimedCache(60.0, f stdFunctions_uncached); |
5 | static TimedCache<S> content_functions_cache = new(60.0, f content_functions); |
6 | static TimedCache<S> content_modules_cache = new(60.0, f content_modules); |
7 | |
8 | sS content_contact() { |
9 | ret h2("Impressum / Imprint / Contact") |
10 | + pre([[ |
11 | Stefan Reich |
12 | Dubenhorst 27 |
13 | 25474 Ellerbek |
14 | Germany |
15 | |
16 | info@botcompany.de |
17 | 0176/2412 4614 |
18 | ]]); |
19 | } |
20 | |
21 | sS content_functions() { |
22 | Map<Long, S> titles = cache_snippetTitles!; |
23 | new L<Map> l2; |
24 | SS map = cache_stdFunctions!; |
25 | for (S name : sortedIC(keys(map))) { |
26 | S id = map.get(name); |
27 | S title = titles.get(psI(id)); |
28 | title = emptyIfSame(name, dropPrefix(name + " - ", title)); |
29 | l2.add(litorderedmap("Function Name" := ahref(progLink(id), htmlencode2(name)), "Description" := htmlencode2(title))); |
30 | } |
31 | |
32 | ret h2("JAVAX STANDARD FUNCTIONS (COUNT: " + l(l2) + ")") |
33 | + htable(l2, false); |
34 | } |
35 | |
36 | sS content_modules() { |
37 | L<RecommendedModule> l = stefansOS_recommendedModules(); |
38 | //l = sortByFieldIC('name, l); |
39 | L<Map> l2 = map(l, func(RecommendedModule m) -> Map { |
40 | S name = dropSuffixICTrimOneOf(m.name, "[Dyn Module]", "[Dyn Module, OK]", "[Dyn Module, shortened]", "[OK]"); |
41 | ret litorderedmap( |
42 | "Module" := ahref(progLink(m.moduleID), htmlencode2(name)), |
43 | "Lines of Code" := str(numberOfLinesInFile(snippetDB_textFile(m.moduleID))), |
44 | "ID" := ahref(progLink(m.moduleID), m.moduleID)); |
45 | }); |
46 | l2 = sortedByMapElement_alphaNum("Lines of Code", l2); |
47 | |
48 | ret h2("PUBLIC MODULES FOR STEFAN'S OS (COUNT: " + l(l2) + ")") |
49 | + htable(l2, false); |
50 | } |
51 | |
52 | sS content_javax() { |
53 | ret [[ |
54 | <h2>THE IDEA</h2> |
55 | <p> |
56 | <b>Today we program computers in a way that is hard</b>—hard to learn, hard to maintain, complex and error-prone. |
57 | </p> |
58 | |
59 | <p> |
60 | <b>I propose to talk to computers in English instead</b>. |
61 | </p> |
62 | |
63 | <p> |
64 | Later, obviously, "English" will also mean "any language in the world". |
65 | </p> |
66 | |
67 | <h2>THE PROCESS: STEP 1</h2> |
68 | <p> |
69 | Our basis is a suitable, well-developed, existing programming language: <b>Java</b>. |
70 | </p> |
71 | |
72 | <p> |
73 | On top of Java, we build a simpler language which is much <b>easier to learn</b> and much <b>closer to English</b> already. |
74 | I call this <b>JavaX</b>. |
75 | <p> |
76 | Here is a simple example of <b>working JavaX code</b>: |
77 | </p> |
78 | |
79 | <pre> |
80 | showImage(singleImageFromWebcam()); |
81 | </pre> |
82 | |
83 | <p> |
84 | This single line finds the webcam, loads appropriate libraries, grabs an image and shows it to you in a window. Simple as that. |
85 | And we have ]] + ahref(rawSelfLink("functions"), "13,000 more functions") + [[ like that. |
86 | </p> |
87 | |
88 | <p> |
89 | In general, in JavaX you write 20 lines of code where users of other languages literally need 500. ]] + ahref(rawSelfLink("modules"), "See example source codes.") + [[ |
90 | </p> |
91 | |
92 | <h2>THE PROCESS: STEP 2</h2> |
93 | |
94 | <p> |
95 | <b>Using JavaX</b>, we now <b>build speech processing functions</b> so we can ultimately talk to the machine |
96 | all day in spoken or written language. |
97 | </p> |
98 | |
99 | <p>We will <b>express our thoughts, questions and instructions</b> as we would to a human, |
100 | and get proper responses from the machine. |
101 | </p> |
102 | |
103 | |
104 | <h2>WHAT YOU CAN DO TODAY</h2> |
105 | <p> |
106 | You can <b>run JavaX on your computer today</b> through a program called <b>"Stefan's OS"</b> which |
107 | is compatible with Windows, Linux and Mac OS. Download links <a href="https://www.botcompany.de"><b>here</b></a>. |
108 | </p> |
109 | <p> |
110 | All the code in it is <a href="http://code.botcompany.de">open source</a> (no secrets or spyware). |
111 | </p> |
112 | <p> |
113 | We have <a target="_blank" href="https://www.youtube.com/watch?v=JhBhqdpuFf8">first demos of a speech-only user interface</a> |
114 | which you can also try through the OS. |
115 | </p> |
116 | ]]; |
117 | } |
118 | |
119 | html { |
120 | S content, title = ""; |
121 | if (eq(uri, "/modules")) { |
122 | content = content_modules_cache!; |
123 | title = "Modules"; |
124 | } else if (eq(uri, "/functions")) { |
125 | content = content_functions_cache!; |
126 | title = "Functions"; |
127 | } else if (eq(uri, "/contact")) { |
128 | content = content_contact(); |
129 | title = "Contact"; |
130 | } else |
131 | content = content_javax(); |
132 | |
133 | S html = [[ |
134 | <!doctype html> |
135 | <html lang="en"> |
136 | <head> |
137 | <meta charset="utf-8"> |
138 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
139 | <meta name="description" content="JavaX is an extension of Java enabling super-short code and scripting language-like features."> |
140 | <title>JavaX ]] + appendSpaceIfNempty(title) + [[| BotCompany.de</title> |
141 | |
142 | <link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/pure-min.css" integrity="sha384-" crossorigin="anonymous"> |
143 | |
144 | <link rel="stylesheet" href="https://www.botcompany.de/serve/1020396?contentType=text/css"> |
145 | </head> |
146 | <body> |
147 | |
148 | |
149 | <div id="layout"> |
150 | <!-- Menu toggle --> |
151 | <a href="#menu" id="menuLink" class="menu-link"> |
152 | <!-- Hamburger icon --> |
153 | <span></span> |
154 | </a> |
155 | |
156 | <div id="menu"> |
157 | <div class="pure-menu"> |
158 | <a class="pure-menu-heading" href="https://www.botcompany.de">BotCompany</a> |
159 | |
160 | <ul class="pure-menu-list"> |
161 | ]] + navLink("http://javax.botcompany.de", "JavaX", true) |
162 | + navLink(rawSelfLink("modules"), "Modules", eq(uri, "/modules")) |
163 | + navLink(rawSelfLink("functions"), "Functions", eq(uri, "/functions")) |
164 | + navLink(rawSelfLink("contact"), "Contact", eq(uri, "/contact")) |
165 | + [[</ul> |
166 | </div> |
167 | </div> |
168 | |
169 | <div id="main"> |
170 | <div class="floating-image"> |
171 | <img src="http://botcompany.de/1004590/raw/1101464" title="The Ubiquitous Java Cup!"> |
172 | </div> |
173 | <div class="header"> |
174 | <h1><a href="]] + htmlencode(rawSelfLink()) + [[">JavaX:</a></h1> |
175 | <h2>The Next Generation of Programming</h2> |
176 | </div> |
177 | |
178 | <div class="content"> |
179 | ]] + content + [[ |
180 | </div> |
181 | </div> |
182 | </div> |
183 | |
184 | |
185 | <script src="https://www.botcompany.de/serve/1020397?contentType=text/javascript"></script> |
186 | |
187 | </body> |
188 | </html> |
189 | ]]; |
190 | ret subBot_cacheHeaders_minutes(1.0, subBot_serveHTML(html)); |
191 | } |
192 | |
193 | sS navLink(S link, S text, bool selected) { |
194 | ret (selected ? [[<li class="pure-menu-item menu-item-divided pure-menu-selected">]] : [[<li class="pure-menu-item">]]) |
195 | + ahref(link, text, class := "pure-menu-link") |
196 | + [[</li>]] + "\n"; |
197 | } |
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1020398 |
Snippet name: | New JavaX Homepage [LIVE at javax.botcompany.de] |
Eternal ID of this version: | #1020398/46 |
Text MD5: | 3cc48c44a1e18cacfe2e35fe381ec607 |
Transpilation MD5: | ac60284a4eb0cb238dc47b0685f70203 |
Author: | stefan |
Category: | javax / html |
Type: | JavaX module (desktop) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-11-03 14:15:33 |
Source code size: | 6700 bytes / 197 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 538 / 3095 |
Version history: | 45 change(s) |
Referenced in: | [show references] |