Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

197
LINES

< > BotCompany Repo | #1020398 // New JavaX Homepage [LIVE at javax.botcompany.de]

JavaX module (desktop) [tags: butter use-pretranspiled] - homepage

Download Jar. Libraryless. Click here for Pure Java version (15648L/113K).

!7

static TimedCache<Map<Long, S>> cache_snippetTitles = TimedCache(600.0, f allSnippetTitlesFromLocalSnippetsDB);
static TimedCache<SS> cache_stdFunctions = TimedCache(60.0, f stdFunctions_uncached);
static TimedCache<S> content_functions_cache = new(60.0, f content_functions);
static TimedCache<S> content_modules_cache = new(60.0, f content_modules);

sS content_contact() {
  ret h2("Impressum / Imprint / Contact")
    + pre([[
      Stefan Reich
      Dubenhorst 27
      25474 Ellerbek
      Germany
      
      info@botcompany.de
      0176/2412 4614
      ]]);
}

sS content_functions() {
  Map<Long, S> titles = cache_snippetTitles!;
  new L<Map> l2;
  SS map = cache_stdFunctions!;
  for (S name : sortedIC(keys(map))) {
    S id = map.get(name);
    S title = titles.get(psI(id));
    title = emptyIfSame(name, dropPrefix(name + " - ", title));
    l2.add(litorderedmap("Function Name" := ahref(progLink(id), htmlencode2(name)), "Description" := htmlencode2(title)));
  }

  ret h2("JAVAX STANDARD FUNCTIONS (COUNT: " + l(l2) + ")")
    + htable(l2, false);
}

sS content_modules() {
  L<RecommendedModule> l = stefansOS_recommendedModules();
  //l = sortByFieldIC('name, l);
  L<Map> l2 = map(l, func(RecommendedModule m) -> Map {
      S name = dropSuffixICTrimOneOf(m.name, "[Dyn Module]", "[Dyn Module, OK]", "[Dyn Module, shortened]", "[OK]");
      ret litorderedmap(
        "Module" := ahref(progLink(m.moduleID), htmlencode2(name)),
        "Lines of Code" := str(numberOfLinesInFile(snippetDB_textFile(m.moduleID))),
        "ID" := ahref(progLink(m.moduleID), m.moduleID));
    });
  l2 = sortedByMapElement_alphaNum("Lines of Code", l2);
    
  ret h2("PUBLIC MODULES FOR STEFAN'S OS (COUNT: " + l(l2) + ")")
    + htable(l2, false);
}

sS content_javax() {
  ret [[
  <h2>THE IDEA</h2>
  <p>
      <b>Today we program computers in a way that is hard</b>&mdash;hard to learn, hard to maintain, complex and error-prone.
  </p>
  
  <p>
      <b>I propose to talk to computers in English instead</b>.
  </p>
  
  <p>
      Later, obviously, "English" will also mean "any language in the world".
  </p>

  <h2>THE PROCESS: STEP 1</h2>
  <p>
      Our basis is a suitable, well-developed, existing programming language: <b>Java</b>.
  </p>
  
  <p>
      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.
      I call this <b>JavaX</b>.
  <p>
      Here is a simple example of <b>working JavaX code</b>:
  </p>
  
  <pre>
      showImage(singleImageFromWebcam());
  </pre>
  
  <p>
      This single line finds the webcam, loads appropriate libraries, grabs an image and shows it to you in a window. Simple as that.
      And we have ]] + ahref(rawSelfLink("functions"), "13,000 more functions") + [[ like that.
  </p>
  
  <p>
    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.") + [[
  </p>
  
  <h2>THE PROCESS: STEP 2</h2>
  
  <p>
      <b>Using JavaX</b>, we now <b>build speech processing functions</b> so we can ultimately talk to the machine
      all day in spoken or written language.
  </p>
  
  <p>We will <b>express our thoughts, questions and instructions</b> as we would to a human,
    and get proper responses from the machine. 
  </p>
  

  <h2>WHAT YOU CAN DO TODAY</h2>
  <p>
      You can <b>run JavaX on your computer today</b> through a program called <b>"Stefan's OS"</b> which
      is compatible with Windows, Linux and Mac OS. Download links <a href="https://www.botcompany.de"><b>here</b></a>.
  </p>
  <p>
      All the code in it is <a href="http://code.botcompany.de">open source</a> (no secrets or spyware).
  </p>
  <p>
      We have <a target="_blank" href="https://www.youtube.com/watch?v=JhBhqdpuFf8">first demos of a speech-only user interface</a>
        which you can also try through the OS.
  </p>
  ]];
}

html {
  S content, title = "";
  if (eq(uri, "/modules")) {
    content = content_modules_cache!;
    title = "Modules";
  } else if (eq(uri, "/functions")) {
    content = content_functions_cache!;
    title = "Functions";
  } else if (eq(uri, "/contact")) {
    content = content_contact();
    title = "Contact";
  } else
    content = content_javax();
  
  S html = [[
<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="JavaX is an extension of Java enabling super-short code and scripting language-like features.">
    <title>JavaX ]] + appendSpaceIfNempty(title) + [[| BotCompany.de</title>
    
    <link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/pure-min.css" integrity="sha384-" crossorigin="anonymous">
    
    <link rel="stylesheet" href="https://www.botcompany.de/serve/1020396?contentType=text/css">
</head>
<body>


<div id="layout">
    <!-- Menu toggle -->
    <a href="#menu" id="menuLink" class="menu-link">
        <!-- Hamburger icon -->
        <span></span>
    </a>

    <div id="menu">
        <div class="pure-menu">
            <a class="pure-menu-heading" href="https://www.botcompany.de">BotCompany</a>

            <ul class="pure-menu-list">
            ]] + navLink("http://javax.botcompany.de", "JavaX", true)
             + navLink(rawSelfLink("modules"), "Modules", eq(uri, "/modules"))
             + navLink(rawSelfLink("functions"), "Functions", eq(uri, "/functions"))
             + navLink(rawSelfLink("contact"), "Contact", eq(uri, "/contact"))
            + [[</ul>
        </div>
    </div>

    <div id="main">
        <div class="floating-image">
          <img src="http://botcompany.de/1004590/raw/1101464" title="The Ubiquitous Java Cup!">
        </div>
        <div class="header">
            <h1><a href="]] + htmlencode(rawSelfLink()) + [[">JavaX:</a></h1>
            <h2>The Next Generation of Programming</h2>
        </div>

        <div class="content">
        ]] + content + [[
        </div>
    </div>
</div>


<script src="https://www.botcompany.de/serve/1020397?contentType=text/javascript"></script>

</body>
</html>
]];
  ret subBot_cacheHeaders_minutes(1.0, subBot_serveHTML(html));
}

sS navLink(S link, S text, bool selected) {
  ret (selected ? [[<li class="pure-menu-item menu-item-divided pure-menu-selected">]] : [[<li class="pure-menu-item">]])
    + ahref(link, text, class := "pure-menu-link")
    + [[</li>]] + "\n";
}

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: 537 / 3094
Version history: 45 change(s)
Referenced in: #1016323 - Blog Bot [DOMAIN BOT]
#1022824 - Blog Bot with chat bot [dev.]