359 Matching Annotations
  1. Dec 2020
    1. This is an opportunity to fix a bug: if you're on a page that redirects to a login page if there's no user object, or otherwise preloads data specific to that user, then logging out won't automatically update the page — you could easily end up with a page like HOME ABOUT LOG IN ----------------------------------------------------------------------------------------- Secret, user-specific data that shouldn't be visible alongside a 'log in' button:
    1. Some devs prefer Svelte’s minimal approach that defers problems to userland, encouraging more innovation, choice, and fragmentation, and other devs prefer a more fully integrated toolkit with a well-supported happy path.

      tag?: what scope of provided features / recommended happy path is needed?

    2. Making UIs with Svelte is a pleasure. Svelte’s aesthetics feel like a warm cozy blanket on the stormy web. This impacts everything — features, documentation, syntax, semantics, performance, framework internals, npm install size, the welcoming and helpful community attitude, and its collegial open development and RFCs — it all oozes good taste. Its API is tight, powerful, and good looking — I’d point to actions and stores to support this praise, but really, the whole is what feels so good. The aesthetics of underlying technologies have a way of leaking into the end user experience.
    3. It's true that Svelte does not allow you to map over children like React, but its slot API and <svelte:component> provide similarly powerful composition. You can pass component constructors as props and instantiate them with <svelte:component>, and use slots and their let bindings for higher order composition. It sounds like you're thinking in virtual DOM idioms instead of Svelte's.
    4. However, Svelte isn't React or Vue or any other framework, the same approach will not always work and given that Svelte has very different constraints and approach that works well in another framework is not suitable with Svelte. Trying to apply approaches use with other frameworks to Svelte will invariably end in frustration.
    1. Each area requires specific learning and thinking in a certain way. Front-end is user centric, back-end is closer to algorithms and parallel programming, databases require thinking in streams of data based on a model (similar to set theory and model checking).
    1. I think the main difference between the two are the way API are served. Some smelte components need you to input big chunk of json as props, while i prefer keep props as primitive types and in the other hand give you different components tags to compose.
    2. I don't think this is what really matters at the end, since whatever is the implementation the goal should be to provide a library that people actually like to use.
  2. Nov 2020
    1. I wouldn't use Flutter for web, mobile is good though.
    2. It's super promising for web apps, just maybe not for web pages. I went from React to Svelte to Flutter for my current app project, and every step felt like a major upgrade.Flutter provides the best developer experience bar none, and I think it also has the potential to provide the best user experience. But probably only for PWAs, which users are likely to install anyway. Or other self-contained experiences, like Facebook games. It does have some Flash vibes, but is far more suitable for proper app development than Flash ever was while still feeling more like a normal website to the average user. It won't be the right choice for everything, but I believe it will be for a lot of things.
    1. In the past, I tried to create some proof of concepts with svelte, but I usually ended up missing some of the features that RxJS provides. Now that I know that they complement each other well, I will grab this combination more often
    1. I'm still calling this v1.00 as this is what will be included in the first print run.

      There seems to be an artificial pressure and a false assumption that the version that gets printed and included in the box be the "magic number" 1.00.

      But I think there is absolutely nothing bad or to be ashamed of to have the version number printed in the rule book be 1.47 or even 2.0. (Or, of course, you could just not print it at all.) It's just being transparent/honest about how many versions/revisions you've made. 

    1. I know this is existing code but we can probably use this as an opportunity to "fix" it: it is discouraged to use the async exists method to check for a file and try operating on it.
    1. Converting Angular components into Svelte is largely a mechanical process. For the most part, each Angular template feature has a direct corollary in Svelte. Some things are simpler and some are more complex but overall it's pretty easy to do.
    1. Express - 19 $ 🏃‍♀️ Skip the Review Queue 🕒 Published in 3 days 💌 Full Customer Support 💚 Support the team

      Wow, after seeing how this site works, I don't like much like it anymore.

      Esp. this below:

      Choose your preferred publish date - 9 $ Feature your project on top for 14 days and get an additional tweet - 19 $

      I hope there is/will be soon a more open/free alternative (like the "awesome" lists that use GitHub PRs instead of an opaque/proprietary submisison form).

    1. Some of the verbs implemented by systemctl are designed to provide a high-level overview in a human readable format. All that information is available over dbus, and/or journalctl, systemctl show. We could provide that information in json format, but there's a second problem. Information and format of information printed by e.g. systemctl status is not stable. Since the output is not suitable for programmatic consumption anyway, there's no need to provide it in a machine readable format.
    2. Although I agree that -o json should return proper JSON, believe the proper way for external tools like SaltStack etc. to talk to systemd is DBus. See also saltstack/salt#20392 - everything else is more or less just hack-ish and prone to break easily.
  3. Oct 2020
    1. If you have a better/simpler/"more official" solution, I'd still love to see it!

      The "official" solution is to use submitErrors (see Erik's answer).

    2. is this solution considered a hack or is something that we can use as an approved workaround in scenarios where we need to manually trigger validations?
    3. Library author here. I'm always fascinated by new ways people can invalidate my assumptions. I mean that in a sincerely positive way, as it results in learning.
    4. The more official way to do this would be to run the check (you could even reuse this.validate) in onSubmit.
    1. mixing the turing complete of javascript with the markup of HTML eliminates the readability of JSX so that it is actually harder to parse than a solution like hyperscript
    2. One of the primary tasks of engineers is to minimize complexity. JSX changes such a fundamental part (syntax and semantics of the language) that the complexity bubbles up to everything it touches. Pretty much every pipeline tool I've had to work with has become far more complex than necessary because of JSX. It affects AST parsers, it affects linters, it affects code coverage, it affects build systems. That tons and tons of additional code that I now need to wade through and mentally parse and ignore whenever I need to debug or want to contribute to a library that adds JSX support.
    3. Supporting JSX out of the box is the engineering equivalent of Mozilla supporting DRM out of the box in FireFox.
    4. If the react cargo cult didn't have the JSX cowpath paved for them and acclimated to describing their app interface with vanilla javascript, they'd cargo cult around that. It's really about the path of least resistance and familiarity.
    5. The only "issue" it has is that its unfamiliar. People have been working with HTML for years and are comfortable with it. That's basically the only reason that people find it more readable. If you make an effort to spend sometime with hyperscript, it becomes as familiar and readable as jsx.
    1. This balancing act needs to take into account project complexity (size, distribution, etc.), uncertainty (risk, innovation need, etc.), and the cost of change at the project level and for each major component.
    2. Compounding the problem of iteration disguised as oscillation is the cost of change.
    3. Incurring high-cost changes isn't evolutionary design-it's oscillation caused by poor planning and requirements specification on a high cost-of-change component-it tips the anticipation/adaptation balance too far towards adaptation.
  4. Sep 2020
    1. The benefit of this approach is that rather than having these defaults and fighting against them, it’s fully up to you to decide how to handle everything.
    2. While Webpack is focused on using CommonJS as its primary module system and converting everything to that, Rollup decided to take the opposite approach — focusing on ES Modules instead.
    3. Unfortunately, many third party libraries, even though they are written in ESM, are published to npm as CJS modules, so we still need to concatenate them.
    1. But this is only a halfway decent way to clarify that this is an external dependency, because the only way to resolve a peer dependency warning is to install react from npm—there's no way to notify npm that you resolve the dependency to a browser global. So peer dependencies should be avoided in favor of external declarations. Then Rollup will take care of warning about "unresolved dependencies", even if external declarations can't express a particular version range with which your library is compatible like peer dependencies can.

      Interesting. Didn't realize. From my perspective, I usually do install packages via npm, so wouldn't have known about this problem.

      npm and rollup both try to solve this problem but in different ways that apparently conflict? So if a lib author lists peerDependencies then it can cause problems for those getting lib via browser (CDN)? How come so many libs use it then? How come I've never heard of this problem before?

    2. There are two ways of handling this with Rollup, as described by the troubleshooting link from the warning. Unfortunately, both Rollup and React recommend the wrong one.
    1. I think Svelte's approach where it replaces component instances with the component markup is vastly superior to Angular and the other frameworks. It gives the developer more control over what the DOM structure looks like at runtime—which means better performance and fewer CSS headaches, and also allows the developer to create very powerful recursive components.
    1. Aside from being an implementation nightmare, I think the proposal in this RFC is strictly better than props-in-style — it gives you the same expressive power in a neater, more idiomatic way, along with the global theming ability.
    2. This has the merit of simplicity and obviousness, but it's not particularly ergonomic: it signals that we don't consider component themeability to be a problem worth solving properly.
    1. There are tools in Svelte that break this expectation to a degree, but they are a bit annoying to use, which makes it an active decision on the part of the developer. The API hints at the way we want you to do things because we feel that this will give the better experience.
    2. Most of the linked issues, as well as this RFC, attempt to solve this problem by relaxing Svelte's CSS scoping rules, providing a better API with which to use global, or by manually passing down classes. We have never found this to be an acceptable solution which is why those issues have been closed. That position has not changed.
    1. I’ve seen some version of this conversation happen more times than I can remember. And someone will always say ‘it’s because you’re too used to thinking in the old way, you just need to start thinking in hooks’.

      But after seeing a lot of really bad hooks code, I’m starting to think it’s not that simple — that there’s something deeper going on.

  5. Aug 2020
    1. As a web designer, I hate that "log in" creates a visual space between the words. If you line up "Log In Register" - is that three links or two? This creates a Gestalt problem, meaning you have to really fiddle with spacing to get the word groupings right, without using pipe characters.

      Sure, you can try to solve that problem by using a one-word alternative for any multi-word phrase, but that's not always possible: there isn't always a single word that can be used for every possible phrase you may have.

      Adjusting the letter-spacing and margin between items in your list isn't that hard and would be better in the long run since it gives you a scalable, general solution.

      "Log in" is the only correct way to spell the verb, and the only way to be consistent with 1000s of other phrasal verbs that are spelled with a space in them.

      We don't need nor want an exception to the general rule just for "login" just because so many people have made that mistake.

  6. Jul 2020
    1. For example, as the GDPR requires that a controller must be able to demonstrate that valid consentwas obtained, all presumed consents of which no references are kept willautomatically be below theconsent standard of the GDPR and will need to be renewed. Likewise as the GDPR requires a“statement or a clear affirmative action”, all presumed consents that were based on a more impliedform of action by the data subject (e.g.a pre-ticked opt-in box) will also not be apt to the GDPRstandard of consent.
    1. The cookie banner will be displayed any time a user visits your site for the first time or when you have decided to add a new vendor to your list of vendors (since it’s a new disclosure and potentially a consent request for that vendor may be required).
    1. Matz, alas, I cannot offer one. You see, Ruby--coding generally--is just a hobby for me. I spend a fair bit of time answering Ruby questions on SO and would have reached for this method on many occasions had it been available. Perhaps readers with development experience (everybody but me?) could reflect on whether this method would have been useful in projects they've worked on.
  7. May 2020
    1. The element dem in epidemic, endemic, and pandemic comes from the ancient Greek word demos, which meant people or district:

      Interesting how a word (pandemic) that literally means "all people" has ended up (only) meaning a disease that effects all people. Yet nowhere in the word does it say anything about a disease.

    1. A "tag" is a snippet of code that allows digital marketing teams to collect data, set cookies or integrate third-party content like social media widgets into a site.

      This is a bad re-purposing of the word "tag", which already has specific meanings in computing.

      Why do we need a new word for this? Why not just call it a "script" or "code snippet"?

    1. Taxonomy, in a broad sense the science of classification, but more strictly the classification of living and extinct organisms—i.e., biological classification.

      I don't think the "but more strictly" part is strictly accurate.

      Wikipedia authors confirm what I already believed to be true: that the general sense of the word is just as valid/extant/used/common as the sense that is specific to biology:

      https://en.wikipedia.org/wiki/Taxonomy_(general) https://en.wikipedia.org/wiki/Taxonomy_(biology)

    1. "linked data" can and should be a very general term referring to any structured data that is interlinked/interconnected.

      It looks like most of this article describes it in that general sense, but sometimes it talks about URIs and such as if they are a necessary attribute of linked data, when that would only apply to Web-connected linked data. What about, for example, linked data that links to each other through some other convention such as just a "type" and "ID"? Maybe that shouldn't be considered linked data if it is too locally scoped? But that topic and distinction should be explored/discussed further...

      I love its application to web technologies, but I wish there were a distinct term for that application ("linked web data"?) so it could be clearer from reading the word whether you meant general case or not. May not be a problem in practice. We shall see.

      Granted/hopefully most use of linked data is in the context of the Web, so that the links are universal / globally scoped, etc.

    1. generic-sounding term may be interpreted as something more specific than intended: I want to be able to use "data interchange" in the most general sense. But if people interpret it to mean this specific standard/protocol/whatever, I may be misunderstood.

      The definition given here

      is the concept of businesses electronically communicating information that was traditionally communicated on paper, such as purchase orders and invoices.

      limits it to things that were previously communicated on paper. But what about things for which paper was never used, like the interchange of consent and consent receipts for GDPR/privacy law compliance, etc.?

      The term should be allowed to be used just as well for newer technologies/processes that had no previous roots in paper technologies.

  8. Apr 2020
    1. For instance, one recent blog entry from the Irish Data Protection Commission discussing events at schools borders on the absurd:“Take the scenario whereby a school wants to take and publish photos at a sports day ­– schools could inform parents in advance that photographs are going to be taken at this event and could provide different-coloured stickers for the children to wear to signify whether or not they can be photographed,” the Commission suggested. The post goes on to discuss the possibility of schools banning photographs at a high school musical, but suggests that might be unwieldy.
  9. Mar 2020
    1. That outcome, in fact, is why the General Data Protection Regulation has been introduced. GDPR is being billed by the EU as the biggest shake-up of data privacy regulations since the birth of the web, saying it sets new standards in the wake of the recent Facebook data harvesting scandal.
    1. you have less direct control as you must rely on the vendor’s adherence to IAB’s guidelines for compliance.
    2. Directly blocking the vendor scripts (using another prior blocking method), then executing them only after consent has been collected. This method requires more implementation work and it’s a bit slower in terms of execution time, but it allows personalized ads to be served from the first page view (where consent hasn’t been collected yet) and gives you more direct and solid control in regards to ensuring compliance.

      pros:

      • allows personalized ads to be served from the first page view (where consent hasn’t been collected yet)
      • gives you more direct and solid control in regards to ensuring compliance.
    1. By choosing Matomo, you are joining an ever growing movement. You’re standing up for something that respects user-privacy, you’re fighting for a safer web and you believe your personal data should remain in your own hands, no one else’s.
  10. Jan 2020
  11. Dec 2019
    1. Confusingly, all the distributions I use (Ubuntu, RHEL and Cygwin) had some type of check (testing $- or $PS1) to ensure the current shell is interactive. I don’t like cargo cult programming so I set about understanding the purpose of this code in my .bashrc.
    1. No, clumsily working around the root account in situations where it is absolutely appropriate to use it is not for good reasons. This is just another form of cargo cult programming - you don't really understand the concept behind sudo vs root, you just blindly apply the belief "root is bad, sudo is good" because you've read that somewhere.
    1. Cargo cult programming is a style of computer programming characterized by the ritual inclusion of code or program structures that serve no real purpose.
    1. TC39 urges caution when using Stage 2-or below proposals, as it might result in inadvertent pressure from the community to keep the implementation as-is instead of improving it for fear of breaking existing code or ecosystem fragmentation (e.g. using a different symbol like # instead of @ for decorators).
    2. It's completely understandable that this happens without realizing it, but continuing to do so sets different expectations for how the language progresses. It's nothing to feel guilty about — we learn as a community and remind one another of how JavaScript works.
    3. Therefore, it's easy to search around for tweets/blog posts/talks that say "ES7 Decorators" and find that it's become the accustomed name for it.
  12. Nov 2019
    1. Can I ask people to upvote my submission? No. Users should vote for a story because they personally find it intellectually interesting, not because someone has content to promote.
    1. Good tests encode the developer's intention, they don't only lock in the test's behavior without editorialization of what's important and why. Snapshot tests lack (or at least, fail to encourage) expressing the author's intent as to what the code does (much less why)
  13. Oct 2019
    1. WHEN it comes to the state of the environment, it’s easy to get swept up in the doom and gloom of it all. Global warming, high pollution levels, climate change and waste disposal all dominate the headlines, painting a bleak picture of what’s to come. But just because it seems hopeless doesn’t mean it is.T roubled times call for ingenious solutions, and Australia is home to some of the brightest ecovators in the world, like Robert Pascoe, Managing Director of environmental solutions company Closed Loop.Through its Simply Cups initiative, Closed Loop is tackling Australia’s overwhelming waste problem by teaming up with 7-Eleven to save 70 million coffee cups from landfill this year — equivalent to the number they sell each year. While the most sustainable option is forgoing a disposable cup for a reusable one, some circumstances are beyond your control. Like your inability to remember anything before you’ve had your morning coffee. Which is a bit of a catch 22, isn’t it? That’s why 7-Eleven are installing dedicated coffee cup recycling bins in over 200 of their stores nationally, as well as funding 50 other large-scale locations including offices, universities and construction sites as part of the initiative. Coffee cups are one of the largest contributors to litter waste in Australia, with an estimated one billion ending up in landfill each year because they are not recycled.Yep, unfortunately you read that right: one billion cups.Coffee cups are one of the largest contributors to litter waste in Australia, with an estimated one billion ending up in landfill each year because they are not recycled.“T here’s a lot of misinformation out there,” Mr Pascoe said. “The consumers aren’t at fault because ultimately they don’t know what can be recycled and what can’t. I think if we can get that information out there, then people will demand products that are made from recycled materials.”For the majority of us, learning that our disposable coffee cups fall into the category of what can’t be recycled is both confusing and devastating. But, as Mr Pascoe says: “You can’t unknow something once you know it.”“Part of the problem is they didn’t know they weren’t being recycled. A lot of people said, ‘oh no, I put my coffee cup into the recycling to be recycled’, but of course, they’re not,” he continued.A nd why is that, exactly? It’s because most paper coffee cups are lined with a waterproof plastic that makes them hard to recycle — but not impossible. And that’s where Simply Cups comes in. “We’ve come up with a system that can actually recycle these cups if we keep them separate. We’ve got technology available now to do it, but we have to have coffee cups kept as a separate stream. Or anything that has the plastic lining of milk cartons or juice boxes,” Mr Pascoe said. The technology he’s referring to is “kind of like an organic solvent” that works to separate compound materials. Invented by Dennis Collins in Ballarat, the technology was initially designed to separate the PVC material from the hessian used in truck liners and advertising banners.“Dennis called us and said, ‘I’ve got a solution for your coffee cups’,” Mr Pascoe said. “So now we’re building a plant that can process around 150 million coffee cups per year, which is about 1.5 thousand tonnes. That will only be about 10 per cent of disposable coffee cups alone, so we’re going to need quite a few of these plants eventually. We have the solution, but we really need the coffee cups. “That’s why we started the Simply Cups program.”And that’s where coffee addicts come in. Once they drop their coffee cups into a designated recycling bin, they will then be taken to a processing plant using this new technology. The inner plastic lining of the cups will be removed and then recycled into things like plastic outdoor furniture, safety equipment and food trays.A nother eco-minded initiative helping solve Australia’s waste problem is the anti food-waste website, Yume. The website fights food waste — which is a huge problem in Australia — by allowing consumers to buy surplus and unsold food from restaurants and cafes at half the price. The ‘wholesale marketplace for surplus food that saves you money while saving the planet’ shares the same idea as ‘YWaste’, an app allowing retailers to sell food that would otherwise be thrown away.Over its 40-year history, Patagonia has donated about $114 million to grassroots environmental organisations. Over its 40-year history, Patagonia has donated about $114 million to grassroots environmental organisations. Their advertising has begged consumers not to buy things they don’t need (even their own products) and they’ve implemented a program that repairs their products for free rather than replace them. Their commitment to the environment is reflected in the materials of their products too; wetsuits are made of natural rubber and raincoats are made from recycled plastic bottles. This year, the company launched Patagonia Action Works, a digital platform that aims that aims to connect people with environmental nonprofits, helping them get involved through events, petitions, and volunteering.H &M, too, are doing their bit to close the loop on fashion waste with their global campaign encouraging customers to recycle their clothes. They launched their garment collecting initiative in 2013, asking customers to drop off any unwanted items from their closets. Depending on the condition of the clothing, the items are either distributed to second-hand stores for resale, or recycled into other items like yarn, rags, and insulation materials.And just look at Elon Musk. He’s raking in bajillions of dollars every minute almost exclusively thanks to Tesla and SolarCity, which have disrupted an entire industry. While some snigger at his grand ideas — let’s colonise Mars! — the accomplishments of how he has changed the way we shop for cars are hard to deny.A fter a complicated relationship with French beauty giant L’Oreal, The Body Shop is now in the hands of ethical Brazilian beauty brand Natura, promising to return to its pioneering ethical business.“All of us share the aim of doing business as a transformational force for good and a force for change for society and for the environment. We couldn’t think of a better union to nurture our brand’s commitment to naturality and sustainability,” said the Body Shop’s Communications Manager, Jessica Styles. “In 2016, The Body Shop launched its new sustainability plan, Enrich Not Exploit, supporting the brand’s vision to be the most ethical and sustainable global business in the world.”“All of us share the aim of doing business as a transformational force for good and a force for change for society and for the environment. We couldn’t think of a better union to nurture our brand’s commitment to naturality and sustainability,”Jessica Styles, Body Shop’s Communications Manager The plan set fourteen targets to help The Body Shop become a "truly sustainable business", including powering all its stores with 100 per cent renewable energy, overhauling product packaging by slashing the use of fossil fuel-based wrapping and designing new sustainable innovations. This year there’s a special focus on protecting Red Pandas in Nepal, a species currently on the endangered list.“Now more than ever, companies have the platforms and frameworks to not only voice doing good for the planet and people but to also act on it. The more we see big brands doing their bit, the more it becomes entrenched as something that not only employees but customers should be thinking about,” Styles said. “It’s the big corporations of the world that can help foster and influence this through their own businesses.” Skin care brand Youth to The People has made a conscience decision to use 100 per cent recyclable packaging. Co-founder Joe Cloyes says the decision reflects the brand’s philosophies.“We believe in creating as little waste as possible, we believe in cruelty-free products, and we believe in sourcing the best ingredients for your health and your skin. It's just that simple,” he said. “Modern consumers care about their environment just as much as they care about their healthy skin, and they're very much connected. We have found it's very important to people.”FIND OUT how many cups of coffee you could be recycling EVEry yearHow many cups of coffee do you drink every day?How many days per week do you drink coffee?How many weeks per year do you drink coffee?Calculatecups of coffeecould be recycled These are but a few eco-minded initiatives that offer Australians the chance to do their part in securing a cleaner future for generations to come. For every company that spills millions of gallons of oil into our oceans, there are plenty more companies operating under a socially responsible ethos. They recognise enterprise and environmental responsibility can in fact go hand-in-hand.“I think every organisation should have a sustainability policy,” Mr Pascoe said. “There are plenty of organisations around that can have a positive impact on the environment. We’re talking about the effect they have on the environment, the way they consume energy, and the way they manage their waste. In my world, there’s no such thing as waste.” Over one billion cups end up in landfill each year because they are not recycled. That’s why 7-Eleven has joined forces with Simply Cups to establish cup recycling in Australia. Save your cups by placing them in a Simply Cups bin at any participating 7-Eleven #cuprescue. Story by Erin Bromhead | news.com.au
  14. Aug 2019
  15. Sep 2018
  16. Sep 2017
    1. How can we draw many different bootstrap samples from the original sample if each bootstrap sample must contain the same number of cases as the original sample? If we allow every case in the original sample to be sampled only once, each bootstrap sample contains all cases of the original sample, so it is an exact copy of the original sample. Thus, we cannot create different bootstrap samples.

      So, bootstrapping without replacement doesn't allow for ANY bootstrapping regardless of sample size?

    1. Which type of sampling is better here: with or without replacement? Justify your answer.

      With replacement simply has more "bootstrapping" power than without correct? But with a large enough sample is there any other effect replacement or non-replacement has on the "outcome?" Or is the effect insignificant with large enough samples.

  17. Feb 2017
  18. Nov 2016
  19. Oct 2016