Types are optional and they can be also inferred.
1,026 karma · joined December 11, 2011
Types are optional and they can be also inferred.
Even if you don't add any type annotations yourself, you'll still benefit from the annotated libraries and from type inference.
To get almost all of the tooling benefits, you only have to annotate arguments and the return value. That's it. Inside your functions you generally can omit them because there are enough types floating around. Literals have a type and if you call an annotated function, you also know what type you get back.
E.g. this function is fully typed (none of the variables is purple):
You mean like CS? '#' actually isn't a very popular choice for this.
I kinda lost interest in this project, because, back then, it actually didn't work. The SVG spec had to be fixed first and Chrome didn't even display those images at all due to a bug.
Basically, the problem with the spec was that it required the masks to use some nonsensical color space. Half of the implementations didn't, because it didn't make any sense and because the wording was extremely confusing.
Anyhow, the spec got changed and browsers started to implement this newer version of the spec. Nowadays, it actually does work.
Well, that's basically the whole story. That's why there isn't an article which promotes it. There were showstoppers which made it completely unusable.
https://github.com/mahonnaise/svgjng/
java -jar svgjng.jar <rgba image> <svgz file name> [color quality] [alpha quality]
It tries PNG and JPEG for RGB and alpha and then uses whichever ended up smaller.Gallery: http://kaioa.com/b/1102/svgjng/index.html
"SVGZ (auto)" means default parameters. I.e. just:
java -jar svgjng.jar foo.png foo.svgzAnyhow, the Wikipedia article disagrees with you, too. Got any sources for your definition?
> It is called a "zero-day" because the programmer has had zero days to fix the flaw
90-day, you mean. It's only zero-day if they had zero days to come up with a solution. That's what "zero-day" means.
I couldn't set the mouse sensitivity high enough though.
Doom controls a lot better. I played some Brutal Doom just an hour ago. In Doom, there is some inertia. You accelerate and there is some friction. In this game, movement is a binary on/off thing. The bobbing is also very jarring.
There are dozens of ways to do classes/inheritance. Standardizing this means better tooling, documentation, and interoperability.
>Default parameters. By itself, this is another “so what” feature.
It's extremely useful in conjunction with named parameters. Named parameters are so much better than "option" objects.
If it's right in the function's signature, you can see right away how this thing is supposed to be used. Since it's declarative, it can be also picked up by your editor, too.
>let considered harmful
No, it's not. It makes variable declaration work like everywhere else. Function scope is the super weird anomaly.
Non-English identifiers can be quite troublesome in international projects. Even if your project currently isn't, it might be in a few years. It's a maintenance nightmare waiting to happen.
To make matters worse, the used JS engine is fairly old and the exceedingly wordy documentation is kinda hard to follow.
I'm a lot happier with RethinkDB.
If you aren't visualizing tiny deltas, don't truncate the y-axis. It's misleading.
Flexbox is pretty damn good:
http://philipwalton.github.io/solved-by-flexbox/
Also, in case you didn't know, there is also Grid Layout:
Flexbox is 1D, Grid Layout is 2D.
http://en.wikipedia.org/wiki/Block_Elements
Related:
Yes, if you can use `let`, there is no reason whatsoever to use `var` ever again.
If you want the `var` behavior, just put your declaration at the very top of the innermost function. With most code conventions, that's where you'd put a `var` declaration anyways.
For what it's worth, Crockford also recommended to use `let` exclusively as soon as you can.
http://i.imgur.com/2wAcBdL.png (23.43 KB)
For nicer looking images, scan as grayscale and then use Photoshop's Image -> Adjustments -> Curves to turn everything almost-white to white and everything almost-black to black:
http://i.imgur.com/ktj8WkE.png
Alternatively, do a high-DPI 1bit scan, convert the document to 8bit, and then scale it down.
E.g. when you go from 1600 DPI to 100 DPI, you have 16x16 1bit pixels per 8bit pixel. The result will look smooth and crispy.
1. Add fonts to your collection.
2. Click the download button in the upper right corner.
[...document.querySelectorAll('.foo')].forEach(node => node.classList.remove('bold'));There are also dashes and underscores. I use underscores for "modifiers". That is, classes which modify the look of some building block. E.g. "Button" is the usual one and "Button _large" is a large one.
Custom elements will hopefully help to make this kind of structure a bit more popular. Right now they still have a few rough edges though.
There is `setImmediate` for making something run the very next cycle. However, only IE10+ supports it and the other browser vendors are against it. You can use abuse `postMessage` to get a similar effect.
I'm actually kinda serious. Moving pieces of Python code around is unnecessarily error-prone. I don't consider this to be a good tradeoff.
The armed ones are in a subcategory called "unmanned combat aerial vehicle" (UCAV) or just "combat drone".