TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Particles – the URL contains the whole program code

58 点作者 chkas将近 3 年前

10 条评论

fastball将近 3 年前
Partly this is doable because although RFC 2616 (HTTP&#x2F;1.1) specifies a max URL length of 2048 bytes, all the major browsers will process URLs which are much longer, with Safari allowing URL strings <i>up to 2GB in size!</i>[1]<p>In 2021 probably one of the bigger blockers of giant URLs is CDNs, which impose various limits on URL size. e.g. Cloudflare limits URLs to 16kb.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;apple&#x2F;swift-corelibs-foundation&#x2F;blob&#x2F;b23dc8e249987442811e9e0097c326d7083784ac&#x2F;CoreFoundation&#x2F;URL.subproj&#x2F;CFURLComponents_URIParser.c#L708" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;apple&#x2F;swift-corelibs-foundation&#x2F;blob&#x2F;b23d...</a>
评论 #31885210 未加载
评论 #31909997 未加载
golf_mike将近 3 年前
What am I missing? the URL is just <a href="https:&#x2F;&#x2F;easylang.online&#x2F;run&#x2F;" rel="nofollow">https:&#x2F;&#x2F;easylang.online&#x2F;run&#x2F;</a><p>--edit-- ah its in the link, which then is not visible in the address bar anymore. Got it :)
评论 #31890576 未加载
reneberlin将近 3 年前
flems.io (lightweight online html, js,css editor) does this also. i was very impressed, when i first encountered this. Everything is encoded in the url to share.<p><a href="https:&#x2F;&#x2F;flems.io&#x2F;#0=N4IgzgpgNhDGAuEAmIBcIB0ALeBbKIANCAGYCWMYaA2qAHYCGuEamO+RIsA9nYn6wA8WAIwA+ADp0ABNKzQo3aQHduAJyhIAhFMEB6UWM6QYCMryroATKgCsIAL6F6TFugwArKsR58IA9EdnEEZmVgxYMG8uXn54VkcAXQcgA" rel="nofollow">https:&#x2F;&#x2F;flems.io&#x2F;#0=N4IgzgpgNhDGAuEAmIBcIB0ALeBbKIANCAGYCWMY...</a><p>cryptpad does the same, i read yesterday. <a href="https:&#x2F;&#x2F;cryptpad.fr&#x2F;" rel="nofollow">https:&#x2F;&#x2F;cryptpad.fr&#x2F;</a>
评论 #31885421 未加载
评论 #31884915 未加载
Natfan将近 3 年前
In case anybody would like to view the source, see below (via PowerShell[0]):<p><pre><code> $Post = Invoke-WebRequest -URI &quot;https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31883209&quot; -UseBasicParsing $Link = $Post.Links.Where{$_.href -like &quot;https:&#x2F;&#x2F;easylang.online&#x2F;run&#x2F;?code=*&quot;}.href $EncodedCode = $Link -replace &quot;https:&#x2F;&#x2F;easylang.online&#x2F;run&#x2F;\?code=(.+)&quot;,&#x27;$1&#x27; $Code = [Web.HTTPUtility]::URLDecode($EncodedCode) Write-Output $Code </code></pre> [0]: <a href="https:&#x2F;&#x2F;github.com&#x2F;PowerShell&#x2F;PowerShell" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;PowerShell&#x2F;PowerShell</a>, note that Windows PowerShell 5.x is installed on most Windows systems by default.
评论 #31888204 未加载
jansan将近 3 年前
THe URL is 1548 character long, which is below the &quot;safe&quot; length limit for URLs of 2058 characters. With Internet Explorer gone, URLs of up to 8192 chars length should work on all browsers.<p><a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;417142&#x2F;what-is-the-maximum-length-of-a-url-in-different-browsers" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;417142&#x2F;what-is-the-maxim...</a>
memalign将近 3 年前
Here’s a list of example programs:<p><a href="https:&#x2F;&#x2F;easylang.online&#x2F;run&#x2F;list.html" rel="nofollow">https:&#x2F;&#x2F;easylang.online&#x2F;run&#x2F;list.html</a><p>Also reminds me of this:<p><a href="https:&#x2F;&#x2F;viz.intelligence.rocks&#x2F;" rel="nofollow">https:&#x2F;&#x2F;viz.intelligence.rocks&#x2F;</a>
rambambram将近 3 年前
Wow, very friendly and welcoming UI&#x2F;UX that quickly makes me try out stuff. It looks simple but the flow is very polished. Good job! P.S. Do you have more plans for this app? I see there&#x27;s tutorials on programming.
评论 #31886511 未加载
mkoryak将近 3 年前
Cool, but why are the variables named like you are trying to conserve memory? I understand `dx` and `dy`, but `thres` and `n_part` ?
评论 #31886958 未加载
cmp2tio将近 3 年前
How is this different from Try It Online <a href="https:&#x2F;&#x2F;tio.run" rel="nofollow">https:&#x2F;&#x2F;tio.run</a> ?
评论 #31886891 未加载
chkas将近 3 年前
Another demo:<p><a href="https:&#x2F;&#x2F;easylang.online&#x2F;run&#x2F;?code=%23%20Mastermind%3Aw90%0A%23%20%0Acol%5B%5D%20%3D%20%5B%20802%20990%20171%20229%20950%20808%20%5D%0Alen%20code%5B%5D%204%0Alen%20guess%5B%5D%204%0A%23%20%0Asubr%20init_vars%0A%20%20row%20%3D%207%0A.%0Afunc%20draw_rate%20r%20black%20white%20.%20.%0A%20%20for%20j%20range%202%0A%20%20%20%20for%20c%20range%202%0A%20%20%20%20%20%20move%20c%20*%203.5%20%2B%2071.5%20r%20*%2011.5%20%2B%2010.4%20%2B%20j%20*%203.5%0A%20%20%20%20%20%20if%20black%20%3E%200%0A%20%20%20%20%20%20%20%20color%20000%0A%20%20%20%20%20%20%20%20circle%201.4%0A%20%20%20%20%20%20%20%20black%20-%3D%201%0A%20%20%20%20%20%20elif%20white%20%3E%200%0A%20%20%20%20%20%20%20%20color%20999%0A%20%20%20%20%20%20%20%20circle%201.4%0A%20%20%20%20%20%20%20%20white%20-%3D%201%0A%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20color%20310%0A%20%20%20%20%20%20%20%20circle%200.7%0A%20%20%20%20%20%20.%0A%20%20%20%20.%0A%20%20.%0A.%0Afunc%20show_code%20.%20.%0A%20%20color%20531%0A%20%20move%2022%200%0A%20%20rect%2046%208%0A%20%20for%20i%20range%204%0A%20%20%20%20move%20i%20*%208%20%2B%2028%203%0A%20%20%20%20color%20col%5Bcode%5Bi%5D%5D%0A%20%20%20%20circle%202%0A%20%20.%0A.%0Afunc%20draw_guess%20.%20.%0A%20%20for%20c%20range%204%0A%20%20%20%20move%20c%20*%2012%20%2B%2020%20row%20*%2011.5%20%2B%2012%0A%20%20%20%20color%20col%5Bguess%5Bc%5D%5D%0A%20%20%20%20circle%203.8%0A%20%20.%0A.%0Afunc%20next_row%20.%20.%0A%20%20color%20420%0A%20%20linewidth%2011%0A%20%20move%2017%20row%20*%2011.5%20%2B%2012%0A%20%20line%2060%20row%20*%2011.5%20%2B%2012%0A%20%20call%20draw_guess%0A%20%20move%2073.5%20row%20*%2011.5%20%2B%2012%0A%20%20color%20310%0A%20%20circle%205.0%0A%20%20color%20753%0A%20%20move%2071.5%20row%20*%2011.5%20%2B%208.5%0A%20%20textsize%207%0A%20%20text%20%22%E2%9C%93%22%0A.%0Afunc%20rate%20.%20.%0A%20%20move%2073.5%20row%20*%2011.5%20%2B%2012%0A%20%20color%20531%0A%20%20circle%205.2%0A%20%20c%5B%5D%20%3D%20code%5B%5D%0A%20%20g%5B%5D%20%3D%20guess%5B%5D%0A%20%20for%20i%20range%204%0A%20%20%20%20if%20c%5Bi%5D%20%3D%20g%5Bi%5D%0A%20%20%20%20%20%20black%20%2B%3D%201%0A%20%20%20%20%20%20c%5Bi%5D%20%3D%20-1%0A%20%20%20%20%20%20g%5Bi%5D%20%3D%20-2%0A%20%20%20%20.%0A%20%20.%0A%20%20for%20i%20range%204%0A%20%20%20%20for%20j%20range%204%0A%20%20%20%20%20%20if%20c%5Bi%5D%20%3D%20g%5Bj%5D%0A%20%20%20%20%20%20%20%20white%20%2B%3D%201%0A%20%20%20%20%20%20%20%20c%5Bi%5D%20%3D%20-1%0A%20%20%20%20%20%20%20%20g%5Bj%5D%20%3D%20-2%0A%20%20%20%20%20%20.%0A%20%20%20%20.%0A%20%20.%0A%20%20call%20draw_rate%20row%20black%20white%0A%20%20color%20531%0A%20%20linewidth%2012%0A%20%20move%2017%20row%20*%2011.5%20%2B%2012%0A%20%20line%2060%20row%20*%2011.5%20%2B%2012%0A%20%20call%20draw_guess%0A%20%20row%20-%3D%201%0A%20%20if%20black%20%3D%204%0A%20%20%20%20row%20%3D%20-1%0A%20%20.%0A%20%20if%20row%20%3D%20-1%0A%20%20%20%20call%20show_code%0A%20%20%20%20timer%202%0A%20%20else%0A%20%20%20%20call%20next_row%0A%20%20.%0A.%0Aon%20timer%0A%20%20row%20%3D%20-2%0A.%0Afunc%20new%20.%20.%0A%20%20call%20init_vars%0A%20%20for%20i%20range%204%0A%20%20%20%20code%5Bi%5D%20%3D%20random%206%0A%20%20.%0A%20%20color%20531%0A%20%20move%2010%2010%0A%20%20rect%2070%2080%0A%20%20linewidth%2010%0A%20%20move%205%205%0A%20%20line%205%2095%0A%20%20line%2085%2095%0A%20%20line%2085%205%0A%20%20line%205%205%0A%20%20color%20310%0A%20%20linewidth%207%0A%20%20move%2028%203.5%0A%20%20line%2058%203.5%0A%20%20move%2030%201.5%0A%20%20color%20864%0A%20%20textsize%204%0A%20%20text%20%22Mastermind%22%0A%20%20color%20310%0A%20%20linewidth%200.5%0A%20%20move%2010%2010%0A%20%20line%2010%2096%0A%20%20move%2067%2010%0A%20%20line%2067%2096%0A%20%20move%2080%2010%0A%20%20line%2080%2096%0A%20%20for%20r%20range%208%0A%20%20%20%20for%20c%20range%204%0A%20%20%20%20%20%20move%20c%20*%2012%20%2B%2020%20r%20*%2011.5%20%2B%2012%0A%20%20%20%20%20%20circle%202%0A%20%20%20%20.%0A%20%20%20%20call%20draw_rate%20r%200%200%0A%20%20.%0A%20%20guess%5B0%5D%20%3D%200%0A%20%20guess%5B1%5D%20%3D%200%0A%20%20guess%5B2%5D%20%3D%201%0A%20%20guess%5B3%5D%20%3D%201%0A%20%20call%20next_row%0A.%0Afunc%20do_move%20.%20.%0A%20%20c%20%3D%20(mouse_x%20-%2015)%20div%2012%0A%20%20guess%5Bc%5D%20%3D%20(guess%5Bc%5D%20%2B%201)%20mod%206%0A%20%20call%20draw_guess%0A.%0Aon%20mouse_down%0A%20%20if%20row%20%3D%20-2%0A%20%20%20%20call%20new%0A%20%20elif%20mouse_y%20%3E%20row%20*%2011.5%20%2B%207%20and%20mouse_y%20%3C%20row%20*%2011.5%20%2B%2017%20and%20row%20%3E%3D%200%0A%20%20%20%20if%20mouse_x%20%3E%2015%20and%20mouse_x%20%3C%2061%0A%20%20%20%20%20%20call%20do_move%0A%20%20%20%20elif%20mouse_x%20%3E%2067%20and%20mouse_x%20%3C%2080%0A%20%20%20%20%20%20call%20rate%0A%20%20%20%20.%0A%20%20.%0A.%0Acall%20new%0A" rel="nofollow">https:&#x2F;&#x2F;easylang.online&#x2F;run&#x2F;?code=%23%20Mastermind%3Aw90%0A%...</a>