!7 static new ThreadLocal youtubeOff; static int perPage = 20; sS rawSelfLink(S uri) { ret "/blog" + addSlashPrefix(uri); } html { S vis = registerVisitor(); S domain = domain(); print("domain: " + domain); if (swic(domain, "javax.")) { pcall { O result = callHtmlMethod2(getBot(#1020398), uri, params); print("Result: " + className(result)); ret result; } } /*if (startsWith(uri, "/.well-known/pki-validation/")) ret subBot_serveText(loadTextFile(userDir("validation.txt")));*/ tempSetThreadLocal(youtubeOff, eq("1", params.get('youtubeOff)) || eqOneOf(params.get('youtube), "0", "off", "no")); O[] linkStyle = litobjectarray("style", "color: inherit; text-decoration: underline"); uri = dropPrefix("/", uri); int page = startsWithDigit(uri) ? parseFirstInt(uri) : 1; LS allPosts = ll( imagePost("2019/04/04", "Whenever my language bores me", #1101627, "40%", p("...I shorten it. Let's say I want to make a big input field with full persistence and switchable font size (like you see on the right). Then I write " + ahref("http://tinybrain.de/1022742", "this") + ":") + [[
cmodule BigInput {
  S text; // auto-persisted string field
  switchable int fontSize = 40;
  visual setFontSize(fontSize, dm_textArea('text));
}
]] + p("(I just created the 2 new JavaX syntax constructs " + ahref("http://tinybrain.de/1022743", "'switchable'") + " and " + ahref("http://tinybrain.de/1022746", "'visual'") + " in like 10 minutes. Hover over the source code for more info.) —" + ahref("http://botcompany.de/1004590/raw/1101628", "Automatic popup menu.")) ), imagePost("2018/06/16", "New Look&Feel", #1016391, "30%", p([[Pretty, isn't it. Look&Feel is called ]] + ahref("http://jtattoo.net", "JTattoo") + [[.]]) + p([[Image was made with the automatic screenshot module on a very old Windows 7 machine where my OS runs flawlessly.]]), left := true) , textPost("2018/06/15", "Fixing the last memory leaks in Java 10", [[

I submitted this bug report to Oracle, and I'm making super-fancy functions like cleanDefunctACCsInAllThreads that automatically fix memory leaks other Java programmers have never heard of.

We will sail memory leak-free! :)

]]) + [[

New Module: YouTube Downloader

Today we launched bla bla bla.

 

(No, seriously—we actually did. There is an awesome YouTube downloader in my operating system. I'm just too lazy to write.)

Now I need an awesome screenshot module and an awesome auto-upload-to-blog module.

]]); // end of posts LS posts = subList(allPosts, (page-1)*perPage, page*perPage); bool hasPrev = page > 1, hasNext = l(allPosts) > page*perPage; S nav = !hasNext && !hasPrev ? "" : hsection(joinNempties(" | ", hasPrev ? ahref(rawSelfLink(str(page-1)), "Last page") : "", ahref("http://javax.botcompany.de/1020398/raw/contact", "Imprint"), hasNext ? ahref(rawSelfLink(str(page+1)), "Next page") : ""), class := "post", style := "text-align: right"); S html = [[ BotCompany.de ]] + hcss(loadSnippet_cached(#1008309)) + [[]] + [[]] + [[
]] + hcss([[ pre { margin-left: 20px; font-weight: bold; } ]]) + nav + lines(posts) + nav + [[
]]; ret html.replace("\"css/layouts/blog.css\"", htmlQuote(rawSnippetURL(#1016322, "text/css"))) .replaceFirst(regexpQuote(""), "" + hSilentComputatorWithFlag("homepage")); } sS textPost(S date, S title, S text) { ret invtag('section, class := "post", style := "clear: both", invtag('header, class := "post-header", invtag('img, width := 48, height := 48, title := "Stefan Reich's avatar", class := "post-avatar", src := snippetImgLink(#1101324)) + [[

]] + title + [[

By @ ]] + date + [[

]]) + [[
]] + text + [[
]]); } sS imagePost(S date, S title, S imageID, S width, S text, O... opt) { bool left = optParam(opt, 'left, false); S picLink = stringParam(opt, 'picLink); ret textPost(date, title, invtag('div, style := "float: " + (left ? "left" : "right") + "; width: " + width + "; margin-bottom: 30px; margin-" + (left ? "right" : "left") + ": 30px;", ahref(or2(picLink, snippetImageLink(imageID)), invTag('img, title := "", class := "pure-img-responsive", src := snippetImageLink(imageID), style := "width: 100%"))) + text); } sS youtubi(S url) { ret isTrue(youtubeOff!) ? "" : youtubeEmbed_newer(url); } sS youtubi(S url, int width) { ret isTrue(youtubeOff!) ? "" : youtubeEmbed_newer(url, width); } sS youtubi(S url, int width, int height) { ret isTrue(youtubeOff!) ? "" : youtubeEmbed_newer(url, width, height); }