Thimble – An online code editor - <AUTHOR> https://thimble.mozilla.org/? <comment><USER2> Editing code in the browser may make limited sense if the code is going to run in that same browser. However, why I would want to edit "on the web", losing all my local utilities and more, escapes me.

This "do EVERYTHING in your browser" fad has gone far enough. We have the most powerful desktop gear ever but every blinking of the cursor has to be done by a remote service?

<comment><USER3> Sadly, it's not anywhere on the page text but the <title> makes it clear: "for learners and educators"

This makes a TON of sense for those groups where someone doesn't spend half of their class time walking people through installing and configuring apps, dealing with whatever weird system customizations they've made, etc. Every time I've helped at a tutorial, that's been a big problem with some people never getting fully up and running in time.

Instead, it's "click this link" and you're actually in the class, with the ability to have pre-canned examples and starting points ready to go without also having to cover things like version control first.

<comment><USER4> The more I realize how much students struggle with setting up tooling for development, the more I start to wonder if we need to start focusing more on that instead of trying to skip it.

When I first starting programming a lot of my difficulty and frustration was trying to get my free copy of Borland Turbo C++ running. Once I got a bit older and started to learn Linux and more fundamental things about operating systems, programming became a much easier because the additional tooling steps were much easier.

EDIT: It's certainly possible tooling will soon become a thing of the past, but judging by the trends and past experience, I do start to wonder if it's time to expect it as a necessary evil and start to handle if head on as opposed to trying to avoid it.

<comment><USER5> Yes, I'm a cs professor and we just introduced an online, 1 credit "Software development tools" course for this reason. Students had so much trouble with this that it was really interfering with their course work.

<comment><USER6> Back in the old days, we'd have labs of computers with the software for the course pre-installed. Now that everyone has their own computer, I guess that doesn't make sense anymore, but software installation is still a problem.

<comment><USER7> At my university, some courses have started making virtual machines for students with all of the necessary software. This also turns out to be a problem because installing virtualbox or VMWare on a variety of laptops can be difficult for the course staff.

</comment></comment></comment></comment></comment></comment><comment><USER8> This post helps explain the why and how of thimble really well. Recommended read!

[http://blog.humphd.org/thimble-and-bramble/](http://blog.humphd.org/thimble- and-bramble/)

</comment><comment><USER9> Auto-update preview on edit, preview highlight of elements selected in code, desktop/mobile preview, all seem to work well. No other options, bells or whistles. I like the fact it does one thing well.

</comment><comment><USER10> I just tried out some of my favorite shortcuts I know from Sublime (I'm not saying Sublime invented these, just that I only came to know them through using it) and found them all to work:

      - Move lines up/down with ctrl+shift+up/down
      - Cut an entire line (ctrl+x)
      - Multiple cursors (ctrl+alt+up/down)
      - Comment the current line/selection (ctrl+'/')
      - Delete the current line (shift+delete)
      - Indent/dedent the current line/selection (ctrl+'['/']')

Still looking for the bindings to jump to matching braces/parens and to select the innermost block, but I'm sold. I'll be using this

<comment><USER11> [http://blog.humphd.org/thimble-and-bramble/](http://blog.humphd.org/thimble- and-bramble/) explains the tech behind all of it - it's literally just the Brackets editor, so virtually all shortcuts from Brackets will work in Thimble.

</comment></comment><comment><USER12> I was just doing some experiments and, while writing CSS selectors, the preview pane highlighted the matched elements. Pretty cool!

<comment><USER13> Yeah, I'm super impressed by the element matching both when editing HTML and CSS. Plus the autocomplete for CSS was a nice touch.

</comment></comment><comment><USER14> I used Coder for Raspberry Pi [0] when teaching my eight year old nephew how to code and it worked very well. This seems like an easier-to-setup substitute, well done! Can't have enough tools like this for those learning.

[0] [https://googlecreativelab.github.io/coder/](https://googlecreativelab.github.io/coder/)

</comment><comment><USER15> I can see this being useful if I want to work on some little projects from various locations. My current list of "active" computers are the following:

\- Work laptop (Dell workstation)

\- Home Windows laptop (Primarily for gaming)

\- Chromebook Pixel (Chrome OS / Ubuntu)

And of course, each one has its own editor that I use while I'm on them due to the varying OS's--Notepad++ on the Windows laptops, Caret when I'm in ChromeOS, SublimeText when I'm on the Ubuntu partition.

Assuming I just want to work on some small educational projects that don't involve committing to my Github, being able to simply pull up an IDE in the browser and just start coding away could be useful, particularly while I'm at work. Work usually seems to be where I get most of my sudden cravings to start learning new things anyway (probably because my day job is so repetitive).

</comment><comment><USER16> Online editors are a great idea but I usually DON'T use them for the following reason.

1) Lag. I hate it when I type and I see any kind of lag. After decades of quick response on typing anything out of a few ms makes me think something is wrong with my computer.

2) Work flow change. Can't use git and I do like my text editor of choice.

3) I can't write a script to do things to files like I can locally. I love scripting dumb task and use whatever language I use.

4) My language isn't supported normally. I love syntax highlighting personally.

<comment><USER11> I've been using it while they were gearing up to MVP and I can dispel some of those:

1) there is none. It's about as fast as PostMessage can pump data into an iframe, so it's _much_ faster than something like live-server, and because it watches file changes faster than something like webpack, it even seems a touch faster than webpack-hotreload (although their MVP can't do hotswapping of individual files yet)

2) fair point! I've found this great for PoC and article work. Just creatively write some code, polish it a little until it's good enough to treat as a first push for a new repo, and then export the filesystem as a zip so I can push it up to git later. That said, I _have_ already made some things of which I thought I was going to put it on git, but then just kept working on in Thimble instead because there wasn't actually any reason to put it on git: The code's already accessible because everyone can hit "remix" and I don't need to deal with gh-pages branches because the project's autohosted for free =)

3) not sure this one applies, since it's explicitly for building web content. It's an MVP atm so base html, css, javascript, fonts, etc. all work, and things like coffee script or JSX just require you to add a transformer library the way you'd do if you weren't bundling code. No complaints on that so far (might change, but I'm pretty cool with what it does right now)

4) which one? [http://blog.humphd.org/thimble-and- bramble](http://blog.humphd.org/thimble-and-bramble) explains that this is literally just the Brackets code editor, running in the browser, and pretty much any Brackets extension will work with it, so if you can find your favourite syntax highlighter and file an issue against [https://github.com/humphd/brackets](https://github.com/humphd/brackets) to have it added to the default set, problem solved!

</comment></comment><comment><USER17> Education is a fantastic application for this - there are lots of nice touches, like highlighting elements of the DOM in the preview window when you click on them in the editor. The code completion also pops up lots of options for tags and attributes which could make exploring a lot easier for young students.

I'm also excited to use it for doing technical interviews with front-end devs. Curious to see how it stacks up with Codepen, JSFiddle, etc.

</comment><comment><USER18> Looks amazing for people who want to learn web development. Text editor (with dark theme) , preview , list of files and help builtin all in the same window.

<comment><USER19> Shouldn't people who want to learn web development use the workflow and tools of professional web developers? And since these tools are free, I don't see the case for Thimble.

<comment><USER11> As a professional web dev: dude, this is what I wish I had five years ago. Categorically no: teach people using the fewest amount of tools needed to get cool shit written and working. Then, when they hit the limits (IF they hit the limits) of that single "get shit done" tool, have them branch out to the more complex stuff.

</comment></comment></comment><comment><USER20> I ended up in this when trying to signup. :/

{"statusCode":400,"error":"Bad Request","message":"\"uid\" is not allowed","validation":{"source":"query","keys":["uid"]}}

<comment><USER21> It wold appear you must use the Login link at the top-right of [https://thimble.mozilla.org/](https://thimble.mozilla.org/). That sends you to a login page with a bunch of extra parameters after the [https://id.webmaker.org/login?](https://id.webmaker.org/login?).

e.g. [https://id.webmaker.org/login?client_id=wm_id_wMvw9BSwq2A480...](https://id.webmaker.org/login?client_id=wm_id_wMvw9BSwq2A480dxr&response_type=code&state=e9baaf0a-07e0-497d-85d7-72a7eefc36&scopes=user%20email)

If you try to login just from [https://id.webmaker.org/login](https://id.webmaker.org/login) you will get the error you saw.

</comment></comment><comment><USER22> I don't think texteditors are supposed to hog a whole core of a quadcore cpu.

</comment><comment><USER23> I'm the creator of [http://plnkr.co/edit/](http://plnkr.co/edit/) which is a similar (but perhaps less 'professional') online web editor.

One thing that I find interesting is that Mozilla has decided that browsers have moved forward far enough that hosting the preview via `blob:` urls. I've experimented with a similar approach but had issues where different 3rd party libraries die unexpectedly when they are not dealing with http / https.

</comment><comment><USER24> Funny how the X11 "Fixed" bitmap font [0] is chosen as the default font on my system. This appears to be caused by 'fixed' being set as a fallback font instead of 'monospace', which, on most systems, is an alias for the default monospace font which is usually an antialiased one.

Otherwise the editor seems to work very nicely.

[0] [https://en.wikipedia.org/wiki/Fixed_%28typeface%29](https://en.wikipedia.org/wiki/Fixed_%28typeface%29)

<comment><USER11> One cool thing is that this is a Mozilla project, which means it's open source, and it's even on Github: probably worth filing that over on [https://github.com/mozilla/thimble.webmaker.org](https://github.com/mozilla/thimble.webmaker.org)

<comment><USER24> Done. Thanks for the reminder.

</comment></comment></comment><comment><USER25> I ran across a couple of issues:

* highlight to copy is broken (I assume because the source is not first-class text and they manipulate the clipboard with JS)

* failing to close the last list item in a ul causes the preview window to stop updating and highlights the next line in the editor but doesn't provide any indication of what is wrong

This is definitely not going to be sufficient for professional programming or web development but it looks and performs far better than similar projects I've seen in the past.

<comment><USER11> Yeah I ran into that first one too. It actually works, but not via context menu. The ctrl/cmd-c keyboard shortcut works fine, but the Brackets context menu seems to not have it...

The second one sounds like a pretty genuine bug, maybe worth filing over on [https://github.com/mozilla/thimble.webmaker.org/issues](https://github.com/mozilla/thimble.webmaker.org/issues) ?

Agreed that it won't be the tool that professional devs will use to "do their job", but I'm a professional dev, and I've been using it for a while now for my "just for fun" stuff, and loving it. It takes almost no time at all to do even really funky "what the hell are you even doing??" stuff like this: [https://d157rqmxrxj6ey.cloudfront.net/mopaxian/817/](https://d157rqmxrxj6ey.cloudfront.net/mopaxian/817/)

</comment></comment><comment><USER26> Using Firefox 40.0.3 I can't create a new project. Even after registering. js console says:

> [Brackets Filesystem] Unknown I/O error Object { name: "EFILESYSTEMERROR", > code: "EFILESYSTEMERROR", errno: 1001, message: "unknown error", stack: > "e@[https://mozillathimblelivepreview…"](https://mozillathimblelivepreview…") > }

<comment><USER27> Obviously there will be lots of bugs.

But HN is not really Thimble's support forum though. That would be something like: [https://support.mozilla.org/en- US/questions/new](https://support.mozilla.org/en-US/questions/new)

<comment><USER26> HN users usually reply to these kind of posts with their first experience using the product being shared, I was just following a trend, in case someone happened to know what this kind of error means.

In particular, I saw 'EFILESYSTEMERROR' and thought maybe I set some Firefox preference too strict, and some of you could be familiar with the error.

But you are right, the best way to get this fixed/understood is probably by contacting the devs/support for the product.

<comment><USER27> Yeah, you're right, it does happen and sometimes people can help here.

It just sometimes bugs me though that posts about some new product/lib etc are often sidetracked with bug reports, and oftentimes for some obscure setup ("doesn't work for me on IE6", "I have Chrome Canary and it blows", 'doesn't run in NetBSD", "doesn't work with NoScript" etc).

(Then there's the evergreen: "I cannot see past the first slide of this presentation, clicking does nothing etc." ("have you tried pressing the keyboard arrows?").

</comment></comment></comment></comment><comment><USER28> Looks interesting but I wonder how it fares with more complex websites? The changes he made in the video amounted to editing static tags and css colours to see realtime changes - but what if a javascript function is used to add elements on page startup? Or a js library is used to load a twitter feed?

<comment><USER29> You have to put Thimble into context. It's a tool for teaching basic Web skills to people new to the field, and part of the Mozilla Learning initiative[0].

I'm not sure it's intended for actual development.

[0] [https://teach.mozilla.org/](https://teach.mozilla.org/)

EDIT: forgot the link

</comment></comment><comment><USER30> The custom tutorial aspect of this is exactly what I need for a new intern that will be starting soon.

</comment><comment><USER31> This reminds me of an online code editor at this clothing store shop solution that allowed people to easily make shopping carts and customize it to an extent. Does anyone remember what they were called?

</comment><comment><USER32> This is pretty awesome though I would like to see the ability to pull in JS and CSS libraries and frameworks into a project. This could gear some tutorials around certain technologies.

</comment><comment><USER33> looks just fine in firefox. ain't working in my chrome v44

<comment><USER34> yep , 7 errors on chrome including

> Uncaught SecurityError: Failed to read the 'localStorage' property from > 'Window': Access is denied for this document.

and some frame related errors.

<comment><USER11> Sounds like some extensions might be getting in the way - I'm not seeing any errors in Chrome 44 stable using the default extensions.

</comment></comment></comment><comment><USER35> pretty slick online editor. Has some nice touches.

</comment><comment><USER36> nice! reminds me on a better processing IDE

<comment><USER11> As one of the devs who used to work on Processing.js, this is an extremely tempting idea to try to make work =P

</comment></comment><comment><USER37> too bad it doesn't work.

</comment><comment><USER38> no safari 9 support makes dan a sad boy.</comment>


Why the closed distribution model of Windows 8 must be changed - <AUTHOR> http://mollyrocket.com/casey/stream_0004.html

<comment><USER2> This isn't about Windows 8. You can replace Windows 8 with any single-control- entity. Heck, you could replace Windows 8 with Tesla and the Microsoft Store with Tesla-authorized garage.

<comment><USER3> Right, but it is _also_ about Windows 8 -- and Windows is still the most widely used desktop OS.</comment></comment>


DevOps Dave, a comic: Devs & Ops in Trench Warfare - <AUTHOR> https://www.scriptrock.com/blog/devops-dave-devs-ops-trench-warfare/?utm_source=twitter&utm_medium=social&utm_content=afa1e383-f259-413b-99da-512cba94e0b7

<comment><USER2> A good illustration. If you try to impose 'DevOps' from the top down you can't. DevOps comes from shared trust and shared best practices. It requires the development and operations teams to become the engineering team. You can't truly get that by management dictum. If you try to do that, you haven't really tried DevOps.

</comment><comment><USER3> Haha</comment>


Okteto Push – Your Code to Kubernetes in Seconds - <AUTHOR> https://okteto.com/blog/okteto-push-code-to-kubernetes-in-seconds/ <comment><USER2> How do you achieve "in seconds" when you are still building and image, pushing to a registry, and then deploying to k8s?

Docker build alone makes me believe this is a false statement.

This mostly seems like the same steps my bash script runs, perhaps in cluster?

Does this require some base container of yours running in my cluster? Any place I can audit that container and code?

<comment><USER3> Hey, I'm Ramiro, one of the maintainers. We do several things to speed the whole cycle up.

When you are using Okteto Cloud to run your apps, you get all this:

\- Build is run in big servers in the Okteto Cloud infra. It's based on buildkit, and it's heavily cached and optimized towards development scenarios. The build context is sent from your local machine to the service and everything else happens there. \- The registry in the same infrastructure as the build services. The image is pushed from the build service to the registry, instead of from your machine. \- The deployment runs in the same cluster as well, to speed up the time it takes to pull the image.

You can also use "okteto push" with your own infra, by providing your own buildkit service, registry and k8s cluster. Depending on where they are located with respect to each other this might be slower or faster (e.g using dockerhub for registry will be slower than using a dedicated one in your own cluster, mainly due to network speed and proximity).

The biggest benefits of this approach are being able to move all this to the k8s cluster, where you can leverage more compute power and faster network transmission. That way you are not pulling and pushing images across the internet.

<comment><USER2> How do you build containers safely in a multi tenant setup?

Any open source repos to check out?

My environment has the things in the cloud, but it is still not seconds. Even npm watch takes several seconds, let alone docker builds almost always take minutes

<comment><USER3> > Even npm watch takes several seconds, let alone docker builds almost always > take minutes

That's where caching, container layers and build stages can help a lot. Specially for development, where you might be rebuilding the same container over and over.</comment></comment></comment></comment>


Broadening HSTS to secure more of the Web - <AUTHOR> https://security.googleblog.com/2017/09/broadening-hsts-to-secure-more-of-web.html <comment><USER2> > In 2015 we created the first secure TLD when we added .google to the HSTS > preload list, and we are now rolling out HSTS for a larger number of our > TLDs, starting with .foo and .dev.

Interesting, I didn't realize you could add entire top-level domains to the HSTS preload list like that.

This seems like a really interesting potential migration path towards a future where HTTPS support is mandatory. On TLDs that preload HSTS, you might not even need to open port 80 or accept regular HTTP requests at all, since browsers would _always_ load the HTTPS version of the site.

<comment><USER3> Whe you control the TLD _AND_ the preload list what's to stop you?

<comment><USER4> We encourage any other registry operators who want to add their TLDs to the HSTS preload list to contact us and we'll make it happen.

</comment></comment></comment><comment><USER4> Hey everyone, I'm the author of the linked blog post. I can hopefully answer any questions anyone might have. I wrote this post to clarify our overall strategy and intent in response to some of the confusion surrounding our addition of .dev and .foo to the HSTS preload list; see [https://news.ycombinator.com/item?id=15268701](https://news.ycombinator.com/item?id=15268701) for what that was like.

<comment><USER5> Why did Chrome make it take an extra step or two to look at the issuer of a certificate?

<comment><USER4> No idea. I'm not on the Chrome team. I will say that the best way to find out this info (and more) now is to hit F12/Cmd-Opt-I/whatever to open up the Developer console, and then go to the Security tab. You can see the SSL certificate in there along with lots of other useful security information that wasn't as easily findable from the previous method.

So if I had to guess, it's that they wanted to display more security-related information, which made sense in the developer console but not on the certificate screen. And that viewing the certificate was confusing non- technical web users.

<comment><USER6> Can you tell them to change it back? It's absolutely annoying.

Edit: [http://www.herongyang.com/PKI/Chrome-40-HTTPS-Certificate- Ge...](http://www.herongyang.com/PKI/Chrome-40-HTTPS-Certificate-General.jpg)

The old screen showed the same information as in the "Security" tab. Right now a click on the "Secure" button in the URL bar doesn't even show the certificate issuer. It is useless this way.

<comment><USER7> At least there is an active bug about this: [https://bugs.chromium.org/p/chromium/issues/detail?id=663971](https://bugs.chromium.org/p/chromium/issues/detail?id=663971)

</comment></comment></comment></comment></comment><comment><USER8> [https://hstspreload.org/?domain=google.com](https://hstspreload.org/?domain=google.com) [https://hstspreload.org/?domain=googleblog.com](https://hstspreload.org/?domain=googleblog.com)

<comment><USER4> We're working on those. Our main customer-facing blog is [https://blog.google](https://blog.google), which is on the .google TLD, which is HSTS-secured. google.com is complicated because there are some subdomains that would need carve-outs, which are not yet supported by all browsers.

<comment><USER8> "In 2014, we started encouraging other websites to use HTTPS by giving secure sites a ranking boost in Google Search."

"We're working on those ....google.com is complicated"

Having a top rank in Google results is a very serious business for a lot of companies. If this trend continues for HSTS i am a little worried.

I do understand Google likes to encourage the rest of the world to have an as secure possible internet infrastructure, but i'm not so sure if those same companies would accept a lower Google ranking just because their IT department will tell them "It's complicated".

It's not evil by far. But it's not really nice as well.

By the way. Just checked [https://hstspreload.org/?domain=blog.google](https://hstspreload.org/?domain=blog.google). It says No HSTS header is present on the response.

<comment><USER4> We're working on standardizing HSTS carve-outs across browsers, which should help improve this process tremendously. The specific parts of google.com that are problematic are related to PKI infrastructure for Chrome (CRLs and such) that cannot be served encrypted. Most companies won't have these requirements, fortunately. And we do have many individual subdomains of google.com added to the list individually in lieu of carve-outs: [https://chromium.googlesource.com/chromium/src/net/+/master/...](https://chromium.googlesource.com/chromium/src/net/+/master/http/transport_security_state_static.json#258)

As for blog.google, that's the beauty of TLD-wide HSTS. You don't need to do anything special on the individual websites, such as configuring headers, to get the benefit of HSTS. All you have to do is set up an SSL cert.

The hstspreload.org site does not yet correctly display results for when a parent has HSTS enabled, but your browser itself does do the right thing. As for fixing what hstspreload.org displays, that's something I might take a crack at: [https://github.com/chromium/hstspreload/issues/85](https://github.com/chromium/hstspreload/issues/85)

<comment><USER8> Thanks for this awesome reply!

</comment></comment></comment></comment></comment><comment><USER9> I am not sure I understand, who is supposed to add the TLDs to HSTS preload list ? I don't see TLDs like .com,.net,.io etc. ever being added so is this an option only for likes of Google who own TLDs ?

<comment><USER4> Yes, registry operators would be the ones to add TLDs to the HSTS preload list. And it's very hard to do so retroactively as you're effectively breaking any existing website that isn't available over HTTPS. So, practically speaking, it's mainly an option for new, unlaunched, and closed TLDs.

</comment></comment><comment><USER10> I'd wager this sort of aggressive and possibly effective mass nudging toward effective encryption will lead to China further isolating itself from the rest of the Internet.

<comment><USER11> This requires client buy-in, and (at least as of a couple years ago) 360 Secure Browser did not do interstitials on pages with invalid SSL:

[https://cabforum.org/pipermail/public/2015-April/005488.html](https://cabforum.org/pipermail/public/2015-April/005488.html)

</comment></comment><comment><USER12> I wonder when, how and for how much the dev and foo domains are going to be available...

<comment><USER13> Calzone dot org has all the up to date dates of sunrise, trademark, pre- registration and general availability dates for all new TLDs.

GA is not available yet for .dev. See [https://icannwiki.org/.dev](https://icannwiki.org/.dev)

About 1300 registrations for .soy [https://icannwiki.org/.soy](https://icannwiki.org/.soy)

<comment><USER14> Some time about there was a discussion that the wiki you linked isn't really updated anymore.

I'm also skeptical if .dev will ever be open to registration.

<comment><USER13> The data I've seen there is correct.

</comment></comment></comment></comment><comment><USER15> How viable is the interception a http-to-https redirect page? What is the recommended way to redirect users to https?

<comment><USER2> Ideally, you should use HSTS preloads in combination with a 301 or 308 redirect.

HTTP redirects can be intercepted by anyone who is a MITM (man-in-the-middle) to your connection. (Such as a Wi-Fi hotspot owner, ISP, or someone attacking the network itself via DNS poisoning, ARP spoofing, etc.) So using _only_ HTTP redirects leaves you open to a [SSL Stripping attack][1].

A better option is to use a HSTS header. This ensures that once a user visits your site once over HTTPS, all subsequent visits will also happen over HTTPS. This makes SSL Stripping attacks harder, but still possible if the attacker is able to MITM your users on their first visit to your site.

The best option is to get your site on the list of HSTS preloads. This list ships with web browsers, which will then _always_ load your site over HTTPS. A site that uses HSTS preloads is nearly immune to SSL Stripping attacks, and that's what Google is using here.

Some browsers still don't support HSTS though, so you might not be able to rely entirely on HSTS preloads to redirect your users. For that reason, it's best to _also_ redirect users via 301 or 308 HTTP redirects, just in case.

[1]: [https://security.stackexchange.com/q/41988/29865](https://security.stackexchange.com/q/41988/29865)

<comment><USER4> > HTTP redirects can be intercepted by anyone who is a MITM (man-in-the- > middle) to your connection. (Such as a Wi-Fi hotspot owner, ISP, or someone > attacking the network itself via DNS poisoning, ARP spoofing, etc.)

Don't forget state actors. Billions of people live in countries that censor/track/edit/redirect Web connections.

</comment></comment></comment><comment><USER16> Why does Google own .soy?

<comment><USER4> Does this answer your question? [https://www.iam.soy/](https://www.iam.soy/)</comment></comment>


Revisiting Common Subexpression Elimination in Guile - <AUTHOR> http://wingolog.org/archives/2014/08/25/revisiting-common-subexpression-elimination-in-guile

<comment><USER2> I love reading Wingo's writing — it's delightfully lucid, and he helps me understand things I didn't before. He's a good example of "smart and gets things done." Guile has also stopped being wretched under his watch.</comment>


The Metaphysics of Mathematics - <AUTHOR> http://steve-patterson.com/the-metaphysics-of-mathematics-against-platonism/

<comment><USER2> The author correctly rejects the rampant (and false) Platonism in modern mathematics but (implicitly?) accepts the Kantian version of the same error via the Analytic/Synthetic dichotomy. This is as far as he'll get unless he defines his own theory of concepts.</comment>


The Cleverest Geeky Windows Tricks Everyone Should Know - <AUTHOR> http://lifehacker.com/5543354/the-cleverest-geeky-windows-tricks-everyone-should-know

<comment><USER2> Using "mplayer -vo caca MovieName.avi" to play a video file in a Linux terminal is awesome - even if maybe it doesn't quite belong in an article about Windows tricks.</comment>


Ask HN: What are your non-technical non-fiction recommended reads? - <AUTHOR> Interested in seeing what books have helped people improve their lives or learn useful skills.<p>For me, 'Driven to Distraction' was a helpful book, though limited to ADHD. 59 Seconds by Richard Wiseman has been helpful too. Logging three things I'm grateful for each day led to one of the happiest months of my life. <comment><USER2> _Critique of Pure Reason_ , Immanual Kant. It provided the solution which abstracted away the issues with empirical reasoning as the basis for fact and made possible modern scientific enquiry. The abstraction is so powerful that science can ignore the fact that it is a distraction and rebrand itself as independent science rather than the natural philosophy branch of philosophy.

</comment><comment><USER3> Think and grow rich by napolean hill (read his golden rules as well), psycho cybernetics by maxwell maltz, Tao Teching by Lao Tsu (written centuries ago, it will give you deep insights on leadership), power of now by eckhart tolle, jonathan livingston seagull by richard bach, and of course the alchemist by paulo coelho!

</comment><comment><USER4> How to Win Friends and Influence People.

<comment><USER5> Do people really like this book?? I thought it was cliche, dated and infomercially. Truly am perplexed when i see it recommended.

<comment><USER6> It only seems cliche because all the other books written on the same topic regurgitate it.

</comment></comment></comment><comment><USER7> The Hero with a Thousand Faces, by Joseph Campbell. It's a universal story, with the major features of every major world mythology catalogued and included within.

</comment><comment><USER8> Surely You're Joking Mr. Feynman.

Feynman's curiosity and drive to learn new things is inspiring to me.

</comment><comment><USER9> Business Adventures by John Brooks The Outsiders: Eight Unconventional CEOs and Their Radically Rational Blueprint for Success by William Thorndike

</comment><comment><USER10> My suggestion is The 22 Immutable Laws of Marketing. It's a very, very quick read.</comment>


What is 'skip locked' for in PostgreSQL 9.5? (2016) - <AUTHOR> https://blog.2ndquadrant.com/what-is-select-skip-locked-for-in-postgresql-9-5/ <comment><USER2> Why use a database as a queue? It is known this doesn't scale well nor work particularly well. If you need big scale, you can get something like RabbitMQ or Kafka. If you want to avoid server setup, use SQS or Cloud Pub/Sub. If you want it to be lighter weight, use Redis.

This is kind of like an article talking about how most people use a hammer to put in screws wrong. Which is cool, and good for learning why using a hammer to put in screws is a bad idea. But the outcome of this all should be "Use a proper tool for the job", not "try to come up with a neat trick to make this work in the wrong system".

<comment><USER3> > Why use a database as a queue?

Already have a central, configured and monitored server and need "just a small queue" for something. This is not per se a bad decision. For the same reason it doesn't have to be a bad idea to cache things in the main database, instead of using a dedicated cache like Redis.

<comment><USER4> In my experience, the cost of adding and maintaining another storage subsystem to a project is often hugely underestimated. It's easy to see the benefits and ignore the costs.

If I can solve a problem reasonably well by adding a table to my Postgres DB, that will always beat out adding the specialized ScrewdriverDB that does it perfectly.

<comment><USER5> Depends on what you're adding. Running Redis is dead simple and easy to have visibility into. RabbitMQ / Kafka are much larger undertakings.

<comment><USER6> If you already had a need for a _durable_ database, and so you properly implemented Postgres streaming-archiving + disaster recovery, at much personal effort for your tiny startup... and you now need a _durable_ queue as well... then "just installing Redis" won't get you there. You'll need to that whole ops setup all over again for Redis. Whereas, if your queue is _in_ Postgres, the ops problem is already solved.

If you have a full-time ops staff, throwing another marginal piece of infrastructure on the pile isn't much of an issue. If you're your own "ops staff of one", each moving part of your infrastructure—that you need to _ensure_ works, to guarantee you won't lose client data—is another thing slowing down your iteration speed.

<comment><USER5> You're making a lot of assumptions that aren't terribly valid for most use cases. Not to say that strict consistency requirements don't exist, they certainly do, but they are the exception rather than the norm. A one person startup doesn't usually care too much about losing a bit of client data.

> If you have a full-time ops staff, throwing another marginal piece of > infrastructure on the pile isn't much of an issue.

That's a rather insulting description of Redis, care to elaborate?

<comment><USER7> It's nothing like insulting. Think of it like absolute and marginal costs. You have absolute infrastructure -- the sum total of all your infrastructure -- and you have marginal infrastructure -- bits and pieces that can be added and removed. If you have no Redis and then you have Redis, NewAbsoluteInfrastructure = OldAbsoluteInfrastructure + Redis, and Redis is your marginal infrastructure.

<comment><USER5> I mis-interpreted your use of 'marginal', sorry about that.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER8> MySQL also has SKIP LOCKED from 8.0.1 [0].

[0] [http://mysqlserverteam.com/mysql-8-0-1-using-skip-locked- and...](http://mysqlserverteam.com/mysql-8-0-1-using-skip-locked-and-nowait- to-handle-hot-rows/)

</comment><comment><USER9> (possibly dumb q, pls be gentle)

Hmmm... What happens if the application crashes immediately after removing the work item but before it can do anything else? Doesn't this break exactly-once semantics... ?

i.e. wouldn't a complete implementation include a second table with "who's working on what" and a transaction that moves the records from one table to the either... and come to think of it, why not store both tables in the same place? I.e. don't delete records, just mark them as taken and include a timestamp so we can timeout and give the work to another worker?

UPDATE queue_table SET taken_by = :myId, time_taken = now() WHERE id = ( SELECT id FROM queue_table WHERE taken_by IS NULL LIMIT 1 FOR UPDATE)

Note: completion can be signalled by setting taken_by to NULL, or but adding another column e.g. completion time, which then enables computing stats on completion times.

For high volume systems, we eventually want to garbage collect but that's easy since we have timestamps, i.e. put a partial index on timestamp (WHERE time_taken IS NOT NULL) and scan the oldest ones...

<comment><USER5> > What happens if the application crashes immediately after removing the work > item but before it can do anything else? Doesn't this break exactly-once > semantics... ?

If the connection is broken the transaction would be aborted and the lock released. If the worker hit an infinite loop or something like that you'd use something like `idle_in_transaction_session_timeout` to set a transaction timeout and/or have a worker monitoring system in place to kill long running jobs.

The important thing to note is that a single DB instance and a client still comprises a distributed system. You still have almost all the same problems with 'exactly-once' semantics you would with a distributed queue. You should make all processing jobs idempotent and support retry regardless of the tech backing the queue if you want a system that provides effectively exactly-once semantics.

<comment><USER9> ah! you're assuming the work is performed inside the same transaction as the dequeue operation, and locks held for the duration ?

If so...

While I suppose row level locking technically solves contention, it still feels like we're "asking for trouble" in holding databases locks while clients perform arbitrarily long work operations. There's also practical issues when the work itself is distributed and the original client can't itself keep state around, i.e. it has to end the low level transaction.

Hence my poor-man's question/proposal using worker IDs and timeouts...

<comment><USER5> > ah! you're assuming the work is performed inside the same transaction as the > dequeue operation, and locks held for the duration ?

Yes that is the model the linked post is proposing, see the Example.

> While I suppose row level locking technically solves contention, it still > feels like we're "asking for trouble" in holding databases locks while > clients perform arbitrarily long work operations. There's also practical > issues when the work itself is distributed and the original client can't > itself keep state around, i.e. it has to end the low level transaction.

Not that I recommend using PG as a queue, but you have most/all those problems with any queuing backend. A problem you may have that is PG specific is that the # of open connections/transaction could become quite large with a lot of workers and PG doesn't play well with a lot of connections, it uses a process- per-connection model.

</comment></comment></comment></comment><comment><USER10> database rule #1, do not use your database as a work queue.

this article does a great job discussing why not, and finishes with a sane implementation that would work, but would fall over and shutter to a halt with a moderate amount of load. ( which is mentioned in the article too )

doing queue workloads in rdbms is a recipe for index contention, bugs, or both.

<comment><USER11> I've found that co-locating my queue with my application data enables a very powerful pattern around persisting actions and queuing up callbacks -- especially useful for smaller applications where scale isn't as much of a factor. It means I can persist both my data and my background jobs in a single transaction, and if something goes wrong during that transaction they both rollback (before the jobs are picked up by any workers). No need to coordinate two different systems (which can be full of pitfalls).

<comment><USER12> Yes for infrequent yet high value tasks where consistency is paramount, DB queues are king. The alternatives using an externalized queue is either non- transactional without failure handling ( _yet everybody pretends it is_ ), transactional with 2PC where recovery was never thought through ( _or tested_ ), or devolves to having the equivalent of a DB queue anyway to track work with re-insertion of work into the primary queue.

</comment></comment></comment><comment><USER13> Locking the task row and doing the work in the same transaction has the nice property, that the task will be available again, if the worker fails and the transaction is rolled back.

Unfortunately this may cause problems when the tasks take considerable time to complete and long running transactions are the result: "Postgres Job Queues & Failure By MVCC" [https://brandur.org/postgres- queues](https://brandur.org/postgres-queues)

</comment><comment><USER14> Why not using scheduled timestamped checkpoint synchronization, and then you can get Loose coupling.

</comment><comment><USER15> I've noticed long ago that RDBMS users don't actually care about consistency, so it's always kind of wrong at some level and when things break it's not that big of a deal for them. It's just annoying to see people claiming how transactions are easy, while they are only easy to do incorrectly.</comment>


Versioned Go Commands - <AUTHOR> https://research.swtch.com/vgo-cmd <comment><USER2> TOC for all articles in the series: [https://research.swtch.com/vgo](https://research.swtch.com/vgo).

Links to previous discussions about articles in the series:

Part 1: [https://news.ycombinator.com/item?id=16421966](https://news.ycombinator.com/item?id=16421966)

Part 3: [https://news.ycombinator.com/item?id=16431299](https://news.ycombinator.com/item?id=16431299)

Part 4: [https://news.ycombinator.com/item?id=16433425](https://news.ycombinator.com/item?id=16433425)

Part 6: [https://news.ycombinator.com/item?id=16441970](https://news.ycombinator.com/item?id=16441970)

<comment><USER3> Part 5: [https://news.ycombinator.com/item?id=16434973](https://news.ycombinator.com/item?id=16434973)

</comment></comment><comment><USER4> I'm really excited about all this! No more GOPATH, no need for vendor directories; I think this is a positive step forward for Go, and package management in general. I'm also interested in seeing if there's any wider adoption of these ideas in the larger package management ecosphere.

One thing I've been mulling is whether this setup makes more sense in compiled languages than it would with dynamic languages. In the latter, your code base is your executable, so there may not be much difference between this and having a traditional vendor directory.

Of course, using semantic import versioning is something that can stand alone.

<comment><USER5> Vendor directories are the simplest way to include the deps with your project. Removing that ability would complicate many existing projects. Now instead of git, we will need an additional tool to properly vendor our deps .

<comment><USER4> I am afraid I don't exactly agree. If you are publishing a library, for one, it's best not to include any vendored dependencies to begin with. But, ideally, no one should include vendored dependencies, whether a library or executable; those are things that can be fetched at build time. ("But, what if the dependencies disappear?" you may ask—this would be handled through the caching proxy in Russ' proposal.)

The additional tool you would need to build your software would be vgo.

<comment><USER6> > those are things that can be fetched at build time

At least for Linux distributions, the package builders are normally not allowed any network access; this was an issue for packages using Rust before cargo-vendor and the introduction of a flag to cargo to never try to update the lockfile.

Not allowing network access for build hosts is probably not limited to Linux distributions, so this use case will have to be addressed sooner or later.

<comment><USER3> It's a simple system. If the modules are already present in your local cache it will just use them directly. So not having network access for build time is trivial to work around: just put the packages you depend on in your local cache and you're done. Note that with this system the selected versions are deterministic, so if the modules are present there's no reason to access the network anyways.

</comment></comment></comment></comment></comment><comment><USER7> I have been out of the go space for a while, and recently took up a small project that uses it.

I was glad to see that 3rd party tooling (VSCode extension for example) had improved a lot. And after the initial hump, using the dep[0] tool was a breath of fresh air compared to the cludgy alternatives back in 1.4/1.5.

As of a month or two ago dep was slated to become the "go dep ..." command. I'm really curious (and not in a demanding way.. but legitimately curious) why:

1) it's taken them this long to stabilize dependency management, in what seems like an otherwise polished, well supported ecosystem?

2) they could abandon a well thought out, reliable community supported tool that was endorsed by golang itself?

After a lot of trying I'm finally warming to the language but the community and ecosystem still leave a lot to be desired. I'll be interested to see how vgo plays out. Third time lucky I guess (get, dep, vgo)?

<comment><USER8> The dependency management story is awful because Go is developed for Google's purposes, and Google builds from a monorepo.

<comment><USER9> The monorepo seems like a bit of a red herring. A fork maintained in a separate repository (like pressing the fork button GitHub) would achieve the same. In fact, the type aliasing feature was added because Google (and others) struggled to make modifications in single commit, so the atomicity the monorepo could theoretically provide has already proven to not be there in practice.

The main difference is that Google is comfortable with having a fork that they can update from the mainline branch when needed/desired, but will otherwise stay stable for their software. Others, who are familiar with more traditional package tools, are not. And perhaps their concern is justified, but interestingly I've never seen a Go experience report reporting why that approach failed them.

<comment><USER10> I took that to mean that most of the major "sanctioned" programs in go, do all of the heavy lifting "in repo."

Which is funny, because it is easy/natural to view dependencies as technical debt. You are literally building against someone else's technical assets. In that sense, most dependencies you have are easily argued to be technical debt. If you have the capital of google, why do that? (For the rest of us, the answer is easy, we don't have that kind of capital and have to.)

</comment></comment></comment></comment><comment><USER11> The main pain point in Go dependency management is that it lacks a central package registry and hardcode dependency in the source code. So developers have to vendor the dependencies in the source code in case of remote dependencies disappear. And if dependencies path changes, every source code file including import path has to be changed.

From the serial posts, vgo uses a proxy to cache dependency to solve the first issue. But I wonder whether the import path has to be changed to proxy URL. At first I've thought module would solve the second issue but after reading part 6 of the serial posts, it doesn't mention whether the packages imported in source code have to include the full package path with URL, so still suffers. Correct me if I misunderstand it.</comment>


Introducing Google Docs drawings - <AUTHOR> http://googledocs.blogspot.com/2010/04/introducing-google-docs-drawings.html A nice simple alternative to gliffy or a napkin. <comment><USER2> If I could connect arrows to other stuff, I'd be all set.

</comment><comment><USER3> As a heavy Omnigraffle user who is trying to migrate to Google docs I am very excited. Unfortunately Google hasn't made it easy to embed these drawing in documents. I'd love to see a "live" embed.

</comment><comment><USER4> I've been using this for about two or three days and apart from a few issues (unable to create more pages, no revisions, import your own symbols) its a fantastic v1 product and the live aspect is better than most I've tried.

</comment><comment><USER5> Nice and clean tool... really a big plus for freelancers discussion UI wire- frames with clients.

</comment><comment><USER6> nice that they use svg, could put more pressure on ie / drive adoption of chrome frame

</comment><comment><USER7> Such a shame it doesn't work yet in touch browsers (Android/iPhone/iPad).

</comment><comment><AUTHOR> A nice alternative to gliffy/visio/omnigraffle/napkin.</comment>


Show HN: Cloud-based agents for web scraping, text extraction, OCR, change track - <AUTHOR> https://www.agenty.com <comment><AUTHOR> Hi, Hackers!

We have been working on Agenty from a long time, and today I am so excited to show it to the HN community.

We are launching 4 agents today :

\- Scraping agents : Point-and-Click web scraping agent to extract data from websites of choices. Convert websites into api in lass then 2 minutes (see my video [https://www.agenty.com/docs/video- tutorials.aspx](https://www.agenty.com/docs/video-tutorials.aspx) ) or install the extension from Chrome store - [https://chrome.google.com/webstore/detail/agenty-advanced- we...](https://chrome.google.com/webstore/detail/agenty-advanced-web- scrap/gpolcofcjjiooogejfbaamdgmgfehgff)

\- Textract agents : Extract text and metadata from almost any documents in batch

\- OCR agents : Extract text from images and pdfs.

\- Bar code recognition agent - Recognize the bar code number and it's type from products photo captured by mobile or cameras.

All agents are API ready, see the documentation - [https://www.agenty.com/docs/api](https://www.agenty.com/docs/api)

Go to our website and signup to get 100 pages credit free to try any agent you like. And you can go PRO anytime if you like it, the pricing plan just starts from $29 per month (10x lower then import.io for web scraping whose plans starts from $299)

I'll keeps checking this page today to answer any comments, feedback you have, really looking forward to it.</comment>


Regexper – Regular expressions visualizer - <AUTHOR> https://regexper.com/ <comment><USER3> It's always neat to see where one's ideas go! AFAIK, I was the first person to create dynamic railroad diagrams for regular expressions (maybe 12 or 13 years ago). I got the idea from json.org, which I think was Douglas Crockford's brainchild.

My initial implementation was strfriend.com (in Lisp: well under 1,000 lines, including views), and I think its main claim to fame was that Jeff Atwood made fun of it on Twitter. (I was truly clueless at promoting myself back then. Not only did I not have a Twitter account, but it didn't occur to me to submit it to HN.)

Every so often, I toy around with the idea of making it into a proper local/native application -- maybe someday. In the meantime, my obsession with regular expressions lives on in my current application (see bio) where I parse and rewrite the user's entered regex syntax (ICU) into whatever regex syntax the backend requires. I don't know of any other application that does this, but I predict that in 15 years it'll be commonplace (and I'll still be poor)!

<comment><USER4> I was taught the algorithms to do this stuff in my Computer Science class over 20 years ago (RE is equivalent to DFA). You weren't the first person to implement regular expression visualizations.

<comment><USER5> A dynamic visualization on the web 13 years ago? He may have been the first.

<comment><USER6> It was pretty hard to do viz on the web 13 years ago. In 2006 I made a web tool to turn regular expressions into NFAs and DFAs and animate their states as you typed. It took a lot of code (drawing and animating along beziers, AJAX to a server for graphviz and a regex compilation and minimization package I wrote for this). [https://imgur.com/gallery/Yqqoh](https://imgur.com/gallery/Yqqoh)

These days there's a lot more tooling and components that can snap together to make this kind of thing.

</comment></comment></comment></comment><comment><USER7> Nice. From this SO answer:

[https://stackoverflow.com/a/800847/415384](https://stackoverflow.com/a/800847/415384)

we get this:

[https://regexper.com/#%5E(%3F%3A(%3F%3A(%3F%3A0%3F%5B13578%5...](https://regexper.com/#%5E\(%3F%3A\(%3F%3A\(%3F%3A0%3F%5B13578%5D%7C1%5B02%5D\)\(%5C%2F%7C-%7C%5C.\)31\)%5C1%7C\(%3F%3A\(%3F%3A0%3F%5B13-9%5D%7C1%5B0-2%5D\)\(%5C%2F%7C-%7C%5C.\)\(%3F%3A29%7C30\)%5C2\)\)\(%3F%3A\(%3F%3A1%5B6-9%5D%7C%5B2-9%5D%5Cd\)%3F%5Cd%7B2%7D\)%24%7C%5E\(%3F%3A0%3F2\(%5C%2F%7C-%7C%5C.\)29%5C3\(%3F%3A\(%3F%3A\(%3F%3A1%5B6-9%5D%7C%5B2-9%5D%5Cd\)%3F\(%3F%3A0%5B48%5D%7C%5B2468%5D%5B048%5D%7C%5B13579%5D%5B26%5D\)%7C\(%3F%3A\(%3F%3A16%7C%5B2468%5D%5B048%5D%7C%5B3579%5D%5B26%5D\)00\)\)\)\)%24%7C%5E\(%3F%3A\(%3F%3A0%3F%5B1-9%5D\)%7C\(%3F%3A1%5B0-2%5D\)\)\(%5C%2F%7C-%7C%5C.\)\(%3F%3A0%3F%5B1-9%5D%7C1%5Cd%7C2%5B0-8%5D\)%5C4\(%3F%3A\(%3F%3A1%5B6-9%5D%7C%5B2-9%5D%5Cd\)%3F%5Cd%7B2%7D\)%24)

or from another answer:

[https://regexper.com/#((1%7C0(00)*01)((11%7C10(00)*01))*%7C(...](https://regexper.com/#\(\(1%7C0\(00\)*01\)\(\(11%7C10\(00\)*01\)\)*%7C\(0\(00\)*1%7C\(1%7C0\(00\)*01\)\(\(11%7C10\(00\)*01\)\)*\(0%7C10\(00\)*1\)\)\(\(1\(00\)*1%7C\(0%7C1\(00\)*01\)\(\(11%7C10\(00\)*01\)\)*\(0%7C10\(00\)*1\)\)\)*\(0%7C1\(00\)*01\)\(\(11%7C10\(00\)*01\)\)*\)))

<comment><USER8> That last link shows an error.

<comment><USER9> Add ')' at the very end (you can see it is not included in the clickable link and it's also what the error says).

<comment><USER7> Thanks, fixed!

</comment></comment></comment></comment><comment><USER10> Neat! I also suggest: [https://regexr.com/](https://regexr.com/)

<comment><USER11> I'm fond of [https://regex101.com/](https://regex101.com/) as well.

<comment><USER12> I'm 100% behind you here.

Comparing [1] and [2], there's no competition.

[1] [https://regexper.com/#%5E(%3F%3A(%3F%3A(%3F%3A0%3F%5B13578%5...](https://regexper.com/#%5E\(%3F%3A\(%3F%3A\(%3F%3A0%3F%5B13578%5D%7C1%5B02%5D\)\(%5C%2F%7C-%7C%5C.\)31\)%5C1%7C\(%3F%3A\(%3F%3A0%3F%5B13-9%5D%7C1%5B0-2%5D\)\(%5C%2F%7C-%7C%5C.\)\(%3F%3A29%7C30\)%5C2\)\)\(%3F%3A\(%3F%3A1%5B6-9%5D%7C%5B2-9%5D%5Cd\)%3F%5Cd%7B2%7D\)%24%7C%5E\(%3F%3A0%3F2\(%5C%2F%7C-%7C%5C.\)29%5C3\(%3F%3A\(%3F%3A\(%3F%3A1%5B6-9%5D%7C%5B2-9%5D%5Cd\)%3F\(%3F%3A0%5B48%5D%7C%5B2468%5D%5B048%5D%7C%5B13579%5D%5B26%5D\)%7C\(%3F%3A\(%3F%3A16%7C%5B2468%5D%5B048%5D%7C%5B3579%5D%5B26%5D\)00\)\)\)\)%24%7C%5E\(%3F%3A\(%3F%3A0%3F%5B1-9%5D\)%7C\(%3F%3A1%5B0-2%5D\)\)\(%5C%2F%7C-%7C%5C.\)\(%3F%3A0%3F%5B1-9%5D%7C1%5Cd%7C2%5B0-8%5D\)%5C4\(%3F%3A\(%3F%3A1%5B6-9%5D%7C%5B2-9%5D%5Cd\)%3F%5Cd%7B2%7D\)%24)

[2] [https://regex101.com/r/LzdGpw/1](https://regex101.com/r/LzdGpw/1)

I can use 2, but 1 just looks cool.

</comment></comment></comment><comment><USER13> After 20 years of software development I've come to adopt a best practise:

Whenever I start writing a regular expression, I stop and write a "manual" domain specific parse function instead.

Saved me a LOT of debugging time.

Since I can now use kotlin pretty much anywhere (jvm, browser, shellscripts) this is easy because of the superb stdlib ("startsWith", "lastIndexOf", "substringBeforeLast(...)")

The time saved I invest in Unittests for the parser.

<comment><USER14> I can't shake the feeling that Regexp could be written just as efficiently as a fluent interface with a more human friendly syntax.

I've been telling Jr devs bucking for promotion for years to explain what they're doing in plain english, then write code that looks like that. Basically telling them to skip right over the "gee look what a clever fuck I am" stage and write good code instead of creating riddles.

The Regexp problem just screams this at me. What am I doing? I'm looking for a line that starts with a capital T, then has some quantity of alphanumeric characters greater than n (if n is not 0, 1, or infinity, this requires extra work in Regex), followed by an equals sign with or without whitespace characters around it.

Give me an API that does exactly that, instead of Regex. Something gets lost in translation every time.

I think the fact that the origin of Regex is the command line interface is pretty telling. We didn't and we don't have a convenient way to type in imperative code on a command line. So an arcane syntax was created so you could do the whole thing in a quarter line of text.

Speaking as someone who has had a Unix shell for 25 years, and routinely works on mini tools for their fellow developers, I don't think we actually type stuff into a shell that often anymore. The difference between documenting a one-liner in a README and just building a shell script that does the same thing is not that big. There's a difference in development effort but building a script can allow you access to a debugger. Personally, I'd be willing to pay that tax any day.

<comment><USER15> > I can't shake the feeling that Regexp could be written just as efficiently > as a fluent interface with a more human friendly syntax.

You can use _SRL_ \- Simple Regex Language ([https://simple- regex.com/](https://simple-regex.com/)) for making readable regex/matching rules. It is supported in C++, Java, C#, PHP, Javascript, and Python. Also, you can use the web version to generate equivalent regex if your language is one of the above.

Here is an example from the website for matching an e-mail address:

      begin with any of (digit, letter, one of "._%+-") once or more,
      literally "@",
      any of (digit, letter, one of ".-") once or more,
      literally ".",
      letter at least 2 times,
      must end, case insensitive

Regex to do the same:

      /^(?:[0-9]|[a-z]|[\._%\+-])+(?:@)(?:[0-9]|[a-z]|[\.-])+(?:\.)[a-z]{2,}$/i

The first one is readable, second one is cryptic. [https://simple- regex.com/examples](https://simple-regex.com/examples) has more examples.

SRL was previously discussed here in 2017, see [https://news.ycombinator.com/item?id=12384862](https://news.ycombinator.com/item?id=12384862)

Also, the parse feature (DSL) of Rebol language is an excellent regex alternative:

1\. Why Rebol, Red, and the Parse dialect are Cool ([http://blog.hostilefork.com/why-rebol-red-parse- cool/](http://blog.hostilefork.com/why-rebol-red-parse-cool/))

2\. Rebol's answer to Regex: parse and Rebol types ([https://rebol- land.blogspot.in/2013/03/rebols-answer-to-rege...](https://rebol- land.blogspot.in/2013/03/rebols-answer-to-regex-parse-and-rebol.html))

<comment><USER16> Interesting, thanks for mentioning! Looks similar to VerbalExpressions ([https://github.com/VerbalExpressions/JSVerbalExpressions/wik...](https://github.com/VerbalExpressions/JSVerbalExpressions/wiki))

</comment></comment></comment></comment><comment><USER17> Here is a regexp to match an IPv4 address - looks quite nice and easy to understand compared to the regexp! In fact the visualisation makes it easy to spot the mistake.

[https://regexper.com/#'%5Cb((25%5B0-5%5D%7C2%5B0-4%5D%5B0-9%...](https://regexper.com/#'%5Cb\(\(25%5B0-5%5D%7C2%5B0-4%5D%5B0-9%5D%7C%5B01%5D%3F%5B0-9%5D%5B0-9%5D%3F\)\(%5C.%7C%24\)\)%7B4%7D%5Cb')

(From [https://stackoverflow.com/q/5284147/164234](https://stackoverflow.com/q/5284147/164234) )

<comment><USER18> The visualization tool shows that the regex is not correct. It allows 000.000.000.000 as an IPv4 address

<comment><USER19> I created this instead: [https://regexper.com/#((%5B0-9%5D%5C.)%7C(%5B1-9%5D%5B0-9%5D...](https://regexper.com/#\(\(%5B0-9%5D%5C.\)%7C\(%5B1-9%5D%5B0-9%5D%5C.\)%7C\(1%5B0-9%5D%5B0-9%5D%5C.\)%7C\(2%5B0-5%5D%5B0-5%5D%5C.\)\)%7B3%7D\(\(%5B0-9%5D\)%7C\(%5B1-9%5D%5B0-9%5D\)%7C\(1%5B0-9%5D%5B0-9%5D\)%7C\(2%5B0-5%5D%5B0-5%5D\)\)\(%24\))

The repetition count seems to be displayed off-by-one though.

<comment><USER20> On mobile so can't (easily) test it, but doesn't this produce a false negative for `246.{snip}`, for example?

<comment><USER19> Yes, you are right...the following better? [https://regexper.com/#((%5B0-9%5D%5C.)%7C(%5B1-9%5D%5B0-9%5D...](https://regexper.com/#\(\(%5B0-9%5D%5C.\)%7C\(%5B1-9%5D%5B0-9%5D%5C.\)%7C\(1%5B0-9%5D%5B0-9%5D%5C.\)%7C\(2%5B0-4%5D%5B0-9%5D%5C.\)%7C\(25%5B0-5%5D%5C.\)\)%7B3%7D\(\(%5B0-9%5D\)%7C\(%5B1-9%5D%5B0-9%5D\)%7C\(1%5B0-9%5D%5B0-9%5D\)%7C\(2%5B0-4%5D%5B0-9%5D\)%7C\(25%5B0-5%5D\)\)\(%24\))

</comment></comment></comment></comment></comment><comment><USER21> The could really use a bunch of "try it" links or examples to show what it can do.

</comment><comment><USER22> Looks neat, but after a quick look I think I still like [https://www.debuggex.com/](https://www.debuggex.com/) better. Going step by step through the regex for a given string is really a killer feature for me.

<comment><USER23> Yep, and not having to click "Display" button each time.

Also, partially highlighting the text you write is a pretty hard feature to implement, I did it once. Kudos to debuggex.com for working correctly even with browser zoom on.

</comment></comment><comment><USER24> The Email::Valid Perl distribution ships with a more than 6000 character regex to validate E-Mail addresses.

Both goo.gl and bit.ly refused to shorten it, and when I tried to paste the link here HN refused to accept my comment.

But on a machine with Email::Valid installed do:

        perl -MEmail::Valid -wE 'say $Email::Valid::RFC822PAT'

And copy the output into the Regexper form. It takes a while to render, but it'll eventually complete.

<comment><USER25> Wow. Despite the utterly insane complexity of a regex of that size, it doesn't seem to do an insane amount of branching. Maximum depth of choices seems to be about 4, which is less than a lot of other regex examples I've seen here.

That being said... That regex is just noise. Nobody can tackle it all at once or by themselves, unless they specialise in just regex. It's 6599 characters, at least on my system. So at a wild stab, its the equivalent of 4,500 lines of obfuscated code.

You can't audit it, you just kinda have to trust it, and hope.

But with something like regexper, I can at least read it.

<comment><USER24> I can't remember where, but there's some version of that regex somewhere that uses variables for interpolation in subsequent regexes.

Viewed like that it's really not that complex, most of it is repetition of previously used regex sequences, it's only when fully expanded that it becomes so humongous.

<comment><USER25> The pattern is Jeffrey Friedl's, from his book _Mastering Regular Expressions_.

And as clear as the source could be made, I feel the fact that so many people have just copied and pasted it means that any understanding is lost, and they're just praying and hoping, because a regex of that size is actually difficult for them to comprehend.

</comment></comment></comment></comment><comment><USER26> There's also [http://emailregex.com/regex-visual- tester/#(%3F%3A%5Ba-z0-9!...](http://emailregex.com/regex-visual- tester/#\(%3F%3A%5Ba-z0-9!%23%24%25%26'*%2B%2F%3D%3F%5E_%60%7B%7C%7D~-%5D%2B\(%3F%3A%5C.%5Ba-z0-9!%23%24%25%26'*%2B%2F%3D%3F%5E_%60%7B%7C%7D~-%5D%2B\)*%7C%22\(%3F%3A%5B%5Cx01-%5Cx08%5Cx0b%5Cx0c%5Cx0e-%5Cx1f%5Cx21%5Cx23-%5Cx5b%5Cx5d-%5Cx7f%5D%7C%5C%5C%5B%5Cx01-%5Cx09%5Cx0b%5Cx0c%5Cx0e-%5Cx7f%5D\)*%22\)%40\(%3F%3A\(%3F%3A%5Ba-z0-9%5D\(%3F%3A%5Ba-z0-9-%5D*%5Ba-z0-9%5D\)%3F%5C.\)%2B%5Ba-z0-9%5D\(%3F%3A%5Ba-z0-9-%5D*%5Ba-z0-9%5D\)%3F%7C%5C%5B\(%3F%3A\(%3F%3A25%5B0-5%5D%7C2%5B0-4%5D%5B0-9%5D%7C%5B01%5D%3F%5B0-9%5D%5B0-9%5D%3F\)%5C.\)%7B3%7D\(%3F%3A25%5B0-5%5D%7C2%5B0-4%5D%5B0-9%5D%7C%5B01%5D%3F%5B0-9%5D%5B0-9%5D%3F%7C%5Ba-z0-9-%5D*%5Ba-z0-9%5D%3A\(%3F%3A%5B%5Cx01-%5Cx08%5Cx0b%5Cx0c%5Cx0e-%5Cx1f%5Cx21-%5Cx5a%5Cx53-%5Cx7f%5D%7C%5C%5C%5B%5Cx01-%5Cx09%5Cx0b%5Cx0c%5Cx0e-%5Cx7f%5D\)%2B\)%5C%5D))

Edit: Add the missing ) to the url

</comment><comment><USER27> This is a nifty tool, and to be honest I was unaware that regex visualization was a thing before now. I usually write comments in BNF next to my regex, so that I can make sense of them later. I'm going to keep doing that, but visualization is going to be great for debugging and for figuring out other people's less carefully commented regex.

</comment><comment><USER28> Here's an example of a regex to validate us phone numbers

[https://regexper.com/#%2F%5E(1%5Cs%3F)%3F(%5B0-9%5D%7B3%7D%7...](https://regexper.com/#%2F%5E\(1%5Cs%3F\)%3F\(%5B0-9%5D%7B3%7D%7C%5C\(%5B0-9%5D%7B3%7D%5C\)\)%5B%5Cs%7C-%5D%3F%5B0-9%5D%7B3%7D%5B%5Cs%7C-%5D%3F%5B0-9%5D%7B4%7D%24%2Fgm)

From

[https://www.freecodecamp.org/challenges/validate-us- telephon...](https://www.freecodecamp.org/challenges/validate-us-telephone- numbers)

I found these 11 videos most helpful when learning regex from codecourse

[https://www.youtube.com/watch?v=GVZOJ1rEnUg&index=1&list=PLf...](https://www.youtube.com/watch?v=GVZOJ1rEnUg&index=1&list=PLfdtiltiRHWGRPyPMGuLPWuiWgEI9Kp1w)

</comment><comment><USER29> Nicely done!

I use [https://www.debuggex.com/](https://www.debuggex.com/) on a daily basis.

If you want to improve your regex skills, Regex Golf is the place to go! [https://alf.nu/RegexGolf](https://alf.nu/RegexGolf)

</comment><comment><USER30> Nicely done.

Next step, can you do it in reverse? Would be cool to create the regex in a graphical editor and then generate the actual expression.

Feature request: export the visualization to ascii, so I can copy paste it into a comment above the regex in my code.

</comment><comment><USER31> Suggestion: put a link to one or two examples to quickly get an idea of what it does.

<comment><USER9> And base64 share urls.

</comment></comment><comment><USER32> I love the graphics. I would like the equivalent for Python and the GNU flex (lexer) RE's.

No... wait.... I know what I want! I want a sphinx extension that allows me to include an RE in a Python docstring and have it render as a railroad track graphic in the generated documentation:

      some_re_string = r'ab[0-9]*z'
      """:regex: Any string starting whith 'ab', followed by
          digits, ending with 'z'.
      """

That should be able to go pick up the documented string and render a railroad track diagram along with the text in the generated documentation.

</comment><comment><USER33> I'd love to have it the other way around. Human speech to RegExp.I find it really hard to write these expression, e. g.: A colleague needed to write a RegExp for a nickname alias for a URL. It had to have only letters and numbers or a specific number. So either name34 na34me or 23 would be valid.

</comment><comment><USER34> This is very well made. I don't know what I was expecting, but this really impressed me.

</comment><comment><USER35> Does not look like it supports negative lookbehind [https://regexper.com/#(%3F%3C!a)b](https://regexper.com/#\(%3F%3C!a\)b)

<comment><USER36> It does do negative lookahead though - [https://regexper.com/#%2F%5Cd%2B(%3F!%5C.)%2F](https://regexper.com/#%2F%5Cd%2B\(%3F!%5C.\)%2F)

Negative lookbehind only appeared in Chrome in v.62 ([https://v8project.blogspot.co.uk/2017/09/v8-release-62.html](https://v8project.blogspot.co.uk/2017/09/v8-release-62.html)) it's not too surprising that tools haven't caught up yet.

</comment></comment><comment><USER37> Back when [https://xkcd.com/1930/](https://xkcd.com/1930/) was posted, I made a regular expression to create a generator using a regex sampler (for instance [http://dwickern.github.io/regex-sample/](http://dwickern.github.io/regex- sample/) ).

I've put the regex at [https://gist.github.com/kmill/17c5ef4f99bd9ef7ad799f0b487448...](https://gist.github.com/kmill/17c5ef4f99bd9ef7ad799f0b4874484a)

The amusing thing to me is that this regex visualizer can reproduce the comic.

<comment><USER38> [https://regexper.com/#%5EDid%20you%20know%20that%20(the%20(f...](https://regexper.com/#%5EDid%20you%20know%20that%20\(the%20\(fall%7Cspring\)%20equinox%7Cthe%20\(winter%7Csummer\)%20\(solstice%7COlympics\)%7Cthe%20\(earliest%7Clatest\)%20\(sunrise%7Csunset\)%7Cdaylight%20savings%3F%20time%7Cleap%20\(day%7Cyear\)%7CEaster%7Cthe%20\(harvest%7Csuper%7Cblood\)%20moon%7CToyota%20truck%20month%7Cshark%20week\)%20\(happens%20\(earlier%7Clater%7Cat%20the%20wrong%20time\)%20every%20year%7Cdrifts%20out%20of%20sync%20with%20the%20\(sun%7Cmoon%7Czodiac%7C\(Gregorian%7CMayan%7Clunar%7CiPhone\)%20calendar%7Catomic%20clock%20in%20Colorado\)%7Cmight%20\(not%20happen%7Chappen%20twice\)%20this%20year\)%20because%20of%20\(time%20zone%20legislation%20in%20\(Indiana%7CArizona%7CRussia\)%7Ca%20decree%20by%20the%20pope%20in%20the%201500s%7C\(precession%7Clibration%7Cnutation%7Clibation%7Ceccentricity%7Cobliquity\)%20of%20the%20\(moon%7Csun%7CEarth's%20axis%7Cequator%7Cprime%20meridian%7C\(international%20date%7CMason- Dixon\)%20line\)%7Cmagnetic%20field%20reversal%7Can%20arbitray%20decision%20by%20\(Benjamin%20Franklin%7CIsaac%20Newton%7CFDR\)\)%5C%3F%20Apparently%20\(it%20causes%20a%20predictable%20increase%20in%20car%20accidents%7Cthat's%20why%20we%20have%20leap%20seconds%7Cscientists%20are%20really%20worried%7Cit%20was%20even%20more%20extreme%20during%20the%20\(bronze%20age%7Cice%20age%7CCretaceous%7C1990s\)%7Cthere's%20a%20proposal%20to%20fix%20it%2C%20but%20it%20\(will%20never%20happen%7Cactually%20makes%20things%20worse%7Cis%20stalled%20in%20Congress%7Cmight%20be%20unconstitutional\)%7Cit's%20getting%20worse%20and%20no%20one%20knows%20why\)%5C.%24)

</comment></comment><comment><USER39> searched for some javascript regex's to test it with and found the regex chapter from Eloquent javascript [https://eloquentjavascript.net/09_regexp.html](https://eloquentjavascript.net/09_regexp.html)

Coincidence that the diagrams seem to be generated by regexper !

</comment><comment><USER40> has a bug: {2,4} displayed as 1..3 times

<comment><USER41> I noticed it translates repeats into a form with a required first character/group so 5{2,4} became 55{1,3} - <USER2> [https://regexper.com/#5%7B2%2C4%7D](https://regexper.com/#5%7B2%2C4%7D)

</comment></comment><comment><USER42> Should I expect to have to to escape "/" as "\/"?

<comment><USER42> Complex regexes do render (must escape "/").

[https://regexper.com/#%5B%5E%3C%5D%2B%7C%3C](https://regexper.com/#%5B%5E%3C%5D%2B%7C%3C)(!(--(%5B%5E-%5D _-(%5B%5E-%5D%5B%5E-%5D_ -) _-%3E%3F)%3F%7C%5C%5BCDATA%5C%5B(%5B%5E%5D%5D_ %5D(%5B%5E%5D%5D%2B%5D) _%5D%2B(%5B%5E%5D%3E%5D%5B%5E%5D%5D_ %5D(%5B%5E%5D%5D%2B%5D) _%5D%2B)_ %3E)%3F%7CDOCTYPE(%5B%20%5Cn%5Ct%5Cr%5D%2B(%5BA-Za- z_%3A%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)(%5BA- Za-z0-9_%3A.-%5D%7C%5B%5E%5Cx00-%5Cx7F%5D) _(%5B%20%5Cn%5Ct%5Cr%5D%2B((%5BA- Za-z_%3A%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)(%5BA- Za-z0-9_%3A.-%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)_ %7C%22%5B%5E%22%5D _%22%7C '%5B%5E'%5D_')) _(%5B%20%5Cn%5Ct%5Cr%5D%2B)%3F(%5C%5B(%3C(!(--%5B%5E-%5D_ -(%5B%5E-%5D%5B%5E-%5D _-)_ -%3E%7C%5B%5E-%5D(%5B%5E%5D%22'%3E%3C%5D%2B%7C%22%5B%5E%22%5D _%22%7C '%5B%5E'%5D_') _%3E)%7C%5C%3F(%5BA-Za-z_%3A%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)(%5BA- Za-z0-9_%3A.-%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)_ (%5C%3F%3E%7C%5B%5Cn%5Cr%5Ct%20%5D%5B%5E%3F%5D _%5C%3F%2B(%5B%5E%3E%3F%5D%5B%5E%3F%5D_ %5C%3F%2B) _%3E))%7C%25(%5BA-Za- z_%3A%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)(%5BA- Za-z0-9_%3A.-%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)_ %3B%7C%5B%20%5Cn%5Ct%5Cr%5D%2B) _%5D(%5B%20%5Cn%5Ct%5Cr%5D%2B)%3F)%3F%3E%3F)%3F)%3F%7C%5C%3F((%5BA-Za- z_%3A%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)(%5BA- Za-z0-9_%3A.-%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)_ (%5C%3F%3E%7C%5B%5Cn%5Cr%5Ct%20%5D%5B%5E%3F%5D _%5C%3F%2B(%5B%5E%3E%3F%5D%5B%5E%3F%5D_ %5C%3F%2B) _%3E)%3F)%3F%7C%5C%2F((%5BA-Za-z_%3A%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)(%5BA- Za-z0-9_%3A.-%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)_ (%5B%20%5Cn%5Ct%5Cr%5D%2B)%3F%3E%3F)%3F%7C((%5BA-Za- z_%3A%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)(%5BA- Za-z0-9_%3A.-%5D%7C%5B%5E%5Cx00-%5Cx7F%5D) _(%5B%20%5Cn%5Ct%5Cr%5D%2B(%5BA-Za- z_%3A%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)(%5BA- Za-z0-9_%3A.-%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)_ (%5B%20%5Cn%5Ct%5Cr%5D%2B)%3F%3D(%5B%20%5Cn%5Ct%5Cr%5D%2B)%3F(%22%5B%5E%3C%22%5D _%22%7C '%5B%5E%3C'%5D_'))*(%5B%20%5Cn%5Ct%5Cr%5D%2B)%3F%5C%2F%3F%3E%3F)%3F)

[http://www.cs.sfu.ca/~cameron/REX.html](http://www.cs.sfu.ca/~cameron/REX.html)

<comment><USER42> Horizontal scroll would be useful.

</comment></comment></comment><comment><USER43> I would think it would be better to minimize the pseudo dfa to collapse states.

Also having each character of an alternation of subset in light blue box then laying them out vertically makes the hard to read.

Of the point of this is to make regex more easily understood, you would think you would want to make them compact.

</comment><comment><USER44> ^I love it$

</comment><comment><USER45> In Emacs:

M-x regexp-builder

</comment><comment><USER46> I'm an rx geek and can often craft what I'm looking to get without a lot of help, but I have used this tool many times before -- it's very slick. It would be _nice_ if it supported something other than JavaScript[0], but hey, it's on the web, it probably makes a lot of sense to be that way (and it's nice that it's all client-side and I don't have to wait for it to ship my regular expression back to a server for processing).

Regular expressions are simply awesome and I'm continually surprised at how frequently I run into developers who have next-to-no understanding of them.Case in point, I ran into some code a few months ago that spanned two methods and 20-lines to do something that a 6-character regular expression could have solved (and would have done so more performantly[1]); the best part was that part of what I was responsible for handling was a bug that ended up residing right inside one of those methods. And then there's all of the things related to "dealing with strings" that many regular expression libraries just handle, such as "\d" vs "[0-9]" in a world with unicode strings[3]. It _feels_ cryptic[4] when you encounter it and you're not familiar with the syntax, but to learn the "80% most useful parts", you needn't study much more than content that would fit on a single printed sheet of paper (and to get the last 20%, you'd need, maybe 2, ... 3?)

All of that said, there's also the other side of the coin; if ever the saying "If all you have is a hammer, everything looks like a nail" had application, it's with regular expressions. I'm not sure how many times the question "How do I write a regular expression to parse HTML" has to be responded with "don't" before folks quit trying[2]. It tends to be the first thing I reach for when I have a need to process text, even when there are better tools; heck, _all_ of my find/replace dialogues in every application that supports it have the "Regex" box checked by default (and it really throws me off when I hit up "Find" in the browser and need to search for something with a ( or ) in it which I escape due to muscle memory)

[0] I have an occasional need for PCRE and .NET style; and I really miss named-groups when I have to do something complex in JavaScript.

[1] While it's easy to accidentally end up in hell, ala [https://blog.codinghorror.com/regex- performance/](https://blog.codinghorror.com/regex-performance/), poorly written string-search code can be worse when the complexity of the pattern your searching for reaches a certain point, and that's to say nothing of the errors per x lines of code and readability (not that rx is particularly readable under complexity).

[2] And hey, I've got a shell script that downloads a few status pages on my server at home that uses awk with regular expressions to extract values from a web page. I wouldn't say it necessarily qualifies as "parsing HTML" since it's really only concerned with looking for a small string which it filters a second time to get the value -- horribly inefficient, but it's worked for 5 years through page changes without requiring adjustment.

[3] At least in the C# world, are about twice as slow due to handling digits "correctly" [https://stackoverflow.com/questions/16621738/d-is-less- effic...](https://stackoverflow.com/questions/16621738/d-is-less-efficient- than-0-9)

[4] While it's usually written cryptically, many (most?) implementations support flags to ignore whitespace and support comment features. I've had a few crazy-ugly rx's that I had to use to extract data from a ticketing system's "blob field" to insert into a structured format; were it not for that feature, it would have been impossible to write and support.

</comment><comment><USER47> Isn't this just debuggex.com? That's hacker but not news.

<comment><USER48> The guidelines say you can post whatever is interesting to hackers, whether it's new/news or not.

</comment></comment><comment><USER49> My best friend for Regex: [http://www.txt2re.com/](http://www.txt2re.com/)

With code examples!</comment>


Bloomberg spy chip claims are impossible Apple, says analysis - <AUTHOR> https://9to5mac.com/2018/10/23/bloomberg-spy-chip/ <comment><USER2> impossible Apple? What kind of apple is that? Is this some sort of fruit analist?</comment>


I thought all anti-vaxxers were idiots. Then I married one - <AUTHOR> http://www.vox.com/2015/9/4/9252489/anti-vaxx-wife <comment><USER2> [https://vaers.hhs.gov/data/data#downloads](https://vaers.hhs.gov/data/data#downloads)</comment>


The Rise and Fall of the Army Surplus Store - <AUTHOR> http://www.artofmanliness.com/2016/10/11/rise-fall-army-surplus-store/ <comment><USER2> I loved the Army-Navy store when I was a kid. In those days there was a ton of Vietnam surplus and my genuine GI helmet liner, pistol belt, etc. were prized items for backyard war games. Even though the surplus store in my city has morphed into selling a lot of civilian camping and hunting gear, I think there is still a lot of genuine military items. However, the difference is they tend to be new items from gov't contractors such as Propper. It's not a bad thing but these items don't have the cheap prices of used or surplus items.</comment>


Ask HN: What is the most nonsensical crypto currency you have seen? - <AUTHOR> <comment><USER2> XP - experience points. It's team is a bunch of anonymous cartoons, no whitepaper or any sort of technical discussion, it's github is a fork with a few changes committed by a developer working on another coin just a few months back, and it's worth >$800 million apparently.

<comment><USER3> It's one of the better ones imo. It's used for a social cause and unlike many other coins, you can actually buy things with it.

</comment></comment><comment><USER4> Garlicoin

[http://reddit.com/r/garlicoin](http://reddit.com/r/garlicoin)

</comment><comment><USER3> Whopper Coin: [https://www.cnbc.com/2017/08/28/burger-king-russia- cryptocur...](https://www.cnbc.com/2017/08/28/burger-king-russia- cryptocurrency-whoppercoin.html)

Apparently some loyalty rewards for Burger King

</comment><comment><USER5> Titcoin [https://en.wikipedia.org/wiki/Titcoin](https://en.wikipedia.org/wiki/Titcoin)

<comment><AUTHOR> Serious question: what is the point of a coin like that targeted at a specific industry?

</comment></comment><comment><USER6> HempCoin has to be up there for me:

[http://hempcoin.org](http://hempcoin.org)

I submitted this as a slogan but haven't heard back:

HempCoin: Kicking the Can of Converting Cannabis to Spendable Dollars Down the Road Since 2014

</comment><comment><USER7> Groincoin. Can you guess what niche it was aimed at?

<comment><AUTHOR> looks like the site is down

</comment></comment><comment><USER8> Coinye</comment>


Python memory usage of common types - <AUTHOR> http://www.valuedlessons.com/2008/10/blog-post.html

<comment><USER2> For large collections of homogenous values, using the array or struct modules is best for memory (and often for speed as well).

Or if math is needed, then numpy arrays are best.

Storing homogenous data in lists/tuples is fine if performance/memusage is not critical, or for small collections (i.e., 90% of use-cases).

</comment><comment><USER3> It's not mentioned in this article, but Python 2.6 objects have a __sizeof__ method, used by sys.getsizeof():

      >>> help(sys.getsizeof)
      Help on built-in function getsizeof in module sys:

      getsizeof(...)
        getI(object, default) -> int

        Return the size of object in bytes.

<http://bugs.python.org/issue2898>

</comment><comment><USER4> This boggled me a bit until I noticed it's a 64-bit system. So an int takes 3 words, which sounds more reasonable.</comment>


Ask HN: I'm offered interview by Google for internship that I never applied - <AUTHOR> Recently, I got an email asking me to schedule a phone interview with a Google recruiter on a position that I kind of never applied. In fact, this year, I never directly applied to Google on any positions. What I vividly remembered was just sending my resume to a Google Form from Google to their career talk in my country. So here I am, should I give it a try even if I don't really interested in the nature of work of this internship position?<p>Further information: I'm a CS-student that doesn't like to do marketing work and they offered "Business Intern" interview offer. <comment><USER2> I too was reached out like for for their Software Engineer and Software Engineer in Test roles. Honestly it was an experience both good and bad. Plus, I enjoy flying so I got a free trip out of it.

Also for me, every interview I had after my Google one felt like a cake walk.

Whatever you do with it, congrats for being reached out to. You don't know what you did but you were doing it right ;)</comment>


Show HN: Redis Utils – Node.js-based utils to deal with large Redis databases - <AUTHOR> https://github.com/piiojs/redis-utils <comment><AUTHOR> We found that when you have a huge set of keys on Redis it is best to use SCAN and asynchronous operations or you'll block your database.

Operations on Redis utils right now are Count, Set Expire, Migrate, and Oldest Key.</comment>


Zynga Tried To Kill A Cute iOS Game One Ex-OMGPOP Dev Made For His Wife [Evil] - <AUTHOR> http://www.cultofmac.com/156508/zynga-tried-to-kill-a-cute-ios-game-one-ex-omgpop-dev-made-for-his-wife-evil/

<comment><USER2> No they did not: [http://gamasutra.com/view/news/167244/Turning_down_Zynga_Why...](http://gamasutra.com/view/news/167244/Turning_down_Zynga_Why_I_opted_out_of_the_210M_Omgpop_buy.php)

\--- \- I was not directly asked to give up control of my indie game. I was only asked to sign a job offer -- which might have that legal consequence. (If this seems like a flimsy point over which to worry so much, ask yourself: if you were asked to sign a document that might mean that you lost custody of your child, with no assurances otherwise -- would you do so? I don't have a child, I have Connectrode.)</comment>


Mobile Operators Announce Commitment to Firefox OS - <AUTHOR> https://blog.mozilla.org/blog/2013/02/24/mozilla-unlocks-the-power-of-the-web-on-mobile-with-firefox-os/ <comment><USER2> I'm just curious, so don't take this comment to mean or imply anything. What does "commitment" to a mobile OS from a operator actually mean? What do, in this case, Mozilla get from it?

As someone outside of the mobile phone industry (Just a simple consumer) I don't see the advantage of having a mobile phone service provider "committing" to your OS. Surely hardware manufacturers are vastly more important as they are the people who are actually going to create devices that can run your OS?

<comment><USER3> Mobile operators have to certify devices, even if they don't include them in the portfolio.

This is a consequence of commitments to a country's spectrum management organizations.

If an operator expresses commitment, I would take this is a very important initial step, but not necessarily an indicator of full blown embracement of a platform. Operators will schedule time for a device to go through their certification labs. This means that a device can get approval from the regional spectrum bodies for qualifications that ensure the device doesn't interfere with authorized spectrum devices. Lab certification is not free- the operators are eating a cost. But certainly it's not the same thing as buying pallets of devices and trying to sell them to consumers.

</comment></comment><comment><USER4> I'm pretty excited about the possibility of Firefox OS gaining significant traction. If it were up to me Mozilla would be in just about every market online. They are great at keeping people honest. Between this and Identify Mozilla is coming back!

</comment><comment><USER5> Here's a video if anyone wants to see what one of these devices actually looks like: <http://www.engadget.com/2013/02/24/zte-open-hands-on/>

</comment><comment><USER6> I'm torn. On one hand, I really want Firefox to succeed. On the other, the blood of mobile operators is as dark and thick as tar. Can this end well?

</comment><comment><USER7> In list form:

* América Móvil

* China Unicom

* Deutsche Telekom

* Etisalat

* Hutchison Three Group

* KDDI

* KT

* MegaFon

* Qtel

* SingTel

* Smart

* Sprint

* Telecom Italia Group

* Telefónica

* Telenor

* TMN

* VimpelCom

<comment><USER8> Deutsche Telekom is known as T-Mobile here in the US. So, the #3 and #4 networks will support it. I wonder if AT&T or Verizon will chime in soon?

<comment><USER9> DT (non-US) and T-Mobile in the US don't operate as a single unit, so the former committing to Firefox doesn't mean anything in the US. As an example iPhone is available on DT, but not T-Mobile.

<comment><USER10> T-Mobile was a sponsor at the Firefox OS app day in Mountain View and had a speaker devote some time to why they thought it was a good thing.

While that doesn't necessarily mean a commitment to carrying devices running it, it'd an awful lot of effort to go to if that weren't likely at all.

<comment><USER9> Note that tmobile is moving to a sales model where you pay the full cost of the phone up front (although they do allow explicit 20 month payment plans). The result is cheaper service since it doesn't include the hidden costs of recovering phone subsidies (approximately $20 per month).

This will mean that US consumers will be seeing the true hardware price for the first time, and be able to make value judgements. Of course everyone expects the whole thing will fail because Americans are used to cell phones being really cheap, and tmobile has to try to convince people by doing arithmetic on lifetime costs, which is a far harder (and more complicated) sell.

I'm extremely sceptical that consumers will pay more for Firefox phones than iPhone and top end Android. And I have no doubt they'd pick Firefox (or anyone else for that matter) for phones that are "free", $50 or similar amounts, but those phones won't exist on tmobile except for feature phones around the $150 mark. Given a choice between a $350 Firefox or Android phone it will be interesting to see what happens, and the consumer will have to strongly consider if they are getting that much value from their purchase.

<comment><USER11> I have bought unlocked, new Android phones for less than USD100 in the UK, so I'm not sure I believe that a USD150 phone on US T-mobile will only be a feature phone.

ZTE and Huawei are just the beginning of the wave of cheap smart phone providers that I expect to destroy the feature phone as a widely used device in the rich world in the coming years.

Granted, the two phones I bought weren't very fast and had smaller screens, but they did have GPS, mobile data and ran all the apps that I tried from the Play store.

<comment><USER9> (BTW I'm a Brit living in the US). There are multiple issues in the US.

* The vast majority of phones are sold by carriers due to the subsidy model. This leaves a considerably smaller market for the rest. Note the carriers chose which phones to carry - they will not provide arbitrary phones. Note this also applies even when someone like Amazon or Costco sell phones as they act as an agent for the carrier and the prices shown are the subsidised ones, and the phones are the carrier ones.

* Because of that most consumers think phones already cost free/$100 or $200 for high end ones, and there is no incentive to buy a non-carrier phone since plans aren't any cheaper for a non-subsidised phone (with the exception of one type of plan on Tmobile and some of the pre-paid MVNOs).

* Of the big 4 carriers (~85% of all mobile users) half have a CDMA legacy and half GSM, so those phones you bought could only work on 2 of the 4 carriers anyway

* And even that wouldn't be enough. Many cheap GSM phones are tri-band. To work with voice in the US they need to be quad band (also support 850MHz). There are various issues with the data frequencies too (eg Tmobile's AWS band) and even differing LTE bands for newer/more expensive phones

* If you care about coverage then you generally have to go with one of the big 3 (tmobile has notoriously poor coverage except in the most populated areas). If you use an MVNO then you are typically limited to the hosting carrier's network only. As an example I'm a tmobile subscriber, but in various areas a lot of their coverage is actually provided as a transparent roaming arrangement by AT&T - you don't see roaming on your phone. Similarly Verizon and Sprint have roaming in various places. But when using an MVNO you would using the native underlying carrier coverage only which will be a lot smaller footprint.

* All phones have to pass the FCC certification which is added expense and time especially if your sales aren't going to be that high

* People don't visit other countries as much (proportionally). You could fit the UK (including NI, Shetland, Jersey etc) in 2/3rds of California. Montana is the same size as Germany. This means a huge internal market with virtually no external influence or need for interoperability. That said the Canadian market is even more messed up than the US one. I don't know about Mexico.

That said you can buy some cheap phones including below $100 - eg see Walmart <http://goo.gl/yoABV> but note they are usually locked to a prepaid carrier! This <http://goo.gl/KiUje> is what consumers usually see - the subsidised prices which get you better phones at "cheaper" prices.

</comment></comment></comment></comment></comment></comment></comment><comment><USER12> This is frakking awesome. This means that a considerable part of the world will get access to Firefox OS and afforable phones.

<comment><USER13> "It takes a one man to lead a horse to a river, but even forty cannot make it drink". Having access does not mean a lot will care.

</comment></comment><comment><USER14> I hope they don't do an Android I.e 18 fragmented broken rarely upgraded OS's with horrible carrier customisation.

This is the area that Microsoft with WinPhone 7+ and Apple with iOS have got right.

<comment><USER15> But that's what will happen. This looks destined to be a competitor to Android in the low-end space, allowing carriers and handset manufacturers to customize their offerings to differentiate them from the other cheap offerings.

<comment><USER16> It really amuses me that those Android phone manufacturers seem to believe customers gave a s--t about them trying to differentiate themselves from other brands. Actually, if customers obviously don't care about their horrible disimprovements, it only shows that they don't care at all. Do those managers even use their own gadgets? I believe not.

What I don't get is why they don't allow me to put a vanilla Android on the device. Oh, wait: they want me to buy a new phone when a major Android update comes out. Nope, guys, I'm gonna stick with iPhone or Nexus. Too sad the majority of customers likes to be fooled.

<comment><USER17> > Too sad the majority of customers likes to be fooled.

Not really fooled, just ignorant. Google is partially to blame for not marketing and cultivating Android as a brand more and leaving it up to OEMs (who mostly ignore it as a brand to differentiate once again).

</comment></comment></comment></comment><comment><USER18> Maybe someone here will know - is Firefox OS going to be customized by manufacturers like Android, or the same everywhere like Windows? I know it's open source so manufacturers could do whatever they want, but maybe there's some agreement I don't know about which will make them keep the standard ui. Anybody know?

<comment><USER19> As far as I know, the UI is completely HTML/CSS/JS and can be entirely replaced or customized.

Sadly that will just cause horrible fragmentation and bad design as it has for Android.

<comment><USER20> Yeah - I don't see why people are so excited about this. To me, it looks like the Firefox OS will end up being a carriers' vector to try and assert more control over the phone ecosystem again. Without a big player like Apple, Google, or MS to enforce some ground rules, the carriers can just completely screw with any phone.

I think this will be a miserable experience for consumers - think about it - why else would carriers be so excited?

<comment><USER21> Hopefully Mozilla can assert some control over when a carrier/manufacturer is allowed to call something "Firefox OS" (like they do with Firefox itself) so that there is a core brand which is un-crapware-ified.

<comment><USER22> Except mozilla has no real experience in marketing. So you are hoping they can build a brand big enough and powerful enough that carriers are willing to cast aside their main goal of differentiation from each other, just so they can call their phone a "firefox os" phone, instead of hiding what it runs and calling it whatever they want.

Good luck with that. :)

</comment></comment></comment></comment></comment><comment><USER23> Has/will Ubuntu Mobile, Tizen or any of the other minor players announced anything similar?

<comment><USER24> Ubuntu:

They sure would love to. Their last move was to call out for mobile operators and constructors.

If anything, this move will lower their chances (a mobile operator already committed to an endeavor might not risk another). They may get a niche market if their tech is good, however.

Tizen:

They will announce a market release, but really it depends on partnerships with mobile operators.

</comment></comment><comment><USER24> I feel the coming irony of the days when FirefoxOS will perform better and be faster than Ubuntu phones.

(It's already true, but since Ubuntu phones aren't there yet, the comparison is unfair.)

<comment><USER5> The low end ubuntu hardware specification is better than what they are showcasing FirefoxOS on at MWC currently. It's hard to guess what the end comparison will be once it's fully production ready.

Android and FFOS perform similarly on the same hardware platform for what it's worth - each have their own advantages in some cases.

</comment></comment><comment><USER25> Totally irrelevant until operators actually start selling and subsidizing the devices. Operators will support all OS's, it's in their interest to make sure there is competition at the device and OS level. True commitment comes when they start putting marketing dollars behind the real products.

</comment><comment><USER26> I love watching how incentives drive so many things I see around me.

Looks like the operators have just realised that Android is commoditizing their services and turning them into just dumb substitutable commodity data providers.

</comment><comment><USER27> How many phone OS do we need? I think the reason we have so many is the same reason we have so many different power connectors and screw heads. Because too many A$$hats are alive.

<comment><USER28> Competition is good.

If you're worried about connectors, it probably has a MicroUSB-b port, and you don't have to get it.

</comment></comment><comment><USER29> Suck it, Google. This is what you get for being control freaks and abusing all the other players. You cant own everything. You are going to lose the billing, application distribution and DRM battle for sure now. Your burgeoning YouTube- based media empire cum ChromeOS/DRM wet dream is destined for failure. Wake up and smell the roses. You _are_ evil. We hate you.

<comment><USER30> "The majority of our revenue comes from the search functionality in the Firefox browser. Google is the largest source of revenue and in December 2011, we announced that we negotiated a significant and mutually beneficial revenue agreement with Google. This new agreement extends our long term search relationship with Google for at least three additional years." -- <http://www.mozilla.org/en-US/foundation/annualreport/2011/>

<comment><USER31> I upvoted you because so many tend to forget this. Any comparisons of Firefox v. Chrome need to bear in mind the fact that development of Firefox is enabled by Google.

It's also important to note that the $1B they pay Apple isn't insignificant either:

[http://bgr.com/2013/02/11/google-apple-ios-default- search-1-...](http://bgr.com/2013/02/11/google-apple-ios-default- search-1-billion-324728/)

<comment><USER32> The only reason they pay is the marketshare firefox/safari holds.

If it wasn't google paying, it would be microsoft, with bing.

It would be a huge loss for Google currently. Don't doubt for a second that if Firefox marketshare falls under 5% Google will stop paying anything.

<comment><USER33> Don't be so sure. Google is also one of Opera's biggest clients, paying a significant sum to Opera for search traffic from their desktop browser, despite its much smaller desktop market share:

[http://www.zdnet.com/opera-google-extend-search-deal-for- two...](http://www.zdnet.com/opera-google-extend-search-deal-for-two- years-7000002997/)

Opera makes about $15M per quarter in revenue from its desktop browser:

[http://www.favbrowser.com/opera- software-q2-2012-financial-r...](http://www.favbrowser.com/opera- software-q2-2012-financial-results/)

<comment><USER32> ok maybe instead of 5% i should have said "an insignificant market share" (5% is still pretty big)

Even Opera's marketshare is significant.

But just imagine, for a second, that 20% of the internet just gets to use bing instead of google.com because it became the default overnight. Outch.</comment></comment></comment></comment></comment></comment>