New Dimension For Windows: Microsoft Puts 3D Printing Support Directly Into OS - simba-hiiipower http://www.geekwire.com/2013/dimension-windows-microsoft-adds-3d-printing-support/ <comment><AUTHOR> In PC based CNC systems, there is almost always dedicated hardware separate from the PC that is feeding the motor drivers, because Windows and Linux are not true real time operating systems. A cnc system must have a timing resolution much finer than is available in traditional general purpose operating systems.

In general terms, a cnc system must convert high level instructions, like G-code, in to voltage pulses that are fed to either stepper or servo motors.

Some of these calculations are performed on the PC, others are performed on the dedicated hardware. Do steps 1, 2, and 3, send step 3's result over usb to the controller, then perform steps 4 through 10.

Not everyone agrees where to place that barrier.

In the case of GRBL, which is the firmware that runs most of these hobbyist level 3D printers, the entire process happens on an 8 bit microcontroller, from G-code to steps.

Other cnc systems perform almost all of the calculations on the PC, and sends a representation of the timing information to the controller.

Still other systems decode the G-code into vectors and other intermediate representations, and let the controller do most of the heavy lifting.

Some systems transmit their data over USB, a standard ill equipped for industrial environments or cable lengths more than about 10ft. Others use ethernet. I'm sure there are others that use RS-485, or even proprietary protocols.

Is Microsoft accounting for any of these variations, or are they going to standardize everyone to whats popular today, which is usb and 8 bit microcontrollers that can't even create 50,000 steps per second?

<comment><USER2> It's easy to do realtime control on a linux box, simply run your program as root and disable interrupts. Every time you're 'safe' (stopped, or very low speeds) you can safely enable/disable interrupts to make sure all your hardware gets serviced and to poll for UI input. I've controlled a 3D mill/plasma cutter like this at very high speeds.

<comment><AUTHOR> That's not going to sell a lot of units, though. Its hard enough to get a machinist to set up a cnc system with a full gui. You want him to disable interrupts on Linux? Just shoot me now.

<comment><USER2> No, you can use a GUI, you just need to do your polling when you know it is 'safe'.

<comment><AUTHOR> I honestly don't have any experience with linux cnc. A lot of what forms my opinion is the controller's marketability. Many controllers do not ship with a PC, which is a great selling point on one hand, but a limiting factor on the other hand. If a controller came with, or just was itself, a dedicated host, and is the only supported host, then linux is definitely a viable option that doesn't create any barriers to entry. But if a company is simply building a controller, and requiring the customer to provide a PC, I see it as a no brainer business decision that the PC runs windows, and not linux.

</comment></comment></comment></comment></comment><comment><USER3> Hm. I wonder if it exports G-code, or simply says "Hey, let's write some proprietary drivers! It'll be fun!"

For once-- _for once_ \--we had a chance to break away from the lowest pit of IT hell: printing.

We could have done something beautiful, we could've made the world a better place--and yet, I fear that Microsoft is now just going to extend the failures of 2D printing into the third dimension, quite literally piling on layers of sadness.

<comment><USER4> I'm a Windows dev at build, but I know nothing about 3D printing. If you can you give me an idea what G-code is, then I'll ask or look at the SDK.

<comment><USER5> Think of G-code like PostScript. It's a description language that tells a multi-axis machine how to move in 3D space.

<comment><USER6> I was hoping for something a bit more vector based. G-code seems more like Logo than PostScript.

</comment></comment></comment></comment><comment><USER7> It is telling that I am more excited about Windows 8,1 than iOS 7.

<comment><USER8> I mean to me, all it indicates is Jobs and Hillel Cooperman were the only good benevolent product and aesthetic guys in the OS space.

</comment></comment><comment><USER9> This seems like it _could_ be bad news - they might be trying to make some sort of proprietary 'postscript for 3-D' to lock down the whole industry. Though I'm guessing my worry is probably unfounded.

<comment><USER10> PostScript is a well-defined, well-documented programming language. Introducing a new layer for 3D printing would be very cool, but in the end, G-code is the "native" language for most of the hobby (and maybe other) 3D printers out there.

<comment><USER11> I didn't see any reference to G-code in the article. I think the worry is that they will introduce a closed, proprietary standard in an attempt to build their platform.

I'm a bit conflicted. On the one hand, G-code is very compatible with the open source ethos, but on the other it's a very old standard that was originally intended for plotters. I'd love to see something better replace it that can say, use bezier curves.

<comment><USER6> This. G-code is more like Logo than PostScript. Something based on meshes and computational-computed surfaces (e.g. bezier curves) would work better. In fact, we could get most of the way there with OpenGL/DirectX at a low-level (meshes to specify a few vertex positions, hull shaders to to extrapolate additional vertices based on whatever algorithm you want).

<comment><USER12> OpenSCAD: [http://openscad.org/](http://openscad.org/)

Its about as close to being a "3D Postscript" as you could find these days ..

</comment></comment></comment></comment></comment><comment><USER13> I think this is excellent news (I am biased, I am working on a 3d printing startup). This will bring more awareness and accessibility to 3d printing to the masses.

<comment><USER14> > I am working on a 3d printing startup

What sort of startup?

<comment><USER13> p2p marketplace for 3d printing. [http://makermarket.co](http://makermarket.co)

</comment></comment></comment><comment><USER15> In practice, how is this different than simply being able to install a package? Furthermore, Ubuntu has 3d printing packages in the standard repositories, are we to believe this gives MS any sort of practical advantage?

<comment><USER16> Well mainly because all the decent 3d modelling packages run on Windows?

(Solidworks basically)

</comment></comment><comment><USER17> fedora 19: 100% 3D Printing Bring 3D printing tools to Fedora and allow users of 3D printers, such as RepRap, to be fully satisfied with software in the repositories, without having to download binary blobs or run Python code from git.

<comment><USER18> All of the big CAD packages (Solidworks, CATIA, Solid Edge, Pro-Engineer, Rhino, SpaceClaim, ...) are Windows only. Lately OSX has gotten some traction, but it's still pretty marginal.

There are translators (e.g. SolidWorks -> STEP, SolidWorks -> STL) that run on Linux, but the better ones, and the ones that support the proprietary formats (SolidWorks, CATIA, etc.) all cost money and couldn't be included in a Linux distro's software repository.

So even if Linux supported 3D printing out of the box, it wouldn't be as useful as if Windows did, IMO.

</comment></comment><comment><USER19> With this support embedded into the OS, now the NSA can get a direct report whenever you print a 3D gun part! Yay!

/I kid, they won't be real-time reports... Just batches.</comment>


Hundreds of millions of cable modems are vulnerable to Cable Haunt vulnerability - <AUTHOR> https://www.zdnet.com/article/hundreds-of-millions-of-cable-modems-are-vulnerable-to-new-cable-haunt-vulnerability/ <comment><USER2> But this is only an issue if your machine can see the broadband modem/router, right?

I've always run my own router. It's double NAT, I know, but I'd rather not open my LAN to the ISP.</comment>


Show HN: The Jizz Quiz: NSFW Game – 1 Porn Movie Title, 3 Thumbnails. Which One? - <AUTHOR> http://fuky.tv/jizzquiz/ <comment><AUTHOR> Made this build on top of various Internet Porn API's. Every few hours 20+ new random games. Good answer? You can watch the clip. 7 questions.</comment>


Why Parse the User Agent? - <AUTHOR> http://www.jefftk.com/p/why-parse-the-user-agent <comment><USER2> Unfortunately, encouraging people to parse the UA header leads to them getting it wrong in a way that would be amusing if it wasn't so irritating.

For example FirefoxOS has a UA string of the from User-Agent:Mozilla/5.0 Mobile Gecko/28 Firefox/32.0'. There's an example in bugzilla of a major site that, not only depends on the file details of that format, but will send the mobile version of the site if and only if the number after Firefox is _even_ and in the range 18 < = x <= 34.

Such examples are not one-offs either. In fact it is so common for sites to screw up here that browser vendors often resort to sending specially crafted UA strings to certain sites in order that the content become accessible. The most extreme example of this was pre-blink Opera which had much better compat than it was given credit for, but was often blocked — acidentially or intentionally — from sites that effectively whitelisted certain browsers. As a result it used an auto-updated list of sites for which it had to send an alternate UA string [1] as well as a sophisticated system of javascript injection to work around more complex bugs in these sites [2].

[1] [https://github.com/operasoftware/browserjs/blob/master/deskt...](https://github.com/operasoftware/browserjs/blob/master/desktop/spoofs.xml) [2] [https://github.com/operasoftware/browserjs/blob/master/deskt...](https://github.com/operasoftware/browserjs/blob/master/desktop/browserjs-12.50.js)

<comment><USER3> There's a whole class of old ASP sites that break if you take "like Gecko" out of the UA. It would be funny if it hadn't made me cry so often.

<comment><USER4> Why not just break them?

<comment> vertex-four Because then people use a competing browser that doesn't break the sites they use.

<comment><USER4> Seriously doubt it. Backwards-incompatible changes (mostly, deprecating some old kludges) had happened many times and I don't think there were any severe migrations.

I'm really not sure cons of User-Agent cleanup (or complete deprecation) outweigh the pros. At the very least I think it's not obvious and is debatable.

<comment><AUTHOR> What are the pros? Smaller requests are only going to have a very small effect on speed or bytes used.

<comment><USER4> Smaller requests, right.

Also, some privacy improvements by having less data for browser fingerprinting.

Also, if we'd consider dropping User-Agent header altogether, less ways to detect an UA, so a bit harder to show "sorry, your browser in unsupported, this site is IE^H^H Chrome-only"

Obviously, just UA header isn't even remotely sufficient for any of those reasons, but would be a good start.

</comment></comment></comment></comment></comment></comment></comment><comment><USER5> I do find it slightly strange that saving a few bytes from the size of an image is suddenly of such pressing importance that we need to resort to all these hacks.

JPEG2000 has been available in some browsers for years and years now, but I've yet to see any site selectively sending it to supporting browsers to save bandwidth, or anybody advocating for doing that. JPEG2000 first became available in browsers 10+ years ago when connection speeds were very much slower than today, so the benefit of using it was even greater back then, yet it saw very limited adoption.

Also I note that the saving from using webp compared to the optimised jpeg is only 18kb, meanwhile the page wastes 40kb of bandwidth on a Google analytics script. What Google gives with one hand it takes away with the other.

<comment><USER6> Also the appropriate way of declaring what browser supports should be done through the Accept http header.

</comment></comment><comment><USER7> I'm working on a single page application that heavily utilizes IndexedDB. While feature detection can tell the presence of it, it tells nothing about the quality of the implementation. For example, in Safari, inserting ~9k rows takes 10 minutes, and IE doesn't support compound key path. While it's possible to write custom logic to detect the latter, it's impossible to detect the former cheaply and reliably. I guess I have to resort to UA sniffing.

</comment><comment><USER8> The whole thing isn't worth as much as it as it seems.

In this case PageSpeed generated JPEG at significantly higher quality than WebP, so most of the file size difference is due to quality difference, not codec compression efficiency (distortion measured with DSSIM for JPEG is .009 and for WebP is .015)

If you make the comparison fair by creating JPEG (using mozjpeg) at the same quality as WebP it's 22539 vs 20158 bytes (11% saving).

<comment><AUTHOR> We set default quality parameters for PageSpeed with the goal of producing equal quality images between WebP and JPEG, on average (quality 80 for WebP, 85 for JPEG), but you're right that in this case the WebP image is more distorted as measured by SSIM. Sorry, and thanks for catching this!

Testing now with this image, to bring the DSSIM-measured distortion on the JPEG up to 0.015 [1] I need to encode it at quality=69, which gets me a file size of 24317 [2] bytes to the 20158 [3] I had for the WebP. This is 17.1% improvement for WebP over JPEG, as opposed to the 47.7% improvement I found before. This is all with libjpeg-turbo as included by PageSpeed 1.9.

Running mozjpeg (jpegtran) with no arguments built at commit f46c787 on this image, I get 23870 bytes with no change to the SSIM [4]. This is a 15.6% webp- over-jpeg improvement.

It looks like:

1) We should run some timing tests on the mozjpeg encoder, and if it's in the same range as the WebP encoder or not too much worse switch PageSpeed from libjpeg-turbo to mozjpeg.

2) We should check that quality-80 with WebP is correct for getting similar levels of distortion as quality-85 with JPEG. Is this image just a poor case for WebP or is it typical and something's wrong with our defaults?

[1] Technically, 0.014956 with JPEG compared to 0.015060 for the WebP.

[2] [http://www.jefftk.com/kitten-demo--ssim15-- pagespeed.jpg?Pag...](http://www.jefftk.com/kitten-demo--ssim15-- pagespeed.jpg?PageSpeed=off)

[3] [http://www.jefftk.com/kitten-demo--ssim15-- pagespeed.webp?Pa...](http://www.jefftk.com/kitten-demo--ssim15-- pagespeed.webp?PageSpeed=off)

[4] [http://www.jefftk.com/kitten-demo--ssim15-- mozjpeg.jpg?PageS...](http://www.jefftk.com/kitten-demo--ssim15-- mozjpeg.jpg?PageSpeed=off)

<comment><USER8> Thanks for looking into this. I'm aware that choosing right quality level is a hard problem.

If you only ran mozjpeg's jpegtran on a file created with another JPEG library, you won't get benefit of trellis quantization. Try creating JPEGs with mozjpeg's cjpeg (and -sample 2x2 to match WebP's limitation).

Here are the files I've been testing (one is same size, one is same quality based on my DSSIM tool v0.5): [http://i.imgur.com/O57WF19.jpg](http://i.imgur.com/O57WF19.jpg) [http://i.imgur.com/ZBD6ioD.jpg](http://i.imgur.com/ZBD6ioD.jpg)

<comment><AUTHOR> Is this the right set of arguments to be testing?

        $ mozjpeg/build/cjpeg
           -quality $quality
           -optimize
           -progressive

<comment><USER8> I suggest adding -sample 2x2 to ensure chroma subsampling is enabled.

<comment><AUTHOR> Will do.

Talking to some people here, they think your DSSIM tool [1] isn't what I should use. Specifically, they said it runs blur and downscale steps aren't part of the SSIM metric. They suggested using Mehdi's C++ implementation [2], which I understand yours is a rewrite of.

Presumably you think I should use your tool instead? What makes the (D)SSIM numbers from yours a better match for human perception than those from Mehdi's? Or should they be giving the same numbers?

[1] [https://pornel.net/dssim](https://pornel.net/dssim)

[2] [http://mehdi.rabah.free.fr/SSIM/](http://mehdi.rabah.free.fr/SSIM/)

<comment><USER8> I'm not sure if mine is better. I do fudge blurring with fast box blur approximations rather than a proper gaussian.

I have two issues with Mehdi's implementation:

* It works on raw RGB data, which is a poor model for measuring perceptual difference (e.g. black to green range is very sensitive, but green to cyan is almost indistinguishable, but numerically they're the same in RGB). Some benchmarks solve that by testing grayscale only, but that allows encoders to cheat by encoding color as poorly as they want to.

* It's based on OpenCV and when I tested it I found OpenCV didn't apply gamma correction. This makes huge difference on images with noisy dark areas (and photos have plenty of it underexposed areas). Maybe it's a matter of OpenCV version or settings — you can verify this by dumping `ssim_map` and seeing if it shows high difference in dark areas that look fine to you on a well-calibrated monitor.

I've tried to fix those issues by using gamma-corrected Lab colorspace and include score from color channels, but tested at lower resolution (since eye is much more sensitive to luminance).

However, I have tested my tool against TID2008 database and got overall score lower than expected for SSIM (0.73 instead of 0.80), but still better than most other tools they've tested.

</comment></comment></comment></comment></comment></comment></comment><comment><USER9> Author is going about this in completely the wrong way. The best way to determine if you should deliver webp or jpeg is to look at the browser's accept header [1]. In this header you will find a listing of what the browser is willing to accept and the order of preference.

[1] [https://www.igvita.com/2013/05/01/deploying-webp-via- accept-...](https://www.igvita.com/2013/05/01/deploying-webp-via-accept- content-negotiation/)

<comment><USER10> From the article:

"To emit html that references either a JPEG or a WebP depending on the browser, you need some way that the server can tell whether the browser supports WebP. Because this feature is so valuable, there is a standard way of indicating support for it: include image/webp in the Accept header. Unfortunately this doesn't quite work in practice. For example, Chrome v36 on iOS broke support for WebP images outside of data:// urls but was still sending Accept: image/webp. Similarly, Opera added image/webp to their Accept header before they supported WebP lossless. And no one indicates in their Accept whether they support animated WebP."

<comment><USER11> That's a good argument for the image host to sniff the UA string in the course of content negotiation.

It's not a good argument for crafting html that bypasses content negotiation.

<comment><AUTHOR> The problem with solving this in content negotiation is that breaks proxy caches. If you serve uncachable html that references either jpg or webp then you can serve those resources as "Cache-Control: public", and if you include a content hash or versioning in the URL then you can send a long cache lifetime. If you use the Accept or User-Agent headers to choose what image format to send them you need to issue a Vary header, and basically all proxy caches will treat that as uncachable.

There's some progress with "Vary: Accept" support, but "Vary: User-Agent" is probably never going to be supported.

</comment></comment></comment></comment><comment><USER12> Asp.Net 2.0 (and up to 3.5, which is still framework 2.0) sites use UA sniffing to determine which markup to emit for many built-in controls, like Asp:Menu. When Yosemite / iOS 8 / Safari 8 was released, anyone with a SharePoint 2007/2010 site had their navigation get all screwy. I know first hand how infuriating someone's badly designed UA sniffing can be; it happened to me, and I wrote up a fix for it [0].

Why did it happen in the first place? Where did the UA sniffing fall apart?

A poorly designed RegExp looking for "60" in Safari's UA without a word boundary or EOL check. The new Safari UA includes "600" in the relevant section, and suddenly SharePoint sites were sending markup intended for (now) ancient browsers - browsers that weren't even on the compatibility list for SharePoint in the first place.

UA sniffing does need to go away for determining what structure your markup sends to the user agent.

[0]: [http://blog.sharepointexperience.com/2014/10/did-safari- or-i...](http://blog.sharepointexperience.com/2014/10/did-safari-or- ios-8-break-your-sharepoint-2010-site/)

<comment><USER13> Due to using a moderately obscure browser, I've had problems with ASP.NET sites just plain refusing to include any version of the JavaScript they required for form submissions to work.

</comment></comment><comment><USER14> One of my systems uses the user agent "Sitetruth.com site rating system". This breaks some Coyote Point load balancers. Their parsing of HTTP headers breaks if the last letter of the header is "m". I had to stick an unnecessary "Accept _/_ " header at the end to bypass that.

I suspect that one of their regular expressions has "\m" where they meant "\n".

</comment><comment><USER15> Isn't the problem more that the browser can't be given multiple sources and types and allow it to chose what it believes is best?

User-Agent sniffing really does need to die. Part of me wonders what use UA headers serve beyond sniffing and analytics. EDIT: or the Accept (and content- type) header, but that's a next to worthless header anymore :-\

<comment><AUTHOR>
         Isn't the problem more that the browser can't be given
         multiple sources and types and allow it to chose what
         it believes is best?

How would this look? If you simply did:

There's no way for the browser to know which one it wants without downloading all of them, because extensions aren't special. But I guess we could extend srcset to let you specify content type:

<comment><USER16> You just described the new "picture" element. It's an element with one or more "source" child elements which each have a media query and a uri, as well as an img child element to use as a fallback for non-supporting browsers.

Browser support isn't really there yet but it's coming and since it has a built-in fallback you can use it now without requiring JS workarounds.

<comment><USER17> It's under consideration in IE so now would be a good time to vote for it since it's so much cleaner than srcset:

[https://wpdev.uservoice.com/forums/257854-internet- explorer-...](https://wpdev.uservoice.com/forums/257854-internet-explorer- platform/suggestions/6261271-picture-element)

</comment></comment></comment></comment><comment><USER18> I imagine that in the future with HTTP2 we could send the list of available browser features as HTTP headers such as Animated-WebP: Supported ? With HTTP1 the cost of sending long list of available features would be too big probably. But could HTTP2 solve this problem. If I recall correctly it only sends diffs of headers between subsequent requests in the same connection. Maybe that could be helpful for a class of problems like this one and similar.

<comment><USER19> I was just thinking a similar thing. If user agents have evolved to effectively become a way of saying "Our browser supports standards X" (where X is an awkward grouping based on which features vendors and browser versions originally supported the feature / standard), surely the ultimate solution is to provide a header enumerating support on a per-feature basis.

Obviously it would take a while for the standard to be adopted to the point where it was useful, but as a web developer I dream of a time when we receive a header that lists the supported features in the client (similar to the classnames modernizer adds to the document body, and probably eventually versioned) and no longer have to resort to either UA parsing OR javascript- based feature detection, both of which are hacks because this problem hasn't actually been solved properly at the standards level.

</comment></comment><comment><USER20> This is a great debate. I've thought about this quite a bit lately when the PageSpeed team was contacted by Microsoft [1] about the conflict between PageSpeed assuming that Android 4.0 can handle webp, and mobile IE masquerading as Android thus breaking on PageSpeed enabled sites.

The debate will never end but it's nice to understand the perspectives.

PageSpeed, plus other WPO tools and complex sites, want the first view to be fast and small. We measure our effectiveness on first-view speedup. The most effective way to get this is by UA sniffing. We know about the other mechanisms and use them too at times, but they don't produce results that are as good for metrics we care about. However we are pretty serious about doing a good job about robust UA parsing; we put more energy into getting this right than a web developer should be expected to expend. The downside (as Microsoft points out) is that when we have to make an update we can't push it to all our users instantly. We should consider mechanisms to dynamically load an updated UA-mapping from a server we control when PageSpeed starts up, but haven't started such an effort.

Browser vendors have their own legitimate motivations. Microsoft IE11 developers don't want to be punished for the shortcomings of earlier versions of IE, and want users of IE11 to get the best, most modern web sites possible, not the IE6 version. Microsoft justifiably wants servers to send mobile versions of sites to Windows Phones. I totally sympathize with their perspective. Chrome was in the same boat when it first launched so it has all kinds of masquerading in its UA and unfortunately still does. Same story, different decade.

[1] [https://code.google.com/p/modpagespeed/issues/detail?id=978](https://code.google.com/p/modpagespeed/issues/detail?id=978)

</comment><comment><USER21> Yay! Yet another image format that I can't open in Preview, if I save it to my hard drive.

Webp may be great for displaying in a web page, but it's TFU if I save it to my hard drive and try to view it with default viewing or editing software.

It may not be a proprietary format, but it might as well be.

<comment><USER22> It hardly seems fair to reject the format simply because Apple hasn't added support for it to their image viewer. At least here my desktop environment happily displayed the saved image with its built-in image viewer (Gwenview).

I'll admit that support for the format isn't perfect, but at least in your case it can be remedied pretty easily with a quick search [1]. That said, format adoption has to start somewhere. It'd be pretty sad if we were still using GIFs for all of our lossless images because PNGs were never allowed to catch on before they could become universally supported.

[1]: [https://github.com/dchest/webp- quicklook](https://github.com/dchest/webp-quicklook)

<comment><USER23> Thats odd, I have Gwenview 4.14.2 and qt 4.8.6, and webp doesn't resolve properly. Rekonq can't open it either, but Kolourpaint can and Krita cannot.

Is webp added in qt5?

</comment></comment></comment><comment><USER24> Isn't this what Accept: image/webp is for?

</comment><comment><USER25> It seems, for many of the reasons stated below, that feature detection in JavaScript will never be a sufficient solution. But clearly asking web developers to manually parse and interpret UA strings is asking for trouble.

Does anyone know if there is an authoritative database of user agent string, their associated browsers and the features of those browsers?

</comment><comment><USER26> I agree this is a decent solution, and the one OP compares to is not.

But I would have javascript feature detect, and set a cookie based on what it found. Now, for all but the first page, the server can look at the cookie instead of the User-Agent string. Server just needs to sniff user-agent string if it doesn't (yet) have a cookie.

</comment><comment><USER27> [https://hacks.mozilla.org/2014/11/an-easier-way-of-using- pol...](https://hacks.mozilla.org/2014/11/an-easier-way-of-using-polyfills/) also had a small bit on UA over feature-detection

</comment><comment><USER28> My personal approach...use feature detection for the first pass. User Agents for the cases where it doesn't work. And by the way, it doesn't always work, and some "features" cannot be detected.

I've spent a lot of time optimizing pages for video. Some browsers work just fine, some work but look like crap, so you use a flash/silverlight plugin, then a new version comes out and looks less crappy.

I also have a lot of code I turn off just for IE7...the code works, but doesn't render properly. There is no way to detect "renders ugly"

So, "YES", feature detection is the future...but it isn't quite there yet (about 98%).

</comment><comment><USER29> Mr Kaufman, JavaScript is like violence: If it isn't solving your problems, then you're not using enough of it.

[http://libwebpjs.hohenlimburg.org/](http://libwebpjs.hohenlimburg.org/)

</comment><comment><USER30> I have yet to see a solution that provides acceptable levels of client data and accuracy that completely avoids parsing the User Agent string. Feature detection alone won't cut it, and the converse is true as well.

So for the time being, the most effective method to optimize your website for the widest variety of clients, is to employ both User Agent parsing (server side) and feature detection (client side).

</comment><comment><USER31> The author dismisses feature detection as being "slow", but it's _much_ less error prone:

[http://www.stucox.com/blog/using-webp-with- modernizr/](http://www.stucox.com/blog/using-webp-with-modernizr/)

You can just cache the result in localStorage; you take a few-millisecond hit once.

Here's how the feature detection is done:

[https://github.com/Modernizr/Modernizr/blob/924c7611c170ef2d...](https://github.com/Modernizr/Modernizr/blob/924c7611c170ef2dc502582e5079507aff61e388/feature- detects/img/webp.js)

 __HOWEVER __, in this case (webp), it 's likely better to detect it on the server:

[https://github.com/igrigorik/webp-detect](https://github.com/igrigorik/webp- detect) (More info: [http://www.stucox.com/blog/client-side-vs-server-side- detect...](http://www.stucox.com/blog/client-side-vs-server-side-detection- for-webp/))

The only time you _really_ should be looking at the User Agent is if you're trying to do something like show a "Download for (Chrome|Firefox|etc)" button.

<comment><USER32> > The only time you really should be looking at the User Agent is if you're > trying to do something like show a "Download for (Chrome|Firefox|etc)" > button.

Amen.

<comment><USER33> I'm currently working on a site that uses react/flux with some use of media queries and size detection for rendering... effectively the phone and portrait tablet displays will be similar, and the desktop and large displays will also be similar... I'd prefer to be able to break this into two camps for the initial html sent to the browser (via server-side rendering) This way less is sent to the phone/tablet browsers to render initially... and less jarring change as other features load after initial display.

The only way to do this is browser sniffing.. although minimal.. for the most part if "phone" or "mobile" are in the browser I can send the lighter phone version... otherwise they initially get the desktop view. It isn't perfect, and to be honest, I'm doing more detection than just that.

There's also issues with where/when I can cash rendered output. And when/where I can cash certain results. For example the record id's for a given search will cache the first 10k id's so that paging becomes very fast, with the results limited to that set. Other queries will also be cached.

It really depends on what you are trying to do... growing from a few thousand users to millions takes some effort, planning, and thoughtfulness that isn't always the same.

The way I would design an app for a few hundred internal users isn't the same as for a public site, isn't the same for a very busy public site. You have to make trade offs or collapse.

Why should a phone user on a strained 3g connection get the content for a desktop browser.... By the same token, I _HATE_ when I get a search result for a page on my phone, and that site redirects me to m.site.com/ (no path after /)... I don't just design/develop web based applications, I'm also a user...

</comment></comment></comment><comment><USER34> I always wonder why the first browser to misidentify itself as something else wasn't sued.

I mean, I sure couldn't slap a "Internet Explorer" or "Netscape Navigator" splash screen on my shareware, but that's what they're doing in the User-Agent field.

<comment><USER35> Lying to people is not allowed, because you're tricking them into paying you based on false data. Lying to programs is allowed, because you're tricking them into working properly when they would otherwise fail. The first browser to do this had the same motivation as modern browsers do.

</comment></comment><comment><USER36> The fact that UA is so easily spoofed makes it a really poor choice.

Client side JS for feature detection can work well, I have a simple example in the code of [http://http-echo.com](http://http-echo.com)

<comment><AUTHOR> In practice webp isn't usually spoofed, and when it is it's by people who've thought through the consequences and are in a position to deal with potential breakages.

Client side feature detection can also be spoofed, but in practice that's bit a problem either.

</comment></comment><comment><USER37> On any decently sized site where you expect a user to visit multiple pages, you would load the optimized JPG on the first load, but also detect whether WEBP is supported, and if so, set a flag that will load WEBP for any additional loads.</comment>


0.30000000000000004 - <AUTHOR> http://www.google.com/search?q=0.30000000000000004 <comment><USER2> I have to question the value of CS educations when a post of this nature pops up every couple of weeks, as if it is news that floating point arithmetic as implemented today, is by its nature an approximation, and that this is more noticeable the less bits you have to play with, when working with values that can't be represented neatly.

Financial arithmetic? Convert to smallest unit and use integers or the currency data type du jour in your language, and don't act surprised when operations on 32-bit floating point don't yield the intuitively correct values.

If you understood the representation format, you'd understand why.

<comment><USER3> I don't think it's just that it's an approximation. We're used to doing math with approximations (0.33333...). What's unintuitive about it is that numbers with very simple finite expressions in decimal (0.3) can only be expressed by repeating binary floating points.

Even competent coders who usually work in higher-level languages can sometimes forget that the decimal representations they work with are actually approximations of binary numbers, which is responsible for other seemingly weird behavior (why does ~2 = -3?), and I doubt even most skilled computer scientists are used to converting decimals to arbitrary-precision binary in their head.

It _is_ unintuitive, and it's not like it's hard to explain why. "You'd understand if you were smarter" is a cop out.

<comment><USER4> Things get a lot easier when you're working with tools that help you out, even just a little.

Clojure here, FWIW:

(+ 0.1M 0.2M) => 0.3M

That 'M' suffix denotes a BigDecimal, which provides for arbitrary-precision decimal math (which Clojure's arithmetic ops dispatch to as necessary).

A similar 'N' suffix is coming in the next release that denotes (contagious) BigInteger math (though as fast as longs when values are < 2^31), so one doesn't have to worry about overflow issues (which rate up there with misunderstandings of internal floating point representations in terms of frequency).

Other reader syntax is provided for other common notations (e.g. 10e6, 16rFF, 0xFF, 0220, 2r100010101).

<comment><USER2> This seems like the right way to do it.

Though, I assume non-suffixed literals are still regular floats?

<comment><USER5> > This seems like the right way to do it.

It's also slow as molasses, which is why very few languages default to decimal floats and use IEEE floats (or doubles) instead, via their hardware implementation. The behavior of IEEE floats and doubles is very well defined, and though they are unfit in some sectors (you do not want to count money using them), have to be massaged a bit when displayed and don't deal well with great differences in powers-of-10 (e.g. 1e21 + 1 == 1e21) they work well enough in practice. And they're implemented in hardware.

<comment><USER2> I'm aware of the performance hit, I just like the approach of a BigDecimal literal instead of having to write that boilerplate.

<comment><USER5> > I just like the approach of a BigDecimal literal instead of having to write > that boilerplate.

Ah yes. Well not all languages require a bunch of boilerplate either. In Python for instance, there is a type decimal.Decimal which you can just alias to `d` and write:

        val = d('0.1')

<comment><USER6> I do wish there were a syntax for Decimal literals, e.g. 0.1D (analogous to 100L as long, etc.). Maybe I'll make it my weekend project even if I don't really expect it to be accepted into CPython proper.

<comment><USER7> I'm pretty sure the L syntax has gone away in Python3, with numbers being auto-promoted to Long if they're going to overflow. I'm a bit hazy about this, but I think I talked to the maintainer over lunch at PyCon two years ago.

<comment><USER6> There's actually no externally-visible long type at all in Python 3, it's all done transparently now. That said, I'm not using Python 3. The promoting behavior you speak of is how Python 2 works.

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER8> Apple's Calculator app used to have an odd floating point rounding behavior (I filed a bug report and they fixed it):

        14479.14
        -
        152.36
        =
        (result is 14326.78)
        1143
        /
        78
        =
        (result is 14.6538461538461)
        14479.14
        -
        152.36
        =
        (result is 14326.7799999999884)

Note that the first and third calculations are the same, yet they resulted in different displayed results!

I never understood this bug. I understand floating point, so understand that some numbers are not exactly representable. However, it should at least still be consistent! The same calculation should give the same results every time.

<comment><USER9> I suppose it depends how exact you are in defining 'same calculation' -- two possible causes of inconsistency are:

* FP means the rules of algebra do not hold, so if the calculation is done in a different equivalent form, you can get a different result.

* With Intel's old FPU unit, if a value is written to memory rather than staying in registers you can get a different result.

</comment></comment><comment><USER10> Welcome to the best lectures of your life:

[http://webcast.berkeley.edu/course_details_new.php?seriesid=...](http://webcast.berkeley.edu/course_details_new.php?seriesid=2010-B-26353&semesterid=2010-B)

also available via iTunes U. I'm currently listening to them on my commute. Note, if you do actually go through the whole course -- you'll need to listen to a different year for lecture 24 or so -- that one is skipped. One of the highlights of my day is actually coming home and re-looking up what he's talking about.

(Oh, and of course you can just listen to the two Floating Point lectures. It has to do with the non-uniform -- or at least non-linearly uniform mapping of numbers, represented with a significand/mantissa and an exponent, onto the set of real numbers + the fact that the exponent used is in base 2, in the hardware, so the floating point numbers are spread about in a particular way. The difference between real numbers, as you tick up the odometer with each bit, varies depending on where you are in the number line (with big numbers, it's actually much more, with smaller numbers it's pretty minimal, but not unnoticeable as seen with this example. Does that make sense? Maybe I'm off about this... Anyway, still obviously recommend the lectures. And now, I'm going to read up more on ALUs and MUXs..)

</comment><comment><USER11> <http://0.30000000000000004.com/>

Because why not? I've populated it with some languages that I can convenient access to an interpreter for. If you post/send me .1 + .2 in any other languages, I'll try and put them up.

<comment><USER12> GHC (Haskell):

      $ ghci
      GHCi, version 6.12.1: http://www.haskell.org/ghc/  :? for help
      0.1 Loading package ghc-prim ... linking ... done.
      Loading package integer-gmp ... linking ... done.
      Loading package base ... linking ... done.
      Prelude> 0.1 + 0.2
      0.30000000000000004

And just for fun with GHC's rational numbers:

      Prelude> :m + Data.Ratio
      Prelude Data.Ratio> (1 % 10) + (2 % 10)
      3 % 10

Hugs (Haskell):

      $ hugs
      Hugs> 0.1 + 0.2
      0.3

bc:

      $ bc
      0.1 + 0.2
      .3

Gforth:

      $ gforth
      0.1e 0.2e f+ f. 0.3  ok

dc:

      $ dc
      0.1 0.2 + p
      .3

<comment><USER11> Thanks, I've added them. Not only do I not have an interpreter for any of these languages handy, I've never even used them!

<comment><USER12> You're welcome.

bc and dc are probably installed on your Linux or Unix box.

By the way, you should fix "Below are some examples of sending .1 + .2 to standard output in a variety of common languages." to "[...] in a variety of languages."

It also seems like the names of bc and dc are non-capitalized.

For the Haskell entry, please just shorten it to "0.1 + 0.2". The "Prelude>" thing is just a prompt for the REPL. ":m + Data.Ratio" loads the rational number module, please take the entry about Haskell's rational numbers out since yours is a page about floating point. (You might want to replace it with a comment, that Haskell supports rational numbers. But so do lots of languages in their libraries.)

C would be a good addition. (Plus Fortran, Cobol, Ada and J.)

<comment><USER11> Fixed. I've moved the rational number stuff to a comment, I'm working on the formatting, but I think what I've got now works.

<comment><USER12> Good. By the way, having OR in the middle column and AND in the right column seems a bit strange.

</comment></comment></comment></comment></comment></comment><comment><USER13> This is the type of thing that makes mathematicians flying tackle computer scientists.

the CS: "Hey, it's round off error. Get used to it"

the Mathematician: "Fix IT!!"

<comment><USER14> It's not "round off error", though. More like:

"It's a base 2 fractional number with no exact decimal expansion with a finite number of digits. Display it in base 2 fractional form if you don't want to see an approximation."

<comment><USER15> Well, it's more like:

Binary numbers are a countably infinite set. Decimal numbers are a countably infinite set. You can therefore map binary representation to decimal representation 1-1 with a simple mapping function.

OTOH, floating point numbers are an uncountably infinite set. The only way to map binary numbers to floating point numbers is to map to a strict subset.

The subset happens to be different when mapping binary to floating point and decimal to floating point when using IEEE754.

<comment><USER16> The mathematician: That's fine for 22/7. Now, go fix your computer so it knows how to count to 0.3, kthxbye

<comment><USER14> 0.3 is a rational too, it's just 3/10.

Anyway, mathematicians don't use _numbers_ at all - debasing the equations by performing _caculations_ with them is so.. gauche. Leave that to the physicists, chemists and engineers.

<comment><USER12> I saw the occasional number in my studies.

We'd rather calculate with knows than numbers. (See <http://en.wikipedia.org/wiki/Knot_theory>)

</comment></comment></comment></comment></comment></comment><comment><USER16> It gets funnier: [http://ma.rtinseeba.ch/post/1344678900/double-considered- har...](http://ma.rtinseeba.ch/post/1344678900/double-considered-harmful)

</comment><comment><USER17> <http://stackoverflow.com/search?q=0.30000000000000004>

</comment><comment><USER18> From Slashdot: [http://developers.slashdot.org/story/10/05/02/1427214/What-E...](http://developers.slashdot.org/story/10/05/02/1427214/What- Every-Programmer-Should-Know-About-Floating-Point- Arithmetic?from=rss&utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+Slashdot/slashdot+\(Slashdot\))

Every programmer forum gets a steady stream of novice questions about numbers not 'adding up.'...

</comment><comment><USER19> Leaving ego's aside, while the reasons for this are obvious to anyone who learned programming with binary and old school stuff like that, there is a whole genre (class) of programmer that has learned what is needed to build web sites and unless you have large scale issues (which you solve by hiring someone with old school CS skills) you can happily be competent and successful without every knowing about how languages implement floating point math. I think it is wrong to belittle these people because I have worked with them and sometimes, I have found, it is their skills that are more often more influential in the success of a product that the CS guy in the back room tweaking the slab allocator. Times have changed. It's no longer crucial for every one who deserves the title 'developer' to know about these kinds of language nuances.

</comment><comment><USER20> Brendan Eich (Creator of JS) discussed this here: <http://www.aminutewithbrendan.com/pages/20101025> as it pertains to JS, but it is similar for other languages that implement IEEE double precision numbers

<comment><USER21> I think ECMA script uses double-precision 64-bit binary format IEEE 754 values for all number storage, or are there browser differences I don't know about which cause problems?

</comment></comment><comment><USER3> People often say "Just use (x) decimal arithmetic system for important stuff like finances."

Out of curiosity, I'm wondering how much trade you would have to be doing for floating-point imprecision to cause an actual problem.

Taking 0.2+0.1 as an example and figuring an imprecision of $0.00000000000000004 per $0.30, figuring a loss of one cent as being significant, I have 0.01/(0.00000000000000004 / 0.3) = 7.5e13, or... seventy- five trillion dollars?

Never mind that you're as likely to get 0.6+0.1 = 0.69999999999999996, which should roughly cancel out the error over time.

This is basically just an aesthetic problem in finance, yes?

<comment><USER22> There is a term for this in mathematics and now I can't remember it, but with some systems, e.g. number crunching with large matrices, a very small change like this can magnify into huge differences and give you totally wrong results. It's definitely something you must be aware of and take into account.

<comment><USER23> Conditional stability?

<comment><USER12> The other related term is `stiffness'.

</comment></comment></comment></comment><comment><USER24> If you really want precision and you're dealing only with rational numbers, it's better to maintain a struct rational { u64 numerator, denominator; }; and do all calculations with it.

</comment><comment><USER25> Funny thing. Google has this page at rank 5 by now (after 42 mins).

<comment><USER26> Hacker News has intrinsic value

</comment></comment><comment><USER27> I remember the discussion on floating point and talking about BCD (we had assembler on and IBM/370), but I get the feeling BCDs are not talked about much anymore given some of the discussions I've had over the years. A related thing to watch out for is any arithmetic with units and how to deal with fractional conversions. This could cost you a lot of money or mess up and inventory if handled poorly.

</comment><comment><USER28> People who see this fall into one of two kinds: those who are shocked by this, and those who are shocked by those who are shocked by this.

<comment><USER29> Actually there's a third category of us who understand why it happens and understand why others don't understand.

</comment></comment><comment><USER30> I just tried this in javascript (via Firebug) out of curiosity and it's the same problem.

0.1 + 0.2 = 0.30000000000000004

<comment><USER5> > and it's the same problem.

it's not a problem.

<comment><USER31> It's not a bug, it's a feature or better said it's a known issue which should be taken into account when writing a program that uses floating point numbers.

<comment><USER32> I consider it a bug in the specification that all numbers are floating-point in javascript.

</comment></comment></comment></comment><comment><USER33> <http://docs.sun.com/source/806-3568/ncg_goldberg.html>

However, my problem is that modern language are hiding these things for you.

</comment><comment><USER34> Is this IEEE-754 specific?

If so, are there any IEEE-754 alternatives?

<comment><USER35> Yes it is IEEE-754 specific. I think any binary floating point will have similar pitfalls though.

Python has a Decimal type that can represent decimal values exactly. It must be imported first though. It is probably much slower than IEEE-754 floating point, but for many uses that is not an issue. <http://docs.python.org/library/decimal.html>

</comment></comment><comment><USER36> irb(main):002:0> 0.1 + 0.2 => 0.30000000000000004

</comment><comment><USER37> I want a QPU unit!

</comment><comment><USER38> If only IEEE 754-2008 would gain traction...</comment>


Forecast Bar is the next best thing to having Dark Sky on your Mac - <AUTHOR> http://www.cultofmac.com/389845/forecast-bar-mac/ <comment><AUTHOR> Here is what is new in version 2.0: [https://medium.com/@forecastbar/forecast- bar-2-0-the-very-be...](https://medium.com/@forecastbar/forecast-bar-2-0-the- very-best-mac-weather-app-gets-even-better-8bfa944b6dc0)</comment>


PyKinect - write kinect applications using python - <AUTHOR> http://pytools.codeplex.com/wikipage?title=PyKinect <comment><USER2> Is it windows only? A shame if it is. I would love to hack around with it on a mac.

<comment><USER3> I the Kinect SDK is Windows only.

[[http://research.microsoft.com/en- us/um/redmond/projects/kine...](http://research.microsoft.com/en- us/um/redmond/projects/kinectsdk/download.aspx)]

<comment><AUTHOR> it has been ported:

<http://openkinect.org/wiki/Main_Page>

<comment><USER4> Libfreenect is not a port of the MS Kinect SDK, it is a low level API that allows for access of the basic Kinect hardware functionality but doesn't support features that the MS Kinect SDK does, like skeletal tracking. OpenNI, on the other hand, is a cross platform library that supports high level features like skeletal tracking, so that would be the way to go if you want to use a cross platform library that let's you take full advantage of the Kinect.

This Python library is a wrapper for the MS Kinect SDK, so it is windows only, specifically Windows 7 only.

<comment><USER5> Any suggestion where I can get a solid overview of what it takes to hack the Kinect on non-Windows machines? Forums haven't cut it for me, and I don't want to go out and buy a Kinect if the language/toolkit isn't great.

<comment><USER6> There's a lot of really great support in the robotics community. ROS, Robot OS, works great in ubuntu and makes it really easy to get data out of the kinect.

<http://www.ros.org/wiki/kinect>

</comment></comment></comment></comment></comment></comment><comment><USER7> I bought an Xbox 360 with Kinect like 5 months ago and I haven't really had a chance to play a cool game with it. So I guess its time to sit down and hack something with it</comment>


The iPhone Haters - <AUTHOR> http://www.newsweek.com/id/145435/output/print

<comment><USER2> "Get ready for the second coming: the iPhone 3G—which can run only on AT&T's third-generation (3G) cellular network—goes on sale today."

I found the error, what do I win?

</comment><comment><USER3> Interestingly the Newsweek article was almost completely made up of excerpts from posts off the web. Is this the future of the traditional print media?</comment>


What Are the Advantages of a Cloud Server Over a Dedicated Server? - <AUTHOR> <comment><USER2> A few I can think of:

1\. Want to resize your server? you can do it. 2\. Want to create a new server and move some kind of elastic IP to point to this new server? you can do it with most cloud providers 3\. Want to backup the whole disk, very easy to do it. 4\. Want to spin up a 1000 instances for an hour? cloud servers can do it. 5\. Want hourly pricing? cloud servers can do this.

</comment><comment><USER3> A few things to add here:

1\. dedicated servers are capital expenses. 2\. cloud servers are operational expenses, which is usually preferred.

If terms of actual operations I do not really see a huge difference. Both require a decent amount of preparation, tooling these days is awesome and you can have your own cloud servers with ease and enjoy the same tooling.

E.g. [https://www.terraform.io/docs/providers/openstack/index.html](https://www.terraform.io/docs/providers/openstack/index.html)

The biggest benefit of cloud servers: if you have no clear view what your project _will_ need, this is the place for experiments.

The biggest benefit of dedicated servers: being in control. You control the uptime, and thus SLA fulfilment.

Biggest danger of cloud servers: paying too much because you have no picture of what work loads will incur which costs.

Biggest danger of dedicated servers: overdoing it, when all you need is a simple machine.

</comment><comment><USER4> There are three fundamental differences:

1\. Upfront ownership costs versus hardware rental costs.

2\. Performance optimization versus versatility optimization.

3\. Maximum administration capability versus maximum maintainability and reliability.

I mention these three pairs of axes because with the notable exception of ultra-low network latency and the ability to quickly expand or diminish computing power (both of which fall under 2), you can reasonably achieve everything in either a cloud computing or dedicated hardware environment.

If you have a lot of upfront cash and you're intimately familiar with your long term computational needs and upgrade requirements, it probably makes more sense to use dedicated hardware. This generally doesn't describe young companies. You can amortize the cost of the hardware over the lifespan of its use and you'll typically find it's far cheaper (orders of magnitude) to run a dedicated server _on a 1:1 cost basis._

If you aren't aware of what your computational needs will be within the expected lifespan of new hardware, it is safer to abstract your resources to a cloud environment. Naturally this will be more expensive over the long term, but it will hurt less if you're e.g. just trying to build a product and validate it without committing to large capital requirements.

From there it depends on use case. If you have performance requirements that restrict the amount of network latency you can tolerate, dedicated hardware is obviously better and more predictable. You can colocate it if need be, though this comes close to cloud computing unless you actually own the hardware and merely use a datacenter for the networking advantages. If you have reliability requirements that can tolerate reasonable network latency, cloud computing is better for redundancy.

Theoretically you can even buy much larger dedicated computing capacity than you need, virtualize it in whichever custom configuration you want, and simulate the "burstability" of cloud providers. But you won't get the regional redundancy this way.

The last major difference is maintainability. If you operate your own dedicated hardware, you become a sysadmin for it. This can be very empowering, but it can also be a huge time suck, especially for companies that don't need that sort of customization capability.

There's otherwise no inherent difference - the cloud is just someone else's computer after all. Generally speaking any business use case can be thrown onto either platform, and you'll want to do a cost benefit analysis on which will be more stable, align more closely with your needs and satisfy budget requirements. Personally I own and operate what could be considered a small supercomputer in my home, and the only thing I use cloud resources for is redundant backups.</comment>


What is the cause of a huge interest in SWE interviews in December 2014? - <AUTHOR> https://trends.google.com/trends/explore?date=today%205-y&q=google%20interview,facebook%20interview,microsoft%20interview,amazon%20interview <comment><USER2> It's the movie "The Interview" on platforms that happen to also do a lot of interviews themselves. False positive.

If you filter trends to just that week and look at related searches, it's very clear.

[http://www.imdb.com/title/tt2788710/](http://www.imdb.com/title/tt2788710/)

<comment><USER3> The search engine equivalent of inter-modulation interference.

</comment></comment><comment><USER4> A movie titled "The Interview" which released in 2014.</comment>


Draw.io releases open source desktop versions - <AUTHOR> https://www.facebook.com/drawioapp/posts/1628618103829386 <comment><USER2> For someone who uses Draw.io a whole lot at work this is great news

Since it's an electron app, I suspect there's going to be the flak about the memory usage.

But at the end of the day, these electron apps are fulfilling the need of users who enjoy desktop experiences of their essential web apps

<comment><AUTHOR> We're looking at about 60MB on macOS for a small diagram. Another thread reports Win asking for 175MB.

But as you say, it was electron or nothing for us, no way we can justify native apps.

<comment><USER3> Using ~110MB for me on Windows. Considering you can get 8GB of RAM for ~£54[0], running this application is costing me roughly 61p worth of RAM when open. Or, looking at it a different way, on a modest system I can run 720 versions of this program.

Honestly in an age where memory is so cheap I'd much rather have an Electron app for every conceivable thing (which take a fraction of the time to create) as opposed to fully fledged applications that only do a few things.

E: Having the tab open in Chrome appears to use more memory for me[0], perhaps because of the extensions I use?

[0] [https://www.amazon.co.uk/HyperX-FURY-DDR3-Memory- Module/dp/B...](https://www.amazon.co.uk/HyperX-FURY-DDR3-Memory- Module/dp/B00J8E92M6)

[1] [https://puu.sh/xbNzL/503e54735e.png](https://puu.sh/xbNzL/503e54735e.png)

<comment><USER4> Every time electron apps come up, I bring up slack. It's currently using 1.3GB on my machine. I've got Spotify open too, with another 800MB. Adding another 8GB is easy at the lower levels, but I've got 32GB of ram in this machine, and regularly have to kill slack and spotify when compiling to get back 2-3GB.

<comment><USER5> Does anyone know if there are any lightweight alternatives to Electron in the works? Or if such an idea even makes sense?

<comment><USER6> There are a few options.

[http://alternativeto.net/software/electron/](http://alternativeto.net/software/electron/)

One thing about these is that Electron can be optimized. I believe that one of the Visual Studio tools uses it and has dramatically lower memory than slack. Slack just doesn't try to improve performance.

<comment><USER7> Like to see Alternatives to electron as well - even super optimized electron on code Atom and Google Chrome are quite heavy on a MacBook Air

</comment></comment></comment></comment></comment></comment></comment><comment><USER8> Oh, this is absolutely incredible!

Draw.io is definitely in the top 10 of the most useful apps I've ever encountered. I'm constantly using it to illustrate my blog posts and videos, for mindmapping, for drawing diagrams that help me to understand some new idea I'm learning about(like React/Redux or Docker). And for website mockups of course.

If you haven't used it yet - I highly recommend it!

</comment><comment><USER9> For those wondering, it's draw.io wrapped in an electron app.

<comment><USER10> At ~175 MB with a blank drawing open, I've seen worse.

Some things I noticed about the menus (on Windows):

\- The menus don't have hotkey support (Alt+…)

\- The File menu is missing a Close option

\- Submenus swich too soon on diagonal mouse movement

I'd suggest switching to native Windows menus. From other Electorn apps it seems this should be possible. I'm sure a way can be found to make the menu search feature work, too.

Another small note: on Windows, the close confirmation has the newer multi- option layout, the same you'd get when overwriting files in Explorer, but it only has an option to save changes. There is a cancel button, but that should really be an option.

Edit: memory measured with:

        Get-Process -Name "draw.io" | %{$_.PM} | Measure-Object -Sum

I don't know if that's the right way to go about it.

<comment><AUTHOR> Good feedback, thanks.

</comment></comment></comment><comment><USER11> Repo source: [https://github.com/jgraph/drawio- desktop](https://github.com/jgraph/drawio-desktop)

</comment><comment><USER12> For those worried about the electron memory usage, I'd recommend yEd from yworks.com. I've used it as a portable app at home and work and it's full featured and small.

<comment><AUTHOR> I just ran up yEd on my MacBook, 240MB with a blank editor. draw.io Desktop is taking 60MB. Do you have other figures?

</comment></comment><comment><USER13> I wish there was a desktop app that allowed me to draw diagrams in "vector" ascii art that I could then process with `dia` or another similar program to produce images.

<comment> bump-ladel Not exactly what you want, but macOS users can use the brilliant Monodraw to create ASCII images.

[https://monodraw.helftone.com](https://monodraw.helftone.com)

<comment><USER14> Damn, that's really cool. Wish it wasn't mac only :(

<comment><USER15> There are a number of alternatives, some of which are outlined here: [https://unix.stackexchange.com/questions/126630/creating- dia...](https://unix.stackexchange.com/questions/126630/creating-diagrams-in- ascii)

</comment></comment></comment></comment><comment><USER16> Does anyone have reasons why I might choose Draw.io over Gliffy? One major reason I use Gliffy is for Confluence integration at work, but I'm not opposed to using another tool and uploading the images if it is better.

<comment><AUTHOR> [https://marketplace.atlassian.com/plugins/com.mxgraph.conflu...](https://marketplace.atlassian.com/plugins/com.mxgraph.confluence.plugins.diagramly/server/overview)

The key driver for the way we approach draw.io is the trust issue that all SaaS apps suffer from. Not only do they have your data, they have the app as well.

We always followed the approach of never store user data. On the app side of things, open sourcing the codebase went part of the way, but you'd still have to be technical enough to serve the app.

The Desktop versions are critical in that regard, you know you've got a tool that can't be taken away that will always open your diagrams (which you control the storage of).

You don't hear SaaS providers talking about this, because giving up control means lower profits, less chance of an IPO.

<comment><USER16> Awesome, thanks for the response!

</comment></comment></comment><comment><USER17> How does draw.io compare to yEd?

</comment><comment><USER18> What I really need is an open source alternative to Sketch app (in electron?)

<comment><USER19> [https://www.designer.io](https://www.designer.io) not open source though ...

<comment><USER5> Wow that's neat, thanks for sharing!</comment></comment></comment>


Packaging and the tide of history - <AUTHOR> http://vagabond.github.io/2013/06/21/zz_packaging-and-the-tide-of-history/

<comment><AUTHOR> This was a followup to _Packagers don 't know best_ [[https://news.ycombinator.com/item?id=5920921](https://news.ycombinator.com/item?id=5920921)]. I think the writer, who received considerable criticism here on HN, really just dug his trench a little deeper with this. The whole theme - and the fundamental us-vs-them tone of the article, as though packagers weren't themselves developers (they very often are) - really intensifies a divide that the DevOps movement tries to resolve; moreover, the example of bundler, shrinkwrap et al simply demonstrates the unfortunate case of NIH that many developers have about packaging: they are, in an echo of Greenspun's tenth rule, doomed to reinvent it.

The fact is that application publishers cannot be relied upon to maintain upstream currency of bundled components, and this is the motivation for disaggregation. System administrators are always more interested in maintaining the integrity of their servers and reliability of their services - especially the security facets thereof - than in pandering to a developer who, experience tells us, has a decent chance of not being around in a year's time.

The best integration I have yet seen of language-specific and OS-level packaging is in FreeBSD's BSDPAN framework for Perl, where language-installed modules automatically appear in the package database so that their lifecycle can be properly managed. That's a much more constructive solution that actually tries to bridge the divide, and I would like to see more of it.</comment>


Show HN: Experimental chat written in Common Lisp - <AUTHOR> https://github.com/ryukinix/lisp-chat <comment><USER2> Add this:

[https://github.com/rongarret/tweetnacl/blob/master/ratchet.l...](https://github.com/rongarret/tweetnacl/blob/master/ratchet.lisp)

and you can turn this into a state-of-the art encrypted chat.

(Note that to _really_ turn this into a secure chat you need to also add key management code. I'm working on that part now.)

<comment><AUTHOR> Seems pretty nice! Thanks for share it.

<comment><USER2> My pleasure. If you do decide to integrate it let me know.

</comment></comment></comment><comment><USER3> When I found both client.py and client.lisp, I thought it would be nice to see direct lisp/python comparison. However, turns out Python version does much more that Lisp one (it maintains edit field even if other people send the messages), so no direct comparison is possible.

Author, can you add a simplified python client with exactly the same functionality as the lisp one?

<comment><AUTHOR> As you requested: [https://ghostbin.com/paste/zba9f](https://ghostbin.com/paste/zba9f)

This is the simplified version making the same output of the lisp version.

I was wondering about race conditions when I try close the read stream on finally keyword. Seems crash sometimes. However I never got this on the Lisp version. Funny.

I hope you like it. Maybe I should push this version to the repository?

</comment></comment><comment><USER4> I'm learning Lisp right now so I'll definitely try this out when I get home. It's nice to go and read other's Lisp projects.

I love the brevity of this code! Awesome work.

Are you on Lainchan?

<comment><AUTHOR> Thanks for look it! I did that as exercise to topics of multi-threading, streams and sockets using SBCL. I added later a Python version (using ncurses as bonus) to non-lispers can test.

On client written Lisp I have a problem with asynchronous STDIN and STDOUT yet. When the user is typing a message input, a message from server may comes and print in middle of the input, so the console will be mixed with stdin and stdou... a messy. .

After looking for a solution almost everybody points to use curses... but I was hesitant for it because I wish keep server and client as more simple possible. As was proposed, the Python client using curses doesn't has this problem and works fine.

Curious question about Lainchan. In another days I posted some programming related stuff on there and a personal music album. Why are you asking?

<comment><USER5> Take a look at the first picture in your readme :)

<comment><AUTHOR> Oooh... this is really obvius >.< Thanks. It's because I'm really a big Lain fan. Lain for all.

<comment><USER4> I love Lain.

</comment></comment></comment></comment></comment><comment> m-j-fox Cool.

I'm not sure that using quicklisp that way is kosher. Quicklisp doesn't allow you to pin a particular version of a dependency. The upshot is that your code that works today may not work tomorrow.

I've been looking for a best practice and all I can seem to come up with is make a bundle and include it in your repo.

[https://www.quicklisp.org/beta/bundles.html](https://www.quicklisp.org/beta/bundles.html)

<comment><USER6> Quicklisp does let you pin to a particular release, or make your own distribution, both of which will handle this. There is also qlot for more fine-grained dependencies.

</comment></comment><comment><USER7> besides, that shows me how well readable lisp code is. even better than python.

<comment><USER8> What ? maybe I'm stupid, but to me the python version seems a a lot more readable. It's only me ? (maybe because I don't know lisp, but neither python, so should be the same)

<comment><USER7> What programming languages do you know? If you know one or some algol-like one their syntax is very similar to each other and very different from lisp-like langs.

</comment></comment></comment><comment><USER9> What I do not understand: Why not write a simple IRC (or even XMPP) client – but an "IRC-like" client? The documentation is out there. Do people feel special when their software is incompatible with older software without having features that make incompatibility a necessity?

Internet Relay Chat: Client Protocol [https://tools.ietf.org/html/rfc2812](https://tools.ietf.org/html/rfc2812)

Internet Relay Chat: Server Protocol [https://tools.ietf.org/html/rfc2813](https://tools.ietf.org/html/rfc2813)

<comment><USER6> I think many people overestimate how complicated the IRC protocol is. A minimal IRC client is much less work than one would expect.

<comment><USER10> Last time I was thinking about it the number of non-standard extensions combined with there being multiple RFCs involved if you want to support more than minimal features led me not to consider it for my hobby/learning project.

</comment></comment></comment><comment><USER11> Why did you choose SBCL among the several other common choices available? Thanks.

<comment><USER12> Not the OP, but my guess would be because SBCL is the fastest known _free_ implementation of Common Lisp.

<comment><AUTHOR> Yes.

</comment></comment></comment><comment><USER13> read eval transport print loop

<comment><AUTHOR> RETPL. HAHAHA

<comment><USER13> is this a common acronym ?

<comment><USER14> I think maybe lerax had a dyslexic moment and thought it was REPTL, which would be a little funny (reptile).

<comment><USER13> I thought it was a ROTFL synonym...

</comment></comment></comment></comment></comment><comment><USER15> Well done, manoel

<comment><AUTHOR> HAHAHAHAHA. Thanks.

Was my first front-end on HN.

</comment></comment><comment><USER16> The writer has good taste

<comment><AUTHOR> Thanks.

Ps.: Lain + Lisp?

</comment></comment><comment><USER17> Very interesting</comment>


Microsoft Tag - <AUTHOR> http://www.microsoft.com/tag/

<comment><USER2> How is this different from QR code other than being proprietary?</comment>


100s of Monzo customers shut out of accounts in lockdown - <AUTHOR> https://www.theguardian.com/money/2020/jun/06/monzo-customers-shut-out-of-accounts-in-lockdown <comment><USER2> It's worth noting that if you think an account is being used fraudulently, it's literally illegal to reveal that to the customer. It's called tipping off. Not only can monzo be fined or lose their licenses but the human responsible can personally face charges including prison time.

This is why banks are very reluctant to give holders of frozen accounts any real information.

I'm sure there is plenty of crappy customer service and algorithms that's are not fit for purpose or can't cope with coronavirus too.

[https://www.cps.gov.uk/legal-guidance/proceeds-crime- act-200...](https://www.cps.gov.uk/legal-guidance/proceeds-crime- act-2002-part-7-money-laundering-offences)

Section 333

<comment><USER3> To an extent, I never understood how this made sense.

I could see a case for "we'll throw a plausible-but-nonthreatening status code on a flagged account." Tell the customer there was data loss and it's out of commission until the SMR-drive RAID rebuilds. But when they start responding with obvious no-answer answers and "system says no" alone, that chasnge in response style in and of itself is leaking information.

I've seen plenty of people reporting over the years "I've been blacklisted, nobody will say why" and not one of them ends with "I'm posting a followup from a holding cell", so it's not like they're pulling the plug at the last moment when the charges are filed and the police cruisers in motion. If it happens enough that ordinary people outside banking have experienced it, then I'm sure the cartels and terror cells know about it.

I feel like there's an opportunity for a sequence in a mob movie where one of the characters' debit cards unexpected declined, and he immediately excuses himself to tell his compatriates to shut it down.

</comment></comment><comment><USER4> "We will apologise to any legitimate customers who've been left out of pocket for a period of time"

Monzo

This attitude is simply shocking. To rephrase it:

"We are sorry if you feel offended about the fact that you're not able to feed your kids."

Not that I'm a potential customer, not living in the UK. But here's another company for my eternal shitlist.

<comment><USER5> > This attitude is simply shocking

This comes up every time from people who don't understand the regulatory landscape, as if it's the bank's fault that AML regulations and the legal offence of "tipping-off" exist.

All banks in the UK will do this to varying degrees. See [https://www.mirror.co.uk/money/hsbc-suddenly-blocked-bank- ac...](https://www.mirror.co.uk/money/hsbc-suddenly-blocked-bank- account-21327340)

Inevitably it always ends up with people complaining to the press, at which point the bank is blamed.

The whole system is broken: [https://s3-eu-west-2.amazonaws.com/lawcom-prod- storage-11jsx...](https://s3-eu-west-2.amazonaws.com/lawcom-prod- storage-11jsxou24uy7q/uploads/2019/06/6.5569_LC_Anti-Money- Laundering_Report_FINAL_WEB_120619.pdf)

> From regularly advising professionals and others in this sector, we are in > no doubt that the high volume of lower-value reports is due to the > imposition of personal criminal liability for failure to make a report where > one is due combined with the low threshold for reporting. Reports must be > made (absent special circumstances) if there is a possibility, which is more > than fanciful, that funds are criminally derived even if the reporter > believes them to be legitimate. The courts will back a reporter and absolve > them of liability to their customer even if there were no reasonable grounds > to make a report, provided the reporter held a genuine suspicion

Is it at all surprising that SARs are being filed when there's this real threat of _personal_ liability if suspicious activity was _not_ reported?

<comment><USER4> > This comes up every time from people who don't understand the regulatory > landscape

I work in finance, are obliged to complete a number of yearly trainings regarding KYC and money laundring and understand the regulatory lanscape very well, thank you very much.

Regulatory requirements do not mandate to treat your customers like shit. Throw in algorithms that just decide that You! Are Banned! for wild and wonderful reasons and a totally shitty customer support by design.

It's funny that as soon the press gets involved, or if it explodes on social media that "this specific cae didn't live up to our high standards, blablabla".

As the article states nicely: It takes a second to lock an account. But for the guy on the receiving it's the difference between paying the rent (if she can) and feeding the kids. Such callous behavior, iced by such statements by the press drone is beyond the pale.

<comment><USER5> >Regulatory requirements do not mandate to treat your customers like shit. Throw in algorithms that just decide that You! Are Banned! for wild and wonderful reasons and a totally shitty customer support by design.

What _can_ they say other than "your account has been frozen" if there's legislation that says "tipping off" is an offence offence that carries a maximum penalty of five years' imprisonment and/or an unlimited fine?

They can't explain they've made a suspicious activity report. They can't explain what has caused the account to be frozen. And there's no way for the bank or other participants in the regulatory process to defend themselves or explain why customer X was flagged. All we ever see are the customer's side of the story.

And yes, there will be false positives. Yes, there will be consequences. That's what happens when bank accounts get frozen.

Why is it surprising that this happens when there's personal liability, though?

I agree it's far from ideal, but change here needs to take place way above the individual banks.

<comment><USER3> >What can they say other than "your account has been frozen"

"Our system is absolute rubbish, we have absolutely no clue when it will be deborked?"

It's accurate. It doesn't leak information about the subject being under investigation, either directly, or by the lack of a normal excuse. It cleverly straddles the border between a technology problem and a regulatory one. And it provides plenty of opportunity to string along the account holder as long as necessary so they don't panic and move to cover their asses.

</comment></comment></comment></comment></comment><comment><USER6> As a Monzo customer this stuff is worrying, since all our money in the UK flows through it. If our joint account and pot were locked we would be in strife</comment>


Osquery: Easily ask questions about your Linux, Windows and macOS infrastructure - <AUTHOR> https://osquery.io/ <comment><USER2> Kinda shocked I have never heard of this before today. Seems very handy, especially for people deploying x-platform desktop apps or scripts. It is a SQL abstraction over OS information, kind of the SQL equivalent of the info you could glean by inspecting properties on the Python `os` module, and perhaps many OS/device details besides.

</comment><comment><USER3> A discussion about osquery is incomplete without mentioning Kolide fleet: [https://www.kolide.com/fleet/](https://www.kolide.com/fleet/)

</comment><comment><USER4> I don't know about others, but I think this is kinda amazing? There's been so many times I've wanted to have this ability when setting up a lab. Thanks for sharing!

</comment><comment><USER5> > Windows, macOS, CentOS, FreeBSD, and almost every Linux OS released since > 2011 are supported with no dependencies.

No dependencies?

        $ brew info osquery

        osquery: stable 3.3.2 (bottled)
        ...
        ==> Dependencies
        Build: bison , cmake , email@example.com
        Required: augeas , boost , gflags , glog , libarchive , libmagic , librdkafka , lldpd , email@example.com ,
        rapidjson , rocksdb , sleuthkit , ssdeep , thrift , xz , yara , zstd

<comment><USER6> That is a result of how Homebrew built and packaged it. There are downloads at [https://osquery.io/downloads](https://osquery.io/downloads), and for a Homebrew installation that page recommends installing the Cask.

        $ brew cask info osquery
        osquery: 4.4.0
        https://osquery.io/
        Not installed
        From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/osquery.rb
        ==> Name
        osquery
        ==> Artifacts
        osquery-4.4.0.pkg (Pkg)
        ==> Analytics
        install: 120 (30 days), 198 (90 days), 206 (365 days)

<comment><USER5> Thanks for the clarification. I notice that "brew cask install osquery" installs a package. It would be helpful to get some instructions on what to do next.

</comment></comment></comment><comment><USER7> Love that this is no dependencies. It was starting to look like a lost battle that everything has 2000 circular dependencies.

</comment><comment><USER8> This looks like a cross-platform tool similar to WMI Query Language (WQL). I prefer the ease of using WQL in PowerShell scripts, so I imagine it may become popular.

<comment><USER9> Yes, we use it a fair bit in some internal dev scripts to make them platform agnostic.

</comment></comment><comment><USER10> Facebook uses this extensively on their systems.</comment>


Kill Your Users Table - <AUTHOR> http://blog.wekeroad.com/blog/kill-your-users-table/

<comment><USER2> I like this notion, but his actual suggestion isn't to kill the users table, rather to outsource it (to OpenID or a similar service).

</comment><comment><USER3> If you're considering the encryption of passwords and not the hashing and salting of passwords, you're already in some trouble.

You don't want to decrypt passwords.

You want to hash, and compare. And only then with a cryptographically secure hash.

And you also want to consider building in some form of evasion, and quite possibly to introduce a deliberate delay in the password processing; steps to slow the inevitable password attacks.

<comment><USER4> Seconded.

I would add that you should use more than one form of cryptography: one type for sensitive contact information and another for passwords. For internal support you often need to decrypt names, address, email but you don't want that same algorithm for passwords, credit cards, etc.

</comment></comment><comment><USER5> I've been building on Facebook's platform lately, and some of the guidelines they have (rarely followed) started me thinking in terms of gradual information request, or a JIT users table.

Need the name? Ask for it, and store it in a cookie.

Need a persistent way to refer to a particular user? Use OpenID (or the Facebook UID, in my case). What if they don't have OpenID? Have links to a few providers, and also _be a super simple provider_ yourself, built into your app. Don't store anything you don't have to.

As you find you need more information, ask for it, and explain why you need it. Make it easy for users to remove selective pieces of information if you don't need it anymore. Help them know when that is.

</comment><comment><USER6> Every time I see a stupid and provocative title, I am hoping that it's something interesting and title was chosen only to attract attention.

Yet again, it was just that - stupid: if you're afraid to deal with usernames/passwords in a secure fashion, how would you deal with credit card numbers for recurring billing? Or how would you approach a task of writing a billing system for someone like AT&T?

<comment><USER7> Hmm... the application I spend all my time on doesn't include credit cards. :)

Neither does Reddit.

Neither do most web apps I can think of. They might be billed services, but that's why we have credit card gateways and prebuilt billing systems.

</comment></comment><comment><USER8> What a gyp! This page doesn't tell me _any_ ways to kill my users.

<comment><USER9> s/page/table</comment></comment>


A modest proposal: let Congress go without insurance  - <AUTHOR> http://www.nytimes.com/2009/10/08/opinion/08kristof.html?ref=opinion

<comment><USER2> Instead of taking insurance away from Congress, I think we should just make them each pay for someone else's converage, too. Hitting someone in the wallet is easier than trying to make them afraid.</comment>


First Methane Leak Found on Antarctic Sea Floor Confirms Researchers' Fears - <AUTHOR> https://www.sciencealert.com/there-s-a-strange-methane-leak-from-antarctica-s-sea-floor-and-it-s-not-good-news <comment><AUTHOR> >Riddles in the cold: Antarctic endemism and microbial succession impact methane cycling in the Southern Ocean

[https://royalsocietypublishing.org/doi/10.1098/rspb.2020.113...](https://royalsocietypublishing.org/doi/10.1098/rspb.2020.1134)

</comment><comment><USER2> Did a memo go out saying it's "global heating" and not "warming"?</comment>


Fifty Fizzbuzzes - <AUTHOR> http://vihart.com/fifty-fizzbuzzes/ <comment><USER2> This is where the actual fizz buzzes are: [https://github.com/vihart/fiftyfizzbuzzes/blob/master/Fifty%...](https://github.com/vihart/fiftyfizzbuzzes/blob/master/Fifty%20Fizzbuzzes.ipynb)

<comment><USER3> Note also that not all of them are correct :)

</comment></comment><comment><USER4> I like this idea. I find it fascinating how many developers I've interviewed who still have not come across FizzBuzz, and how many of those cannot solve the problem. Some of the more interesting interviews I've given though have been with people who know the FizzBuzz problem, where I ask them to make the worst possible version of it that they can. It turns out to be more difficult than they think it will be, and a deeper thinking and communicating exercise than solving the simple FizzBuzz problem itself.

<comment><USER5> Can't solve because they weren't actually programmers or more because of deer in headlights?

<comment><USER4> Yes.

</comment></comment></comment><comment><USER6> The python notebook linked in the main post:

[https://mybinder.org/v2/gh/quasiben/fiftyfizzbuzzes/master?f...](https://mybinder.org/v2/gh/quasiben/fiftyfizzbuzzes/master?filepath=Fifty%20Fizzbuzzes.ipynb)

</comment><comment><USER7> Vi's site is down from the onslaught.

In the meantime, enjoy the ever-classic Fizz Buzz Enterprise Edition:

[https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...](https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition)

<comment><USER8> I opened the link thinking "hah, what a gag!" But then I thought it'd be funny to try to find the core fizzbuzz logic. Turns out that it hits way too close to home, I just got really annoyed. Not sure what I expected.

<comment><USER9> As the original author, I apologize for your agony.

This is a common complaint from people I discussed the project with, and the obvious reason for the success of the project in terms of people contributing patches and issues.

</comment></comment></comment><comment><USER10> I feel like everyone leaving a fizzbuzz solution in the comments of this post is missing the point of this article...

<comment><USER11> Fizzbuzz does that to some people. It's a mind-control meme, and a very powerful one.

</comment></comment><comment><USER12> The Jupyter notebook is here: [https://mybinder.org/v2/gh/quasiben/fiftyfizzbuzzes/master?f...](https://mybinder.org/v2/gh/quasiben/fiftyfizzbuzzes/master?filepath=Fifty%20Fizzbuzzes.ipynb)

The code on GitHub is here: [https://github.com/vihart/fiftyfizzbuzzes/blob/master/Fifty%...](https://github.com/vihart/fiftyfizzbuzzes/blob/master/Fifty%20Fizzbuzzes.ipynb)

</comment><comment><USER13> HN user aidenn0 won FizzBuzz a few years ago, with a Malbolge [1] version:

[https://news.ycombinator.com/item?id=4922282](https://news.ycombinator.com/item?id=4922282)

[1] [https://en.wikipedia.org/wiki/Malbolge](https://en.wikipedia.org/wiki/Malbolge)

</comment><comment><USER14> Wayback Machine mirror: [https://web.archive.org/web/20181101043107/http://vihart.com...](https://web.archive.org/web/20181101043107/http://vihart.com/fifty- fizzbuzzes/)

</comment><comment><USER15> Is this the same vihart of YouTube hexaflexagon fame?

[https://youtu.be/VIVIegSt81k](https://youtu.be/VIVIegSt81k)

<comment><USER16> Yes.

</comment></comment><comment><USER17> I didn't know that fizzbuzz was a children's game.

That explains a LOT. As in most descriptions of it are annoyingly ambiguous.

Whereas if you knew the game, you know it already.

<comment><USER18> _> As in most descriptions of it are annoyingly ambiguous._

My very first interviewer (intentionally) didn't spec fizzbuzz correctly. The real test was whether the candidate listened to the customer's/lead engineer's spec instead of jumping to conclusions.

Fortunately, I was just entering college and hadn't heard of fizzbuzz before. I passed the "test" but for the wrong reason.

<comment><USER19> Being purposely misleading then penalising those who are misled doesn't seem like a good hiring strategy, but then again, I've never tried to hire someone.

</comment></comment></comment><comment><USER20> Here's mine:

        Array.from(new Array(100)).forEach((_, i)=>++i&&console.log(((i%3?"":"Fizz")+(i%5?"":"Buzz"))||i))

[https://twitter.com/tracker1/status/1045475226128007169](https://twitter.com/tracker1/status/1045475226128007169)

<comment><USER21> I just committed a version that works in my golang BASIC interpreter:

[https://github.com/skx/gobasic/blob/master/examples/15-fizz-...](https://github.com/skx/gobasic/blob/master/examples/15-fizz- buzz.bas)

Perhaps not the cleanest, since I support neither `CASE` nor `ELSE IF`. But it seems to be correct.

</comment></comment><comment><USER22> We've killed it.

<comment><USER6> [https://web.archive.org/web/20181101043107/vihart.com/fifty-...](https://web.archive.org/web/20181101043107/vihart.com/fifty- fizzbuzzes/)

</comment></comment><comment><USER23> FYI: You find 20+ in the FizzBuzz by Example - There's More Than One Way To Do It (Free Online Book Edition) - [http://yukimotopress.github.io/fizzbuzz](http://yukimotopress.github.io/fizzbuzz)

</comment><comment><USER24> One done over my lunch break today: [https://gist.github.com/ErikAugust/67e61de02702b37ed04deea24...](https://gist.github.com/ErikAugust/67e61de02702b37ed04deea24452a534)

</comment><comment><USER25> Here's my long-ago contribution. Scroll down for the visual. [https://codepen.io/daphneokeefe/pen/Ayxlz](https://codepen.io/daphneokeefe/pen/Ayxlz)

</comment><comment><USER26> Vi Hart's YouTube channel is quite entertaining: [https://www.youtube.com/user/Vihart](https://www.youtube.com/user/Vihart)

</comment><comment><USER27>
      #include <stdlib.h>
      #include <stdio.h>

      static const char str[] = "fizzbuzz";

      static inline void out(int i, size_t offset, size_t sz)
      {
      	if (sz) {
      		fwrite(str + offset, sz, 1, stdout);
      	} else {
      		fprintf(stdout, "%d", i);
      	}
      	putchar('\n');
      }

      int main(void)
      {
      	for (int i = 1; i <= 100; i++) {
      		int a = i % 3 == 0;
      		int b = i % 5 == 0;
      		out(i, 4*((a^b)&b), 4*(a+b));
      	}
      	exit(0);
      }

There's a way to remove that conditional, too. Probably.

</comment><comment><USER28> This is called out in the post, but 32 is actually a really cool rhythmic (and accurate) fizzbuzz.

</comment><comment><USER29>
      {:[~x!15;"fizzbuzz";~x!3;"fizz";~x!5;"buzz";$x]}'1+!100
      {:[0<#w::[x!3;"";"fizz"],:[x!5;"";"buzz"];w;$x]}'1+!100

<comment><USER29> Are there any shorter programs than these two k3 ones?

<comment><USER30> In Dyalog APL:

        {∊(3↑(0=3 5|⍵)∪1)/'Fizz' 'Buzz'⍵}¨⍳100

[https://tryapl.org/?a=%7B%u220A%283%u2191%280%3D3%205%7C%u23...](https://tryapl.org/?a=%7B%u220A%283%u2191%280%3D3%205%7C%u2375%29%u222A1%29/%27Fizz%27%20%27Buzz%27%u2375%7D%A8%u2373100&run)

<comment><USER29> Neat!

</comment></comment></comment></comment><comment><USER31> A small exercise:

write Spectre/timing attacks resilient fizzbuzz.

</comment><comment><USER32> Why does static content need a database connection? #OverEngineering

<comment><USER33> Using WordPress is "over-engineering"?

<comment><USER34> Yes

<comment><USER35> More or less so than running a static site generator that lives on one particular machine, and using Git to push your changes to the server?

<comment><USER36> More like use a static generator to push to S3, optionally with a Cloudfront distribution in front of it.</comment></comment></comment></comment></comment>


TCP/IP over Amazon Cloudwatch Logs - <AUTHOR> https://medium.com/clog/tcp-ip-over-amazon-cloudwatch-logs-c1cf08f2296c <comment><USER2> If AWS Lambda is described as "serverless", I guess this could be called "networkless"?

 _using AWS services in a way that might horrify some AWS engineering teams_

..and probably greatly pleases the finance department.

<comment><USER3> As a Lambda engineer, I can happily report that we found this very amusing.

</comment></comment><comment><USER4> I'm curious about something similar using S3 as the transport.

<comment><USER5> SQS could be interesting too.

</comment></comment><comment><USER6> Nice Scanner Darkly references :-) Only last night, I rewatched it

</comment><comment><USER7> While a great hack, this isn't that interesting. You still have to pay for CloudWatch utilization and the speed isn't that great. You could really chose any Service to log data to and achieve this.

<comment><USER8> Interesting is in the eye of the beholder.

There's also TCP/IP over chat (XMPP, including Facebook's old chat).

[1] [https://github.com/crackleware/im-tcp- tunneler](https://github.com/crackleware/im-tcp-tunneler)</comment></comment>


Ask HN: App of the Year? - <AUTHOR>

What app has had the biggest impact for you in 2013? <comment><USER3> If you ask me as a developer of my apps, of course, I'd say all my apps that I developed during 2013 with a special shout-out to my Quotegram iOS app ([https://itunes.apple.com/us/app/quotegram/id705700846](https://itunes.apple.com/us/app/quotegram/id705700846)). It taught a bunch in terms of planning, marketing, interacting with bloggers and the whole 9-yard.

</comment><comment><USER4> Probably my first app because it launched me into my consulting career, which led to writing my first book, which is leading to my ideal lifestyle.

</comment><comment><USER5> Philantro ([https://www.philantro.com](https://www.philantro.com)) - <USER2> with nonprofits and in the so called "Civiltech" sphere has humbled and made me a more gifted programmer. It's the sort of transformation that can only come with coding for the heart vs the pocket. We're launching in a few weeks.

</comment><comment><AUTHOR> Pocket</comment>